[Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort() (original) (raw)
Fred L. Drake, Jr. fdrake at acm.org
Mon Aug 28 16:45:23 CEST 2006
- Previous message: [Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort()
- Next message: [Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Monday 28 August 2006 10:21, Edward C. Jones wrote:
d = dict() ... thekeys = d.keys() thekeys.sort() for key in thekeys: ...
What should I use in Python 3.0?
d = dict() ... for key in sorted(d.keys()): ...
-Fred
-- Fred L. Drake, Jr.
- Previous message: [Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort()
- Next message: [Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]