[Python-Dev] PEP 362 Second Revision
R. David Murray
rdmurray at bitdance.com
Fri Jun 8 02:40:00 CEST 2012
On Thu, 07 Jun 2012 17:39:54 -0400, Terry Reedy <tjreedy at udel.edu> wrote:
> On 6/7/2012 4:54 PM, Yury Selivanov wrote:
>
> > I think we'll add a 'format' method to the Signature, that will work
> > like 'inspect.formatargspec'. 'Signature.__str__' will use it with
> > default parameters/formatters.
>
> Great. If I don't like the default, I could customize.
>
> > I'm not sure how __repr__ should look like. Maybe default repr
> > (object.__repr__) is good enough.
>
> __repr__ = __str__ is common.
I think you meant __str__ = __repr__. __repr__ is the more fundamental
of the two, and if there is no __str__, it defaults to __repr__.
IMO the __repr__ should make it clear that it is a signature object
somehow.
--David
More information about the Python-Dev
mailing list