(?it=expr)
is a new atomic expression for an "it reference binding"- subsequent subexpressions (in execution order) can reference the bound subexpression using
?it
(an "it reference") ?it
is reset between statements, including before entering the suite within a compound statement (if you want a persistent binding, use a named variable)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class C: | |
... def example(self): pass | |
... | |
>>> import pickle | |
>>> data = pickle.dumps(C.example) | |
>>> pickle.loads(C.example) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: a bytes-like object is required, not 'function' | |
>>> pickle.loads(data) |
OlderNewer