Re: Names changed to protect the guilty

2006-10-10 Thread Antoon Pardon
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

Re: Names changed to protect the guilty

2006-10-10 Thread Antoon Pardon
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

Re: Names changed to protect the guilty

2006-10-10 Thread John J. Lee
[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 --

Re: Names changed to protect the guilty

2006-10-09 Thread Hendrik van Rooyen
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

Re: Names changed to protect the guilty

2006-10-09 Thread Antoon Pardon
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

Re: Names changed to protect the guilty

2006-10-09 Thread Steve Holden
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

Re: Names changed to protect the guilty

2006-10-09 Thread Antoon Pardon
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:

Re: Names changed to protect the guilty

2006-10-09 Thread Aahz
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

Re: Names changed to protect the guilty

2006-10-09 Thread John J. Lee
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

Re: Names changed to protect the guilty

2006-10-09 Thread John J. Lee
[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

Re: Names changed to protect the guilty

2006-10-09 Thread Andy Salnikov
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,

Re: Names changed to protect the guilty

2006-10-09 Thread Ben Finney
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

Re: Names changed to protect the guilty

2006-10-08 Thread Lawrence D'Oliveiro
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

Re: Names changed to protect the guilty

2006-10-08 Thread John Machin
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

Re: Names changed to protect the guilty

2006-10-08 Thread John Machin
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 code search (Was: Names changed to protect the guilty)

2006-10-08 Thread Nils R Grotnes
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

Re: Names changed to protect the guilty

2006-10-07 Thread John Machin
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

Re: Names changed to protect the guilty

2006-10-07 Thread Neil Cerutti
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

Re: Names changed to protect the guilty

2006-10-07 Thread Steven D'Aprano
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.

Re: Names changed to protect the guilty

2006-10-07 Thread John Machin
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

Re: Names changed to protect the guilty

2006-10-07 Thread John Roth
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

Re: Names changed to protect the guilty

2006-10-07 Thread John Machin
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,

Re: Names changed to protect the guilty

2006-10-07 Thread Aahz
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...

Re: Names changed to protect the guilty

2006-10-07 Thread Scott David Daniels
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

Re: Names changed to protect the guilty

2006-10-07 Thread John J. Lee
[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

Re: Names changed to protect the guilty

2006-10-07 Thread Ben Finney
[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

Re: Names changed to protect the guilty

2006-10-07 Thread Aahz
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

Names changed to protect the guilty

2006-10-06 Thread Aahz
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

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
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

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
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

Re: Names changed to protect the guilty

2006-10-06 Thread Neil Cerutti
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

Re: Names changed to protect the guilty

2006-10-06 Thread John Machin
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)

Re: Names changed to protect the guilty

2006-10-06 Thread Neil Cerutti
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

Re: Names changed to protect the guilty

2006-10-06 Thread Gabriel Genellina
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

Re: Names changed to protect the guilty

2006-10-06 Thread hanumizzle
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

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
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

Re: Names changed to protect the guilty

2006-10-06 Thread Virgil Dupras
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

Re: Names changed to protect the guilty

2006-10-06 Thread Aahz
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