Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'subject:Python': 0.05; 'abstraction': 0.07; 'python': 0.08; '21,': 0.09; 'argument': 0.15; 'answer,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instantiated': 0.16; 'interpreter;': 0.16; 'methods,': 0.16; 'push()': 0.16; '\xa0for': 0.16; "\xa0it's": 0.16; 'language': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'loading': 0.18; 'written': 0.19; 'pushed': 0.21; 'received:209.85.210.174': 0.21; 'received :mail-iy0-f174.google.com': 0.21; 'header:In-Reply-To:1': 0.22; '(or': 0.22; 'works.': 0.23; 'asked': 0.24; 'defined': 0.24; 'steve': 0.24; 'object,': 0.24; 'stack': 0.24; 'structure': 0.26; 'code': 0.26; 'code,': 0.28; 'message-id:@mail.gmail.com': 0.29; 'onto': 0.29; 'class': 0.29; 'pm,': 0.29; 'object': 0.33; 'calling': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; 'moving': 0.35; 'example,': 0.37; 'bound': 0.37; 'push': 0.37; 'but': 0.37; 'reference': 0.37; 'received:google.com': 0.37; 'either': 0.37; 'received:209.85': 0.38; 'could': 0.38; 'some': 0.38; 'think': 0.38; 'data': 0.38; 'primary': 0.38; 'itself.': 0.39; 'skip:\xa0 10': 0.39; 'option': 0.39; 'goes': 0.39; 'received:209': 0.39; 'being': 0.40; 'to:addr:python.org': 0.40; 'more': 0.61; 'subject': 0.61; 'matter': 0.62; 'friendly': 0.67; 'subject.': 0.68; 'care': 0.71; 'difference.': 0.84; 'howell': 0.84; 'perspective,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=fw0Kab96HKI14q1+UZNLR1kkcHLAYfIMyUpa6y7mr40=; b=WQNCrm8skWwzWtx7601AEQf6puXftoo+izmr4ttFuSwBCez3DSvqHy6MGhtHotA52Z oeWSqppITZ4A2HuTJyOef5yk6Av+Gx7L08Rh5162FUEnmhkkg9CBgV4i9V7dcMWJ/+xX uvWw/fta57yXS6svlj56VK8EiJ7KGijoxvcYUQyXX5i2J1JAkwP0iON1QyCUrQsWUxSi 8kYfnj5AsqrYy/6pkqjcrxSWF3VLtcPP+3d9Wq37cRojlt90eXqKFiXsMeHNDu+8Zki3 +F5RCZyjMdJUc99HMgu5x/+3TmZrm85pZ1n1brwW5Uh2Ix1J6WCio4egSkQaKNSgXCJU +0AA== MIME-Version: 1.0 In-Reply-To: <8a77bf8d-b12f-442b-a1a3-479b5d66d366@tx8g2000pbc.googlegroups.com> References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <8e72d74f-c844-4de3-8a37-f6b1fdc2291f@y27g2000yqy.googlegroups.com> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> <4f691f3d$0$29981$c3e8da3$5496439d@news.astraweb.com> <87d386lmai.fsf@benfinney.id.au> <8a77bf8d-b12f-442b-a1a3-479b5d66d366@tx8g2000pbc.googlegroups.com> Date: Wed, 21 Mar 2012 15:16:36 +1100 Subject: Re: Python is readable From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2001:888:2000:d::a6 X-Trace: 1332303399 news.xs4all.nl 6928 [2001:888:2000:d::a6]:60154 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21969 On Wed, Mar 21, 2012 at 1:44 PM, Steve Howell wrote: > I think it's a matter of perspective, so there's no right answer, but > I always think of the program object as also being the grammatical > object, with the implied subject/actor being Python itself. =A0For > example, consider this code: > > =A0stack.push(item) > > It's not the stack that's pushing. =A0It's the stack being pushed on > to. In code, though, the push() method is defined in and on the stack object (or more likely, on the class that instantiated it, but near enough). So the stack is being asked to push something onto itself. It is still viably the subject. Yes, the implied subject could be the language interpreter; but it could just as easily be the CPU, or those friendly nanobots, or that guy moving the rocks in XKCD 505. But in the abstraction of the line of code, you don't care how CPython goes about loading globals, calling bound methods, and incrementing object reference counts - you just care that the stack is pushing this item onto itself. Some method names are definitely written as though their primary argument is the object, not the subject. Either option works. Do you think about code as the subject+verb and a data structure as the object, or the object as the subject and the method as the verb? Fundamentally no difference. ChrisA