Why did Quora choose Python for its development?

Daniel Kluev dan.kluev at gmail.com
Mon May 23 05:58:51 EDT 2011


On Mon, May 23, 2011 at 7:49 PM, Octavian Rasnita <orasnita at gmail.com> wrote:
> That is not an array, but a list. An array has a name and we can't do
> something like the following simple statement in Python:
>
> l = (1, 2)
> d = dict(l)

> An array has a name
What?
In python there is no difference whether your object has any names
mapped to it or not. Its all the same, and object itself does not even
know.
Moreover, (1, 2) is tuple rather than 'array'. If you mean array as
implemented as array, then list is what you want. If you mean array
literally, there is special type 'array' somewhere in stdlib.

As for "can't do":

>>> a = [1,2]
>>> dict([a])
{1: 2}
>>> a = (1,2)
>>> dict([a])
{1: 2}


-- 
With best regards,
Daniel Kluev



More information about the Python-list mailing list