Larry Hastings added the comment:

The world of reprs already isn't particularly consistent.  If you make your 
reprs consistent with module X, it'll be *inconsistent* with module Y, and vice 
versa.  I say let's just worry about making it nice and readable for humans.

That said, I like the asyncio reprs.  Specifically, I like how the interesting 
things (class, interesting values) are at the front and rear, and the address 
is in the middle.  While it's occasionally helpful (or even crucial!) to show 
the address, I *almost* never need to look at it.  Arranging the data in this 
way makes it easy to skip over the address when reading.

However, I don't think the parentheses or square brackets are necessary.  It's 
not like this is a computer-readable syntax, and for human beings it's just 
visual clutter.  I suggest it's sufficient to have comma separated values with 
a space after each comma.  Also: I definitely don't like the colon after the 
class name.

So here's how *I* might reformat all your examples:

<threading.Semaphore at 0xb710ec8c 10>
<threading.BoundedSemaphore at 0xb6ff1d6c 7/10>
<threading.Event at 0xb710ec8c unset>
<threading.Event at 0xb710ec8c set>
<threading.Barrier at 0xb6ff1d6c 0/10>
<threading.Barrier at 0xb6ff1d6c 3/10>
<threading.Barrier at 0xb6ff1d6c 0/10, broken>

p.s. Thank you for posting these samples of other approaches!  It definitely 
shed some light into the discussion.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to