Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23301a9

Browse files
committed
* lib1.tex: documented dict.items() and dict.values()
* ref3.tex: documented new __init__ and __del__ special methods of class instances.
1 parent d316607 commit 23301a9

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

Doc/partparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def next_command_p(length, buf, pp, i, cmdname):
10011001
# things that are special to LaTeX, but not to texi..
10021002
onlylatexspecial = '_~^$#&%'
10031003

1004-
class Struct(): pass
1004+
class Struct: pass
10051005

10061006
hist = Struct()
10071007
out = Struct()

Doc/ref/ref3.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,24 @@ \subsection{Special methods for any type}
592592

593593
\begin{description}
594594

595+
\item[\tt __init__(self, args...)]
596+
Called when the instance is created. The arguments are those passed
597+
to the class constructor expression. If a base class has an
598+
\code{__init__} method the derived class's \code{__init__} method must
599+
explicitly call it to ensure proper initialization of the base class
600+
part of the instance.
601+
602+
\item[\tt __del__(self)]
603+
Called when the instance is about to be destroyed. If a base class
604+
has an \code{__del__} method the derived class's \code{__del__} method
605+
must explicitly call it to ensure proper deletion of the base class
606+
part of the instance. Note that it is possible for the \code{__del__}
607+
method to postpone destruction of the instance by creating a new
608+
reference to it. It may then be called at a later time when this new
609+
reference is deleted. Also note that it is not guaranteed that
610+
\code{__del__} methods are called for objects that still exist when
611+
the interpreter exits.
612+
595613
\item[\tt __repr__(self)]
596614
Called by the \verb\print\ statement and conversions (reverse quotes) to
597615
compute the string representation of an object.

Doc/ref3.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,24 @@ \subsection{Special methods for any type}
592592

593593
\begin{description}
594594

595+
\item[\tt __init__(self, args...)]
596+
Called when the instance is created. The arguments are those passed
597+
to the class constructor expression. If a base class has an
598+
\code{__init__} method the derived class's \code{__init__} method must
599+
explicitly call it to ensure proper initialization of the base class
600+
part of the instance.
601+
602+
\item[\tt __del__(self)]
603+
Called when the instance is about to be destroyed. If a base class
604+
has an \code{__del__} method the derived class's \code{__del__} method
605+
must explicitly call it to ensure proper deletion of the base class
606+
part of the instance. Note that it is possible for the \code{__del__}
607+
method to postpone destruction of the instance by creating a new
608+
reference to it. It may then be called at a later time when this new
609+
reference is deleted. Also note that it is not guaranteed that
610+
\code{__del__} methods are called for objects that still exist when
611+
the interpreter exits.
612+
595613
\item[\tt __repr__(self)]
596614
Called by the \verb\print\ statement and conversions (reverse quotes) to
597615
compute the string representation of an object.

Doc/tools/partparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def next_command_p(length, buf, pp, i, cmdname):
10011001
# things that are special to LaTeX, but not to texi..
10021002
onlylatexspecial = '_~^$#&%'
10031003

1004-
class Struct(): pass
1004+
class Struct: pass
10051005

10061006
hist = Struct()
10071007
out = Struct()

0 commit comments

Comments
 (0)