mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
* ext.tex: documentation for extending, reference counts, and embedding
(formerly ../misc/{EXTENDING,REFCNT,EMBEDDING}). Also affects Makefile. * text2latex.py: script to do part of the conversion from an plain ASCI text file (in my particular style) to LaTeX. (Chapter/section/subsection headers, and verbatim sections.) * partparse.py, texipre.dat, fix.el, Makefile: Minor cleanup of latex -> info conversion process (at least it works again, and with less debugging output). Removed fix.sh. * lib1.tex (section{Built-in Functions}): adapt description of str() and repr() to new situation. * lib3.tex (Module os): added exec*() variants. * lib3.tex (Module posix): added execve(). * lib2.tex (Module array): documented reality; remove typecode and itemsize, add byteswap, rename read/write to fromfile/tofile, and re-alphabetized. * lib1.tex (Built-in Functions): renamed bagof() to filter().
This commit is contained in:
parent
c600411755
commit
7a2dba2a00
13 changed files with 1683 additions and 157 deletions
|
@ -583,10 +583,12 @@ class, then \verb\x[i]\ is equivalent to \verb\x.__getitem__(i)\.
|
|||
(The reverse is not true --- if \verb\x\ is a list object,
|
||||
\verb\x.__getitem__(i)\ is not equivalent to \verb\x[i]\.)
|
||||
|
||||
Except for \verb\__repr__\ and \verb\__cmp__\, attempts to execute an
|
||||
Except for \verb\__repr__\, \verb\__str__\ and \verb\__cmp__\,
|
||||
attempts to execute an
|
||||
operation raise an exception when no appropriate method is defined.
|
||||
For \verb\__repr__\ and \verb\__cmp__\, the traditional
|
||||
interpretations are used in this case.
|
||||
For \verb\__str__\, the \verb\__repr__\ method is used.
|
||||
|
||||
|
||||
\subsection{Special methods for any type}
|
||||
|
@ -612,8 +614,12 @@ reference is deleted. Also note that it is not guaranteed that
|
|||
the interpreter exits.
|
||||
|
||||
\item[\tt __repr__(self)]
|
||||
Called by the \verb\print\ statement and conversions (reverse quotes) to
|
||||
compute the string representation of an object.
|
||||
Called by the \verb\repr()\ built-in function and by conversions
|
||||
(reverse quotes) to compute the string representation of an object.
|
||||
|
||||
\item[\tt __str__(self)]
|
||||
Called by the \verb\str()\ built-in function and by the \verb\print\
|
||||
statement compute the string representation of an object.
|
||||
|
||||
\item[\tt __cmp__(self, other)]
|
||||
Called by all comparison operations. Should return -1 if
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue