[Python-Dev] Re: Repr: where to place the address and additional info?

2020-06-01 Thread Brett Cannon
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 >

[Python-Dev] Re: Repr: where to place the address and additional info?

2020-05-30 Thread Steven D'Aprano
On Fri, May 29, 2020 at 11:02:56PM +0300, 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

[Python-Dev] Re: Repr: where to place the address and additional info?

2020-05-29 Thread Ivan Pozdeev via Python-Dev
If you are going to give details, you'd better use the "equivalent expression" kind of repr. As I explained earlier in the "Enum._convert should change __repr__", the angle brackets repr doesn't actually give any information that the user can rely upon except the type and the address. On

[Python-Dev] Re: Repr: where to place the address and additional info?

2020-05-29 Thread MRAB
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