Commit b1ae6efe authored by Yury Selivanov's avatar Yury Selivanov

inspect: Add __slots__ to BoundArguments.

parent efd4682b
...@@ -2377,6 +2377,8 @@ class BoundArguments: ...@@ -2377,6 +2377,8 @@ class BoundArguments:
Dict of keyword arguments values. Dict of keyword arguments values.
""" """
__slots__ = ('arguments', '_signature', '__weakref__')
def __init__(self, signature, arguments): def __init__(self, signature, arguments):
self.arguments = arguments self.arguments = arguments
self._signature = signature self._signature = signature
...@@ -2443,6 +2445,13 @@ class BoundArguments: ...@@ -2443,6 +2445,13 @@ class BoundArguments:
self.signature == other.signature and self.signature == other.signature and
self.arguments == other.arguments) 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: class Signature:
"""A Signature object represents the overall signature of a function. """A Signature object represents the overall signature of a function.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment