Re: Why did Quora choose Python for its development?
- From: Daniel Kluev <dan.kluev@xxxxxxxxx>
- Date: Mon, 23 May 2011 20:58:51 +1100
On Mon, May 23, 2011 at 7:49 PM, Octavian Rasnita <orasnita@xxxxxxxxx> 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 nameWhat?
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":
{1: 2}a = [1,2]
dict([a])
{1: 2}a = (1,2)
dict([a])
--
With best regards,
Daniel Kluev
.
- References:
- Why did Quora choose Python for its development?
- From: Beliavsky
- Why did Quora choose Python for its development?
- Prev by Date: Re: Multiprocessing: don't push the pedal to the metal?
- Next by Date: Re: Why did Quora choose Python for its development?
- Previous by thread: Re: Why did Quora choose Python for its development?
- Next by thread: Re: Why did Quora choose Python for its development?
- Index(es):
Relevant Pages
|