[New-bugs-announce] [issue2074] pprint._safe_repr() unsafe on ordering differently types objects with same str represenation

Simon Percivall report at bugs.python.org
Tue Feb 12 03:47:19 CET 2008


New submission from Simon Percivall:

_safe_repr() tries to handle the case where two objects are unorderable by 
ordering on (str(type(key)), key, value), but this fails when 
str(type(key)) is equal for two objects, but key is different and 
unorderable. Easy fix: order just on the string representation.

----------
components: Library (Lib)
files: pprint.diff
messages: 62303
nosy: percivall
severity: normal
status: open
title: pprint._safe_repr() unsafe on ordering differently types objects with same str represenation
versions: Python 3.0
Added file: http://bugs.python.org/file9413/pprint.diff

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


More information about the New-bugs-announce mailing list