Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ethan Furman Newsgroups: comp.lang.python Subject: Re: Method Chaining Date: Sat, 18 Jun 2016 13:47:43 -0700 Lines: 18 Message-ID: References: <74831a84-7b05-4242-b4c0-4a90d147717b@googlegroups.com> <33f73a24-4dcf-429b-9264-a3f3098f1cc3@googlegroups.com> <5763c2a7$0$1602$c3e8da3$5496439d@news.astraweb.com> <2dffea93-3dbd-4d04-93ed-6e02e3dd8660@googlegroups.com> <5765B36F.5010506@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de hC7SzX+3ZOtXOWRwRJJkKgNCPjI+vrOnc0Oq8Tth/kuQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'modifying': 0.07; 'ambiguity': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '2016': 0.16; 'innermost': 0.16; 'joonas': 0.16; 'liik': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'am,': 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'equivalent': 0.27; 'now?': 0.29; '~ethan~': 0.29; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'anything': 0.38; 'why': 0.39; 'does': 0.39; 'from:': 0.39; 'to:addr:python.org': 0.40; 'leading': 0.61; 'charset:windows-1252': 0.62 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5765B36F.5010506@stoneleaf.us> X-Mailman-Original-References: <74831a84-7b05-4242-b4c0-4a90d147717b@googlegroups.com> <33f73a24-4dcf-429b-9264-a3f3098f1cc3@googlegroups.com> <5763c2a7$0$1602$c3e8da3$5496439d@news.astraweb.com> <2dffea93-3dbd-4d04-93ed-6e02e3dd8660@googlegroups.com> Xref: csiph.com comp.lang.python:110113 On 06/18/2016 07:05 AM, Joonas Liik wrote: > On 18 June 2016 at 15:04, Pete Forman wrote: >> with obj: >> .a = 1 # equivalent to obj.a = 1 >> .total = .total + 1 # obj.total = obj.total + 1 > > the leading dot does not resolve the ambiguity that arises from: > > with ob_a: > with ob_b: > .attr_c = 42 # which object are we modifying right now? The innermost one. Why would it be anything else? -- ~Ethan~