On 2006-10-09, Aahz [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Antoon Pardon [EMAIL PROTECTED] wrote:
On 2006-10-08, Aahz [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED], John J. Lee [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Aahz) writes:
The following line of lightly
On 2006-10-10, Ben Finney [EMAIL PROTECTED] wrote:
Andy Salnikov [EMAIL PROTECTED] writes:
Aahz [EMAIL PROTECTED] wrote:
Antoon Pardon [EMAIL PROTECTED] wrote:
The problem is there is also ground for bugs if you don't use
blah is True. If some application naturally seems to ask for a
[EMAIL PROTECTED] (John J. Lee) writes:
[...]
Yes, that's true, I didn't really take in this particular example,
just the use of is bool constant. That's not the way it was used
in docutils, though (do I mean docutils?).
No, I meant epydoc (I think...)
John
--
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
Whichever
On 2006-10-07, John Machin [EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not
Antoon Pardon wrote:
On 2006-10-07, John Machin [EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not
On 2006-10-08, Aahz [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED], John J. Lee [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Aahz) writes:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
In article [EMAIL PROTECTED],
Antoon Pardon [EMAIL PROTECTED] wrote:
On 2006-10-08, Aahz [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED], John J. Lee [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Aahz) writes:
The following line of lightly munged code was found in a publicly
available
Ben Finney [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] (John J. Lee) writes:
[EMAIL PROTECTED] (Aahz) writes:
if schema.elements.has_key(key) is False:
I think I was reading the same code recently (epydoc?) and was also
momentarily horrified ;-) until I realized that it was
[EMAIL PROTECTED] (Aahz) writes:
[...]
I think I was reading the same code recently (epydoc?) and was also
momentarily horrified ;-) until I realized that it was quite
deliberately using three-valued logic (True, False, None) for some
presumably-sensible reason. Since None is false, they had
Aahz [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
In article [EMAIL PROTECTED], Antoon Pardon
[EMAIL PROTECTED] wrote:
The problem is there is also ground for bugs if you don't use blah is
True. If some application naturally seems to ask for a variable that
can be valued False,
Andy Salnikov [EMAIL PROTECTED] writes:
Aahz [EMAIL PROTECTED] wrote:
Antoon Pardon [EMAIL PROTECTED] wrote:
The problem is there is also ground for bugs if you don't use
blah is True. If some application naturally seems to ask for a
variable that can be valued False, True or a positive
In message [EMAIL PROTECTED], John
Machin wrote:
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not
False),
blah
Lawrence D'Oliveiro wrote:
In message [EMAIL PROTECTED], John
Machin wrote:
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition
Lawrence D'Oliveiro wrote:
In message [EMAIL PROTECTED], John
Machin wrote:
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition
Google has a cool new service.
http://www.google.com/codesearch
You can use regular expressions!
(I found at least 13 distinct utilities that used the idiom.)
Nils
--
http://mail.python.org/mailman/listinfo/python-list
Aahz wrote:
In article [EMAIL PROTECTED],
MonkeeSage [EMAIL PROTECTED] wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide
On 2006-10-07, MonkeeSage [EMAIL PROTECTED] wrote:
On Oct 6, 8:34 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
And in the original case, I'd agree that if X.has_key(): is
quite clear, already yielding a boolian value, and so doesn't
need to be tested for if it's False. But I wouldn't like to
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
Whichever way your team wants to interpret it, d00d.
Steven D'Aprano wrote:
On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
Whichever way your team
Aahz wrote:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
Sorry, just had to vent.
--
Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/
Uh, guys. IMO, the clearest way of
John Roth wrote:
Aahz wrote:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
Sorry, just had to vent.
--
Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/
Uh,
In article [EMAIL PROTECTED],
John Machin [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
MonkeeSage [EMAIL PROTECTED] wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
John Machin wrote:
... any function/method whose name begins with has or is
returns an honest-to-goodness actual bool (or what passed for
one in former times).
True for 75% of the builtins:
import __builtin__
sorted(nm for nm in dir(__builtin__)
if
[EMAIL PROTECTED] (Aahz) writes:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
Sorry, just had to vent.
I think I was reading the same code recently (epydoc?) and was also
momentarily horrified
[EMAIL PROTECTED] (John J. Lee) writes:
[EMAIL PROTECTED] (Aahz) writes:
if schema.elements.has_key(key) is False:
I think I was reading the same code recently (epydoc?) and was also
momentarily horrified ;-) until I realized that it was quite
deliberately using three-valued logic
In article [EMAIL PROTECTED], John J. Lee [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Aahz) writes:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
Sorry, just had to vent.
I think I was reading
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
Sorry, just had to vent.
--
Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/
If you don't know what your program is supposed to
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
which was written by the very finger of God when the world was still in
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-07, MonkeeSage [EMAIL PROTECTED] wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a
publicly available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide
(pbuh), which was written by the
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
Whichever way your team wants to interpret it, d00d.
Please consider whether you should be writing (blah is False)
On 2006-10-07, John Machin [EMAIL PROTECTED] wrote:
MonkeeSage wrote:
On Oct 6, 8:02 pm, MonkeeSage [EMAIL PROTECTED] wrote:
it is clearer to you to make the condition explicit (blah not False),
blah not False - blah is False
Whichever way your team wants to interpret it, d00d.
Please
At Friday 6/10/2006 22:02, MonkeeSage wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
which was written by the very finger of God when the world was still in
It's not
On 6 Oct 2006 16:27:51 -0700, Aahz [EMAIL PROTECTED] wrote:
The following line of lightly munged code was found in a publicly
available Python library...
if schema.elements.has_key(key) is False:
if not schema.elements.has_key(key): or, actually, if not key in
schema.elements: is how I
On Oct 6, 8:34 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
And in the original case, I'd agree that if X.has_key(): is
quite clear, already yielding a boolian value, and so doesn't
need to be tested for if it's False. But I wouldn't like to test
for an empty list or for None implicitly.
I
MonkeeSage wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
which was written by the very finger of God when the
In article [EMAIL PROTECTED],
MonkeeSage [EMAIL PROTECTED] wrote:
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote:
The following line of lightly munged code was found in a publicly
available Python library...
Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
which was
38 matches
Mail list logo