[issue2610] string representation of range and dictionary views

Amaury Forgeot d'Arc report at bugs.python.org
Thu Apr 17 23:26:49 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Some review of dv_range.patch:

- repr(d.keys()) depends on the internal ordering of items, their hash
values, the insertion order... the test seems fragile.
Or you may rely on the fact that ints are their own hash values, so a
small dict containing small keys will appear ordered. I suggest
something like {6: 1.2, 1: 'A', 7: 42, 4: None}

- empty dicts or empty ranges will display:
   <range: >
   <dict_items: >
Isn't there a better repr? At least this should appear in the tests.

----------
nosy: +amaury.forgeotdarc

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2610>
__________________________________


More information about the Python-bugs-list mailing list