Boolean confusion
From: Frantisek Fuka (fuka_at_fuxoft.cz)
Date: 10/31/03
- Next message: Dfenestr8: "A simple Python CGI server?"
- Previous message: Corey Coughlin: "Re: lightweight human-readable config?"
- Next in thread: Peter Hansen: "Re: Boolean confusion"
- Reply: Peter Hansen: "Re: Boolean confusion"
- Reply: John Roth: "Re: Boolean confusion"
- Maybe reply: Batista, Facundo: "RE: Boolean confusion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 19:37:25 +0100
Can anyone please explain why these two give different results in Python
2.3?
>>> 'a' in 'abc' == 1
False
>>> ('a' in 'abc') == 1
True
I know it's not a good idea to compare boolean with Integer but that's
not the answer to my question.
--
Frantisek Fuka
(yes, that IS my real name)
(and it's pronounced "Fran-tjee-shek Foo-kah")
----------------------------------------------------
My E-mail: fuka@fuxoft.cz
My Homepage: http://www.fuxoft.cz
My ICQ: 2745855
- Next message: Dfenestr8: "A simple Python CGI server?"
- Previous message: Corey Coughlin: "Re: lightweight human-readable config?"
- Next in thread: Peter Hansen: "Re: Boolean confusion"
- Reply: Peter Hansen: "Re: Boolean confusion"
- Reply: John Roth: "Re: Boolean confusion"
- Maybe reply: Batista, Facundo: "RE: Boolean confusion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]