diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-13 21:18:41 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-13 21:18:41 (GMT) |
commit | 6abe03288bb1c8bf36c10a2afd237b3c72cbcd68 (patch) | |
tree | c0e6eab63eba49f8769ddec18fb95d938472d37c /Lib/inspect.py | |
parent | 9113dc7c97c649e2490c65157be1fb9b3fe7751b (diff) | |
download | cpython-6abe03288bb1c8bf36c10a2afd237b3c72cbcd68.zip cpython-6abe03288bb1c8bf36c10a2afd237b3c72cbcd68.tar.gz cpython-6abe03288bb1c8bf36c10a2afd237b3c72cbcd68.tar.bz2 |
inspect: Add __slots__ to BoundArguments.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index e52d86e..9f4d005 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2377,6 +2377,8 @@ class BoundArguments: Dict of keyword arguments values. """ + __slots__ = ('arguments', '_signature', '__weakref__') + def __init__(self, signature, arguments): self.arguments = arguments self._signature = signature @@ -2443,6 +2445,13 @@ class BoundArguments: self.signature == other.signature and self.arguments == other.arguments) + def __setstate__(self, state): + self._signature = state['_signature'] + self.arguments = state['arguments'] + + def __getstate__(self): + return {'_signature': self._signature, 'arguments': self.arguments} + class Signature: """A Signature object represents the overall signature of a function. |