Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'attributes': 0.07; 'override': 0.07; 'prefix': 0.07; '*is*': 0.09; 'instance.': 0.09; 'precedence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'sep': 0.09; 'subject:method': 0.09; 'tends': 0.09; 'terry': 0.09; 'wrong,': 0.09; 'attributes,': 0.16; 'attributes.': 0.16; 'definition.': 0.16; 'guide.': 0.16; 'name"': 0.16; 'namespace.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'instance,': 0.17; 'replacing': 0.17; 'tend': 0.17; 'jan': 0.18; 'assignment': 0.22; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'replace': 0.27; 'header:X-Complaints-To:1': 0.28; 'chris': 0.28; 'implies': 0.29; 'class': 0.29; 'usually': 0.30; 'suggestion': 0.32; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'wrong': 0.34; 'subject:?': 0.35; 'something': 0.35; 'there': 0.35; 'received:org': 0.36; 'except': 0.36; 'but': 0.36; 'method': 0.36; 'does': 0.37; 'being': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'comment': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'share': 0.61; 'respect': 0.63; '26,': 0.65; 'talking': 0.66; 'special': 0.73; 'otten': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: data attributes override method attributes? Date: Tue, 25 Sep 2012 15:58:26 -0400 References: <931902e1-570b-4288-bb9b-de711318c5cd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348603140 news.xs4all.nl 6919 [2001:888:2000:d::a6]:60620 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30122 On 9/25/2012 11:03 AM, Chris Angelico wrote: > On Wed, Sep 26, 2012 at 12:54 AM, Peter Otten <__peter__@web.de> wrote: >> To me >> >> "Data attributes override method attributes with the same name" >> >> implies that data attributes take precedence over method attributes, not >> that they replace them only when there is an assignment of data after the >> method definition. >> >> I would even consider replacing the whole paragraph >> with something like >> >> "Data attributes and method attributes share the same namespace. To avoid >> name conflicts consider using verbs for methods and nouns for data >> attributes" > > Instance attributes override (shadow) class attributes. except for (some? all?) special methods > Since methods > tend to be on the class and data tends to be on the instance, the > original sentence does make some sense. but it *is* wrong The section is talking about > conventions, so it's not inherently wrong, The suggestion to Capitalize method names and prefix data names with '_' are wrong with respect to the style guide. but perhaps just needs a > comment about methods not usually being attached to the instance. > > ChrisA > -- Terry Jan Reedy