On 2020-05-29 21:02, Serhiy Storchaka wrote:
The default repr of Python object is formatted using the following pattern:

      <{typename} object at {address:#x}>

And many custom reprs use similar patterns, but add some additional type
specific information. The type name first, followed by details and
address. All is surrounded by angle quotes. The question is in what
order to show address and other details? Should the address be at rear
or in the middle?

      <{typename} {details} at {address:#x}>
      <{typename} at {address:#x} {details}>

There are examples of both ways in the stdlib. I am going to add new
custom reprs [1] and need to know what pattern looks better.

Also, is "object" mandatory after the type name?

      <{typename} object {details} at {address:#x}>
      <{typename} object at {address:#x} {details}>

[1] https://bugs.python.org/issue24391

FWIW, my preference is for the address at the end for reasons already stated in the issue.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/JK2LVYUTO4VJHFERETLD2RJLNJJVARKB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to