Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python:': 0.05; 'subject:Python': 0.06; 'python': 0.08; 'mapped': 0.09; 'tuple': 0.09; 'pm,': 0.10; '>>>': 0.12; 'received:209.85.214.174': 0.14; 'received:mail-iw0-f174.google.com': 0.14; 'wrote:': 0.14; '"can\'t': 0.16; '(1,': 0.16; 'stdlib.': 0.16; 'what?': 0.16; 'mon,': 0.17; 'somewhere': 0.17; 'header:In-Reply-To:1': 0.21; 'moreover,': 0.23; 'statement': 0.26; 'not.': 0.26; 'object': 0.26; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.214': 0.28; 'subject:?': 0.29; 'array': 0.30; "can't": 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'list': 0.33; 'list.': 0.33; 'rather': 0.34; 'daniel': 0.34; 'there': 0.35; 'difference': 0.37; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'implemented': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'best': 0.60; 'your': 0.60; 'special': 0.66; '[1,2]': 0.84; 'subject:Why': 0.84; 'subject:choose': 0.84; 'subject:its': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=TGL159lZjEpyzTEQXUJv3nOgdJg6a65Lx2CzQuygyW4=; b=ARkVaWgebPtFKQCQu8alLE5dzn79zrOczszsqGMdyfs++XpWxq1dLTWR/y+XYzy4So E/8rme7ulO6auU/qHlCXqZQ6M+gB7Pg6T31UyyxqfiIBziiw9dNrcmDUV7XD3lkDPcLn YNL68yNubPVVsykxPInwtv98wJvmFBHJRZPQ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qEpbsgHI6grU9du3KqqEfLx1RWx2pge6ChGGlDGXd6dBIcekBZ+sD0wiASQBKCWLnr j0mxk+ozxobLT/5pQc3+U/81KwwQ0lb5V7WHIlJ4wQhIFlv3vYk7SacSoAC8ZG7vush/ 2ps3uXAIWHsplVvN2lOGxaRckX8eQAW3aDHec= MIME-Version: 1.0 In-Reply-To: <629DAC3611EA49B0A36BCF70151CDE2F@octavian> References: <80d59383-36a3-4744-85c4-1a0577f1d3a6@dr5g2000vbb.googlegroups.com> <9CDC4B2CD1F445E994119A50F65155DF@teddy> <12225671E9654FECB49613D915FAEC19@teddy> <21A740B7AC6644248476DFADDF726C73@octavian> <629DAC3611EA49B0A36BCF70151CDE2F@octavian> Date: Mon, 23 May 2011 20:58:51 +1100 Subject: Re: Why did Quora choose Python for its development? From: Daniel Kluev To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306144733 news.xs4all.nl 49179 [::ffff:82.94.164.166]:51865 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6056 On Mon, May 23, 2011 at 7:49 PM, Octavian Rasnita 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