In article , a...@pythoncraft.com (Aahz)
wrote:
> In article ,
> Ned Deily wrote:
> >The second example is a call to the built-in function "list", [...]
> Actually, list() is not a function:
> >>> list
>
> Rather, ``list`` is an object (specifically a ``type`` object) with a
> __call__() meth
In article ,
Ned Deily wrote:
>In article
>,
> Sam Tregar wrote:
>>
>> Can anyone explain why this creates a list containing a
>> dictionary:
>> [{'a': 'b', 'foo': 'bar'}]
>> But this creates a list of keys of the dictionary:
>> list({ "a": "b", "foo": "bar" })
>
>The first example is a li
In article
,
Sam Tregar wrote:
> Can anyone explain why this creates a list containing a
> dictionary:
> [{'a': 'b', 'foo': 'bar'}]
> But this creates a list of keys of the dictionary:
> list({ "a": "b", "foo": "bar" })
The first example is a list, expressed as a list display literal,
con
En Fri, 15 May 2009 22:17:43 -0300, Sam Tregar escribió:
Hello all. Can anyone explain why this creates a list containing a
dictionary:
[{'a': 'b', 'foo': 'bar'}]
But this creates a list of keys of the dictionary:
list({ "a": "b", "foo": "bar" })
I expected them to be equivalent but cl
Hello all. Can anyone explain why this creates a list containing a
dictionary:
[{'a': 'b', 'foo': 'bar'}]
But this creates a list of keys of the dictionary:
list({ "a": "b", "foo": "bar" })
I expected them to be equivalent but clearly they're not! I'm using Python
2.6.1 if that helps.
-s