Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.05; 'widely': 0.05; 'subject:Python': 0.06; 'see.': 0.07; 'subject:into': 0.09; 'developer': 0.10; 'python': 0.11; "wouldn't": 0.14; 'begging': 0.16; 'define:': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'side.': 0.16; 'so;': 0.16; 'subject:variable': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'module': 0.19; 'trying': 0.19; 'seems': 0.21; '(in': 0.22; 'header:User- Agent:1': 0.23; 'certainly': 0.24; 'class.': 0.26; 'header:In- Reply-To:1': 0.27; 'michael': 0.29; 'getting': 0.31; 'equality': 0.31; 'class': 0.32; 'probably': 0.32; 'used,': 0.33; 'could': 0.34; "can't": 0.35; 'test': 0.35; 'but': 0.35; 'done': 0.36; 'subject:?': 0.36; 'skip:o 20': 0.38; 'message-id:@gmail.com': 0.38; 'checks': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'subject:Can': 0.60; 'free': 0.61; 'break': 0.61; 'new': 0.61; 'became': 0.64; 'different': 0.65; 'idiom': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Sun, 02 Mar 2014 14:44:08 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Can global variable be passed into Python function? References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <871tynznpd.fsf@elektro.pacujo.net> <53104798$0$11113$c3e8da3@news.astraweb.com> <87ha7jy2qs.fsf@elektro.pacujo.net> <87k3ceeq0m.fsf@elektro.pacujo.net> <87zjlad8q4.fsf@elektro.pacujo.net> <874n3irz04.fsf@elektro.pacujo.net> <87k3ceqhti.fsf@elektro.pacujo.net> <87mwh9969m.fsf@elektro.pacujo.net> <5312ed4b$0$29985$c3e8da3$5496439d@news.astraweb.com> <87ha7h9c40.fsf@elektro.pacujo.net> <87txbg48kd.fsf@elektro.pacujo.net> In-Reply-To: <87txbg48kd.fsf@elektro.pacujo.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393796658 news.xs4all.nl 2959 [2001:888:2000:d::a6]:57544 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67471 On 03/02/2014 02:03 PM, Marko Rauhamaa wrote: > Michael Torrie : > >> I don't see why == wouldn't continue to work if os.POSIX_FADV_RANDOM >> became an object of a different type. > > It probably would. > > If one were begging for trouble, one *could* define: > > class ABC: > A = 1 > B = 1.0 > C = 1+0j And one could also set A=1 and B=1 if he was trying to be stupid. That would fail the equality test and the identity test (in CPython). Seems like this argument is getting a bit on the absurd side. The normal idiom is to use equality checks to test state variables' *values*. I don't know of any developer that would purposely try to break that when defining a new module or class. If Mark H wants to use an idiom that isn't conventional, or isn't widely used, he is free to do so; I can't see much harm in it. But certainly it's not the "normal" way that it's done in Python from what I can see.