Message160955
| Author |
nadeem.vawda |
| Recipients |
docs@python, eric.araujo, nadeem.vawda, rhettinger, terry.reedy |
| Date |
2012年05月17日.08:43:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1337244235.19.0.526927653271.issue14836@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> "popitem()
> Remove and return an arbitrary (key, value) pair from the dictionary. Raises KeyError if the dict is empty. Use next(iter(d)) to return an arbitrary pair without removing it."
Actually, next(iter(d)) on a dict returns an arbitrary *key*; if you want
a pair, you need next(iter(d.items())). |
|