mirror of https://github.com/python/cpython.git
Clarify that __getinitargs__ is called at pickle time!
This commit is contained in:
parent
4f80b65aa6
commit
5793039dce
|
@ -103,7 +103,9 @@ desirable to have a constructor that requires arguments; it is a
|
||||||
If it is desirable that the \code{__init__} method be called on
|
If it is desirable that the \code{__init__} method be called on
|
||||||
unpickling, a class can define a method \code{__getinitargs__()},
|
unpickling, a class can define a method \code{__getinitargs__()},
|
||||||
which should return a {\em tuple} containing the arguments to be
|
which should return a {\em tuple} containing the arguments to be
|
||||||
passed to the class constructor (\code{__init__()}).
|
passed to the class constructor (\code{__init__()}). This method is
|
||||||
|
called at pickle time; the tuple it returns is incorporated in the
|
||||||
|
pickle for the instance.
|
||||||
\ttindex{__getinitargs__}
|
\ttindex{__getinitargs__}
|
||||||
\ttindex{__init__}
|
\ttindex{__init__}
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,9 @@ desirable to have a constructor that requires arguments; it is a
|
||||||
If it is desirable that the \code{__init__} method be called on
|
If it is desirable that the \code{__init__} method be called on
|
||||||
unpickling, a class can define a method \code{__getinitargs__()},
|
unpickling, a class can define a method \code{__getinitargs__()},
|
||||||
which should return a {\em tuple} containing the arguments to be
|
which should return a {\em tuple} containing the arguments to be
|
||||||
passed to the class constructor (\code{__init__()}).
|
passed to the class constructor (\code{__init__()}). This method is
|
||||||
|
called at pickle time; the tuple it returns is incorporated in the
|
||||||
|
pickle for the instance.
|
||||||
\ttindex{__getinitargs__}
|
\ttindex{__getinitargs__}
|
||||||
\ttindex{__init__}
|
\ttindex{__init__}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue