[issue21978] Support index access on OrderedDict views (e.g. o.keys()[7])

Raymond Hettinger report at bugs.python.org
Mon Jul 14 12:12:32 CEST 2014


Raymond Hettinger added the comment:

I'm not sure this would make sense given that the ordered dict itself isn't indexable, given that keys/values/items on regular dicts aren't indexable, and given that keys/items views are set-like rather than sequence-like.

The one obvious way to get sequence behavior is to build a list:

   s = list(od)
   s = list(od.values())
   s = list(od.items())

----------
assignee:  -> rhettinger
nosy: +rhettinger
priority: normal -> low
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21978>
_______________________________________


More information about the Python-bugs-list mailing list