Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Spurious issue in CPython 2.7.5 Date: Tue, 24 May 2016 20:19:47 -0400 Organization: IISS Elusive Unicorn Lines: 33 Message-ID: References: <779717266.18172.1464085350716.JavaMail.open-xchange@ox.netsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de YPQ9b36M88ybuA6gQe90twid2cg5qMf5RViZXuyQywrg== 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; '(python': 0.05; 'cpython': 0.05; '[],': 0.07; 'false,': 0.07; '"if': 0.09; 'message- id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '{},': 0.09; '2016': 0.16; 'assignments': 0.16; 'false:': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:issue': 0.16; 'there...': 0.16; 'url:home': 0.18; 'variable': 0.18; '+0200': 0.20; 'constant': 0.22; 'header:X -Complaints-To:1': 0.26; 'comparison': 0.29; 'problem': 0.33; 'foo': 0.33; 'machine.': 0.33; 'tue,': 0.34; 'false': 0.35; 'identity': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'hi,': 0.38; "didn't": 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; '(global': 0.84; 'seldom': 0.84; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-116-84.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: X-Mailman-Original-References: <779717266.18172.1464085350716.JavaMail.open-xchange@ox.netsite.dk> Xref: csiph.com comp.lang.python:109095 On Tue, 24 May 2016 12:22:30 +0200 (CEST), "thomas povtal.org" declaimed the following: > Hi, > > Please excuse me if this is not the right place, but I have some issues > with CPython on a NUMA machine. > > 1: I get "RuntimeWarning: tp_compare didn't return -1 or -2 for > exception". It's a line like: > > "if Foo = False:" where Foo is a global variable (global Foo). > Well, the first problem is that you can not do assignments there... Comparison would be if Foo == False: OR if not Foo: (Python considers: 0, False, [], {}, "" all to be "false" so a comparison to the constant False is seldom needed... And when it is, it may be better to use identity check if Foo is False: ) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/