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/2004-January/041690.html below:

[Python-Dev] Toowtdi: Datatype conversions

[Python-Dev] Toowtdi: Datatype conversions [Python-Dev] Toowtdi: Datatype conversionsMichael Hudson mwh at python.net
Mon Jan 5 07:56:28 EST 2004
"Robert Brewer" <fumanchu at amor.org> writes:

> Raymond Hettinger wrote:
>> Choosing between:
>> 
>>     list(d)  or   d.keys()
>> 
>> Which is the one obvious way of turning a dictionary into a list?  
>> IMO, list(d) is it.
>
> Except that, "turning a dictionary into a list" as an English phrase is
> indeterminate--do you want the keys or the values or both?

Indeed.  In particular, I often write

for k in d:
    ...

and 

for k,v in d:
    ...

and seem to subconsciously expect Python to work out the rest :-)
(this is not a feature request...)

Cheers,
mwh

-- 
  Unfortunately, nigh the whole world is now duped into thinking that 
  silly fill-in forms on web pages is the way to do user interfaces.  
                                        -- Erik Naggum, comp.lang.lisp

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