summaryrefslogtreecommitdiffstats
path: root/Doc/ref
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-08-02 15:53:05 (GMT)
committerFred Drake <fdrake@acm.org>2001-08-02 15:53:05 (GMT)
commit044bb4d22a20a172edc58dd7eed5f72428d2cc16 (patch)
treec619076b10cf8f4c56d135eb197751a715ffa6fd /Doc/ref
parent2b8d7bdd771b39a7bbddb53f911624c2ef5b0824 (diff)
downloadcpython-044bb4d22a20a172edc58dd7eed5f72428d2cc16.zip
cpython-044bb4d22a20a172edc58dd7eed5f72428d2cc16.tar.gz
cpython-044bb4d22a20a172edc58dd7eed5f72428d2cc16.tar.bz2
Explain that __init__() methods do not get to return values.
Diffstat (limited to 'Doc/ref')
-rw-r--r--Doc/ref/ref3.tex17
1 files changed, 9 insertions, 8 deletions
diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex
index 9074a0b..97c03f8 100644
--- a/Doc/ref/ref3.tex
+++ b/Doc/ref/ref3.tex
@@ -892,14 +892,15 @@ extracting a slice may not make sense. (One example of this is the
\subsection{Basic customization\label{customization}}
-\begin{methoddesc}[object]{__init__}{self\optional{, args...}}
-Called when the instance is created. The arguments are those passed
-to the class constructor expression. If a base class has an
-\method{__init__()} method the derived class's \method{__init__()} method must
-explicitly call it to ensure proper initialization of the base class
-part of the instance, e.g., \samp{BaseClass.__init__(\var{self},
-[\var{args}...])}.
-\indexii{class}{constructor}
+\begin{methoddesc}[object]{__init__}{self\optional{, \moreargs}}
+Called\indexii{class}{constructor} when the instance is created. The
+arguments are those passed to the class constructor expression. If a
+base class has an \method{__init__()} method the derived class's
+\method{__init__()} method must explicitly call it to ensure proper
+initialization of the base class part of the instance; for example:
+\samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special
+contraint on constructors, no value may be returned; doing so will
+cause a \exception{TypeError} to be raised at runtime.
\end{methoddesc}