diff --git a/pep-3154.txt b/pep-3154.txt index 6165fc258..e4dd9218e 100644 --- a/pep-3154.txt +++ b/pep-3154.txt @@ -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 ----------------------