mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
inspect: Add __slots__ to BoundArguments.
This commit is contained in:
parent
9113dc7c97
commit
6abe03288b
1 changed files with 9 additions and 0 deletions
|
@ -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:
|
||||||
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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue