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 ". That's not the way it was used > in docutils, though (do I mean docutils?). No, I meant epydoc (I think...) John -- http://mail.python.org/mailman/listin

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 natural

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: > > T

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,

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 >>ca

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, th

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 th

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

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_ke

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 t

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 ("bl

Re: Names changed to protect the guilty

2006-10-08 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" -> "

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-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 cle

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 cle

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 ("bla

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 t

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 logi

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 horri

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 nm.sta

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 avai

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.pythoncra

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 cleares

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" >

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 i

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'

Re: Names changed to protect the guilty

2006-10-06 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, Inf

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), >

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

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.

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

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 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 inter

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 "(

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 wri

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 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 chaot

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