Remove question marks and explain __getnewargs_ex__
This commit is contained in:
parent
e389853776
commit
7c5a782f7c
|
@ -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
|
||||
----------------------
|
||||
|
|
Loading…
Reference in New Issue