Commit 5793039d authored by Guido van Rossum's avatar Guido van Rossum

Clarify that __getinitargs__ is called at pickle time!

parent 4f80b65a
......@@ -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
unpickling, a class can define a method \code{__getinitargs__()},
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{__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
unpickling, a class can define a method \code{__getinitargs__()},
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{__init__}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment