Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 03cda5360dc6 by Florent Xicluna in branch '3.2':
Issues #10017 and #14998: Fix TypeError using pprint on dictionaries with
unorderable key.
http://hg.python.org/cpython/rev/03cda5360dc6
New changeset 4d0dcfbdf45b
Florent Xicluna florent.xicl...@gmail.com added the comment:
Thanks for this patch.
I've reviewed the issue and merged the patch of issue #14998 which fixes both
cases.
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
superseder: - pprint._safe_key
Florent Xicluna florent.xicl...@gmail.com added the comment:
Confirmed on python 3.2 and 3.3.
--
keywords: +easy
nosy: +flox
stage: - needs patch
type: - behavior
versions: +Python 3.2, Python 3.3 -Python 3.1
___
Python tracker
Changes by Anton Barkovsky swarmer...@gmail.com:
--
nosy: +anton.barkovsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10017
___
___
Anton Barkovsky swarmer...@gmail.com added the comment:
Here's a patch with fix and tests.
Note that class objects are not comparable and have the same type so they
fall back on sorting by id. Should we sort them by name as a special case
instead?
--
keywords: +patch
Added file:
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10017
___
___
Rodrigo Bernardo Pimentel r...@isnomore.net added the comment:
FWIW, the problem still occurs on the most recent release31-maint checkout (as
of r85323), and does not happen on py3k (3.2a2).
--
nosy: +rbp
___
Python tracker rep...@bugs.python.org
Rodrigo Bernardo Pimentel r...@isnomore.net added the comment:
If I'm understanding this correctly, this fails on 3.1 and not (although,
actually, it does) on py3k/3.2 because:
* pprint._safe_key.__lt__ checks rv = self.obj.__lt__(other.obj) and falls
back to id comparison if rv is
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
A simpler change would to replace:
rv = self.obj.__lt__(other.obj)
with
rv = type(self.obj).__lt__(self.obj, other.obj)
--
nosy: +amaury.forgeotdarc
___
Python tracker
New submission from Arnaud Delobelle arno...@googlemail.com:
The pprint function in the python 3.1 pprint module fails when
printing a dictionary containing more than one item and with one item
being a user-defined type. It seems pprint tries to sort the keys but
fails, (maybe because calling
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10017
___
___
11 matches
Mail list logo