RE: Use of the "is" statement

2008-06-29 Thread Delaney, Timothy (Tim)
Maric Michaud wrote: > Le Friday 27 June 2008 18:26:45 Christian Heimes, vous avez écrit : >> Ask yourself if you are interested if f.tell() returns exactly the >> same 0 object ("is") or a number that is equal to 0 ("=="). > > That said, "f.tell() == 0" and "f.tell() != 0" should be written > "f

Re: Use of the "is" statement

2008-06-27 Thread Maric Michaud
Le Friday 27 June 2008 18:26:45 Christian Heimes, vous avez écrit : > Ask yourself if you are interested if f.tell() returns exactly the same > 0 object ("is") or a number that is equal to 0 ("=="). That said, "f.tell() == 0" and "f.tell() != 0" should be written "f.tell()" and "not f.tell()" in

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Joel Corbin wrote: > Thank you Gary, Cédric, Christian. When *would *one use "is"? As I said: The "is" statement should only be used when you want to check of something is exactly and identical to None like "a is None" or "b is not None". For everything else you should use == or !=. There are some

Re: Use of the "is" statement

2008-06-27 Thread Jason Scheirer
On Jun 27, 8:38 am, Gary Herron <[EMAIL PROTECTED]> wrote: > Joel Corbin wrote: > > Hello, > > > I'm trying to clarify what exactly the behaviour of the is statement > > is (or should be). Naturally, this has been nearly impossible to > > google for, even using quotations... It is my impression tha

Re: Use of the "is" statement

2008-06-27 Thread Joel Corbin
Thank you Gary, Cédric, Christian. When *would *one use "is"? Cédric... the problem I was having was purely an issue of comparison "if file.tell() is 0L" was returning False. Strangely enough, "if file.tell() is 0" returns True in the right cases. I assume this is related to the None case? On

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Gary Herron wrote: > In short: *never* use "is". Never use "is" unless you want to check "if something is None or something is not None" Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of the "is" statement

2008-06-27 Thread Cédric Lucantis
Le Friday 27 June 2008 16:51:07 Joel Corbin, vous avez écrit : > Hello, > > I'm trying to clarify what exactly the behaviour of the is statement is (or > should be). Naturally, this has been nearly impossible to google for, even > using quotations... try this one: http://www.google.com/search?hl

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Joel Corbin wrote: > I'm trying to clarify what exactly the behaviour of the is statement is (or > should be). ... People often think that "is" is part of the comparison operator set. The "is" statement does not compare two objects. Never ever use "is" to compare strings or numbers. Christian

Re: Use of the "is" statement

2008-06-27 Thread Gary Herron
Joel Corbin wrote: Hello, I'm trying to clarify what exactly the behaviour of the is statement is (or should be). Naturally, this has been nearly impossible to google for, even using quotations... It is my impression that the is statement should be equivalent to "==", at least on some level.

Use of the "is" statement

2008-06-27 Thread Joel Corbin
Hello, I'm trying to clarify what exactly the behaviour of the is statement is (or should be). Naturally, this has been nearly impossible to google for, even using quotations... It is my impression that the is statement should be equivalent to "==", at least on some level. However, this equivalenc