Remove question marks and explain __getnewargs_ex__

This commit is contained in:
Antoine Pitrou 2013-11-21 02:06:06 +01:00
parent e389853776
commit 7c5a782f7c
1 changed files with 6 additions and 3 deletions

View File

@ -134,10 +134,13 @@ pickling self-referential sets [2]_.
Calling __new__ with keyword arguments
--------------------------------------
Currently, classes whose __new__ mandates the use of keyword-only
Currently, classes whose ``__new__`` mandates the use of keyword-only
arguments can not be pickled (or, rather, unpickled) [3]_. Both a new
special method (``__getnewargs_ex__`` ?) and a new opcode (NEWOBJ_EX ?)
are needed.
special method (``__getnewargs_ex__``) and a new opcode (NEWOBJ_EX)
are needed. The ``__getnewargs_ex__`` method, if it exists, must
return a two-tuple ``(args, kwargs)`` where the first item is the
tuple of positional arguments and the second item is the dict of
keyword arguments for the class's ``__new__`` method.
Better string encoding
----------------------