Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Django': 0.03; 'processing.': 0.03; '(although': 0.05; 'subject:Python': 0.06; 'python': 0.08; 'received:209.85.160.174': 0.09; 'received:mail- gy0-f174.google.com': 0.09; 'examples': 0.11; 'argument': 0.15; 'syntax': 0.15; 'agree.': 0.16; 'arrays.': 0.16; 'expression,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imo,': 0.16; 'literals': 0.16; 'subject:Supporting': 0.16; 'x).': 0.16; 'wrote:': 0.18; 'ryan': 0.18; "doesn't": 0.23; 'structure': 0.23; 'literal': 0.23; 'header:In-Reply-To:1': 0.23; 'variable': 0.24; "python's": 0.24; 'creating': 0.25; 'function': 0.27; 'lists': 0.28; 'expressions': 0.28; 'weird': 0.28; 'message- id:@mail.gmail.com': 0.29; 'array': 0.30; 'nov': 0.31; 'pm,': 0.31; 'tue,': 0.32; "can't": 0.32; 'list': 0.32; 'to:addr:python- list': 0.32; 'character': 0.34; 'lie': 0.34; 'nested': 0.34; 'received:209.85.160': 0.35; 'rather': 0.35; 'skip:" 10': 0.36; 'but': 0.37; 'think': 0.37; 'two': 0.37; 'received:google.com': 0.38; 'easier': 0.38; 'received:209.85': 0.38; 'e.g.': 0.38; 'processing': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'data': 0.40; 'received:209': 0.40; 'more': 0.60; '2011': 0.62; 'skip:$ 10': 0.63; 'superior': 0.73; 'qualities': 0.84; 'slim': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cgGeP4wsLw77DqZe/8tYO1Rrq//ND/aheVZyi1hZNHk=; b=wXRU3STJ74f8Zxip/UjCS4DlGxfT84bLPw2peNfQSltuaWl3pPkKwvK3XmOGYqG0gX oiFjrjRK/xU739cH57mIs0ny5RQ9Xk9JG1GMJydNPP3SWYuAXNmHOJozVl/JRJTmtSey LzGFAGzmFEy8ux7CFxt3cPf8bi861WdxqcLxE= MIME-Version: 1.0 In-Reply-To: References: <1f9f9361-8278-4ae6-8d4d-5fd09b0fd800@hc5g2000vbb.googlegroups.com> <415d875d-bc6d-4e69-bcf8-39754b45030a@n18g2000vbv.googlegroups.com> Date: Tue, 8 Nov 2011 18:35:32 +1100 Subject: Re: Python ORMs Supporting POPOs and Substituting Layers in Django From: Chris Angelico 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320737736 news.xs4all.nl 6884 [2001:888:2000:d::a6]:40649 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15461 On Tue, Nov 8, 2011 at 4:09 PM, Lie Ryan wrote: > IMO, Python has a much nicer choice of built-in data structure for data > processing. Python has a much more mature object-orientation, e.g. I prefer > writing l.append(x) rather than array_push(l, x). I think these qualities > are what makes you think Python is much, much more suitable for data > processing than PHP; and I wholesomely agree. > Two more examples where Python's lists are superior to PHP's arrays. Array literal syntax feels like a function call, but list literals are slim and easy to use inside expressions (try creating a nested array as a function argument - you'll get a forest of parens). Also, dereferencing an array only works on an array variable - if you have a function that returns an array, you can't dereference it directly: $foo = func()[1]; # doesn't work $foo = func(); $foo=$foo[1]; # works I much prefer the "everything's an object" notion. C's array literals are just as weird (although in C, you can directly dereference a literal character array - "ABCDEFG"[note_idx] will give you a note name as a char)... much easier when a variable name is just an expression, a function call is an expression, a literal is an expression, and you can work with them all the same way. ChrisA