This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | eric.snow |
|---|---|
| Recipients | ThiefMaster, eric.snow, rhettinger, serhiy.storchaka, stutzbach |
| Date | 2013年11月05日.23:41:08 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1383694868.37.0.785878748738.issue19505@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
The view objects aren't sequences. od.items() and od.keys() implement Set. od.values() doesn't even do that much, only implementing __len__(), __iter__(), and __contains__(). The glossary implies that you should use "reversed(list(view))". [1] More information on mapping views is located in the docs for collections.ABC and for dict. [2][3] The source for the Mapping views is also helpful. [4] Keep in mind that OrderedDict is not a sequence-like dict. It is essentially just a dict with a well-defined iteration order (by insertion order). [5] Just like its views, it should not used as a sequence. [1] http://docs.python.org/3/glossary.html#term-view [2] http://docs.python.org/3/library/stdtypes.html#dict-views [3] http://docs.python.org/3/library/collections.abc.html#collections.abc.MappingView [4] http://hg.python.org/cpython/file/3.3/Lib/collections/abc.py#l435 [5] http://docs.python.org/3.3/library/collections.html#collections.OrderedDict |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2013年11月05日 23:41:08 | eric.snow | set | recipients: + eric.snow, rhettinger, stutzbach, serhiy.storchaka, ThiefMaster |
| 2013年11月05日 23:41:08 | eric.snow | set | messageid: <1383694868.37.0.785878748738.issue19505@psf.upfronthosting.co.za> |
| 2013年11月05日 23:41:08 | eric.snow | link | issue19505 messages |
| 2013年11月05日 23:41:08 | eric.snow | create | |