A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-April/134196.html below:

[Python-Dev] PEP 469: Restoring the iterkeys/values/items() methods

[Python-Dev] PEP 469: Restoring the iterkeys/values/items() methods [Python-Dev] PEP 469: Restoring the iterkeys/values/items() methodsStephen J. Turnbull turnbull at sk.tsukuba.ac.jp
Sat Apr 19 19:31:34 CEST 2014
Benjamin Peterson writes:

 > > I suppose there's no way to get the compiler to both make "for x in d"
 > > work as above, and make "for k, v in d" be equivalent to Python 2's
 > > "for k, v in d.iteritems()"?

 > That doesn't make sense. What if your keys are tuples?

Oh, I still think it makes sense.  Both x and k would be bound to the
key tuples.  For example it would "work" consistently with Common Lisp
multiple values.  And it's not clear to me that unpacking key tuples
would be used anywhere near as often as item unpacking.

But Python doesn't have other objects that behave like Common Lisp
multiple values, and it would change the meaning of currently correct
programs, so it's a non-starter.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4