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/2001-February/012643.html below:

for in dict (user expectation poll)

[Python-Dev] re: for in dict (user expectation poll) [Python-Dev] re: for in dict (user expectation poll)Guido van Rossum guido@digicool.com
Mon, 05 Feb 2001 15:22:27 -0500
[GVW]
> > (c) for x in someDict:
> > 
> > did.  They all said, "Iterates through the _values_ in the dict",
> > by analogy with (a).

[Ping]
> The PEP explicitly proposes that (c) be an error, because i
> anticipated and specifically wanted to avoid this ambiguity.
> Have you had a good look at it?
> 
> I think your survey shows that the PEP made the right choices.
> That is, it supports the position that if 'for key:value' is
> supported, then 'for key:' and 'for :value' should be supported,
> but 'for x in dict:' should not.  It also shows that 'for index:'
> should be supported on sequences, which the PEP suggests.

But then we should review the wisdom of using "if x in dict" as a
shortcut for "if dict.has_key(x)" again.  Everything is tied together!

--Guido van Rossum (home page: http://www.python.org/~guido/)



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