[issue20378] Implement `Signature.__repr__`

Ram Rachum report at bugs.python.org
Fri Jan 24 20:55:33 CET 2014


Ram Rachum added the comment:

My impression is that the `__repr__` method of any object is intended to describe that object, hopefully in a succinct way, possibly in a REPL-friendly way (like `list.__repr__`  for example) but if not then at least human-friendly. This is for easy introspection. When I come across a Signature object in the shell, I want to immediately get a good feel for what it contains without exploring `vars(sig)` manully.

If you have a `Signature` object, why not have its `__repr__` return something like '<Signature f: alpha, beta=3, *args, **kwargs>`? This would do an awesome job at helping me understand what kind of signature object I'm looking at.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20378>
_______________________________________


More information about the Python-bugs-list mailing list