Re: Why did Quora choose Python for its development?



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 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
.



Relevant Pages

  • (patch for Bash) regex(3) splitting/matching
    ... I usually do this in Python. ... 'help array' will give you more info on other options for 'array' ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: Why C Is Not My Favourite Programming Language
    ... And the number of modules in Python 2.4's Global Module Index is 362. ... The PDP architecture ideals ... fflushcan't be used to flush the contents of standard ... But it's not foolish that in ksh if you refer to an array name ...
    (comp.lang.c)
  • Re: Allowing zero-dimensional subscripts
    ... The items of a tuple are arbitrary Python objects. ... items are formed by comma-separated lists of expressions. ... the grammar rule used for list subscript is different from the ... an array with n-dimensions of length 3 would have ...
    (comp.lang.python)
  • Re: Brain going crazy with recursive functions
    ... I want eventually to port this to scheme, but I know python ... I'm in linear_search for the array, I also call linear_search for each ... return linear_search_iter(0, truth_func, array, acc) ...
    (comp.lang.python)
  • RE: Assignment to slice
    ... minutes of python experience. ... > the array, i.e. insist on: ... Python doesn't like that I'm assigning ... > to a slice, over non-existent array indexes, sets ...
    (comp.lang.python)