Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #109095 > unrolled thread
| Started by | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| First post | 2016-05-24 20:19 -0400 |
| Last post | 2016-05-24 20:19 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Spurious issue in CPython 2.7.5 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-05-24 20:19 -0400
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2016-05-24 20:19 -0400 |
| Subject | Re: Spurious issue in CPython 2.7.5 |
| Message-ID | <mailman.73.1464135591.20402.python-list@python.org> |
On Tue, 24 May 2016 12:22:30 +0200 (CEST), "thomas povtal.org"
<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/
Back to top | Article view | comp.lang.python
csiph-web