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
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
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
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
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
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
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
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
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.
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
10 matches
Mail list logo