[Python-3000] Warning about future-unsafe usage patterns in Python 2.x e.g. dict.keys().sort() (original) (raw)
Edward C. Jones edcjones at comcast.net
Mon Aug 28 16:21:10 CEST 2006
- Previous message: [Python-3000] Set literals
- 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 ]
Brian Quinlan said:
It is my understanding that, in Python 3000, certain functions and methods that currently return lists will return some sort of view type (e.g. dict.values()) or an iterator (e.g. zip). So certain usage patterns will no longer be supported e.g. d.keys().sort().
I use this idiom fairly often:
d = dict() ... thekeys = d.keys() thekeys.sort() for key in thekeys: ...
What should I use in Python 3.0?
- Previous message: [Python-3000] Set literals
- 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 ]