Opened 18 years ago
Closed 18 years ago
#3964 closed (fixed)
SortedDict string representation not in order of keys
Description ¶
This is more-or-less a problem with Python's dict implementation, IMO. It's
really nothing more than a convenience thing, but for SortedDict, repr(d)
doesn't indicate the proper key order. It seems that the standard dict.repr
does not iterate over the dict like I would expect it to.
Attached is a patch that re-implements repr using an iterator over the
object. Thus, SortedDict's are displayed properly in the Python shell.
Change History (4)
by , 18 years ago
Attachment: | SortedDict__repr__.diff added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 18 years ago
Needs tests: | set |
---|
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [5069]) Fixed #3964 -- Added a custom SortedDict.repr so that the keys are printed
in sorted order. Based on a patch from Forest Bond.
patch implementing SortedDict.repr