mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue 22547: Implement informative __repr__ for inspect.BoundArguments
This commit is contained in:
parent
6b4046f062
commit
3f6538fed0
3 changed files with 17 additions and 0 deletions
|
@ -2460,6 +2460,13 @@ class BoundArguments:
|
|||
def __getstate__(self):
|
||||
return {'_signature': self._signature, 'arguments': self.arguments}
|
||||
|
||||
def __repr__(self):
|
||||
args = []
|
||||
for arg, value in self.arguments.items():
|
||||
args.append('{}={!r}'.format(arg, value))
|
||||
return '<{} at {:#x} ({})>'.format(self.__class__.__name__,
|
||||
id(self), ', '.join(args))
|
||||
|
||||
|
||||
class Signature:
|
||||
"""A Signature object represents the overall signature of a function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue