Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'python:': 0.05; 'subject:Python': 0.06; 'python': 0.08; '>>>': 0.12; 'am,': 0.14; 'wrote:': 0.14; '"terry': 0.16; '(1,': 0.16; 'reedy"': 0.16; 'way"': 0.16; 'language': 0.18; 'discussion': 0.19; 'perl': 0.19; 'received:209.85.161.46': 0.23; 'received:mail- fx0-f46.google.com': 0.23; 'creating': 0.24; 'statement': 0.26; 'received:209.85.161': 0.26; 'example': 0.27; 'subject:?': 0.29; 'fact': 0.30; 'array': 0.30; 'x-mailer:microsoft outlook express 6.00.2900.5931': 0.30; "can't": 0.32; 'to:addr:python-list': 0.33; 'list.': 0.33; 'there': 0.35; 'from:': 0.36; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'ways': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'really': 0.40; 'more': 0.60; 'show': 0.66; 'received:188': 0.69; '"there': 0.84; '2);': 0.84; 'it"': 0.84; 'subject:Why': 0.84; 'subject:choose': 0.84; 'subject:its': 0.84; 'few.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:references:subject:date :mime-version:content-type:content-transfer-encoding:x-priority :x-msmail-priority:x-mailer:x-mimeole; bh=WhBTY0YRc1aVgjatCQ4eztGWoIcHHlRPHMZBdVgR/iQ=; b=Bnx2UCympBwsdMfq/qTZzXOmaE/HlGrqLa+0B1jL+AKtocVSJSMchhXpcwZdQC9bGM x9RxpTZmyBFmsmTwRqRlKRu0v8Dhdi1QgyBulP3OoI8Fc1OyPrFYhn6FyVkFIu8VjU6Z qyweMc19oXRkjTwU6qo9VdLODZUlE2W+/VvF4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :x-mailer:x-mimeole; b=n1dkrgtFey9eV/RsSFey02y2bcxfZEdoErZ8c63VyhzQqWUYdk8Ndj5jBMpPN1ioDJ TDO6z//IQO5Y8A78SckF1SI72w/jr9jZqLkMhl6Ll99CnOVtsJ/vSRip69Y8+vkdBnFG kHLAc3U8uIuAcY2nSYagee7BCIWEZJxpqXbqI= From: "Octavian Rasnita" To: References: <80d59383-36a3-4744-85c4-1a0577f1d3a6@dr5g2000vbb.googlegroups.com><9CDC4B2CD1F445E994119A50F65155DF@teddy><12225671E9654FECB49613D915FAEC19@teddy> <21A740B7AC6644248476DFADDF726C73@octavian> Subject: Re: Why did Quora choose Python for its development? Date: Mon, 23 May 2011 11:49:40 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 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: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306144163 news.xs4all.nl 49181 [::ffff:82.94.164.166]:53129 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6053 From: "Terry Reedy" > On 5/23/2011 1:31 AM, Octavian Rasnita wrote: > > >> I am talking about a simple way of creating a hash/dict from an array, >> which is so simple that there should be really a single way to do it, or >> very few. > > Again, Python has such: > > >>> dict([['one',1],['two', 2]]) > {'two': 2, 'one': 1} 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) While in Perl we can do: @l = (1, 2); %d = @l; But let's remember from what this discussion started. This is not a Python critique, because each language has its own ways. I just wanted to show that the fact that "there is more than one way to do it" in Perl and that "there is a single way" in Python are just buzzwords, because this was an example where in Python there are many ways to do it while in Perl there is a single way used usually, which is also more simple. Octavian