classification
Title: bug in python 2.4.3 for windows?
Type: Stage:
Components: Windows Versions: Python 2.4
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, tinkiwinky (2)
Priority: normal Keywords

Created on 2006-08-16 20:59 by tinkiwinky, last changed 2006-08-16 21:07 by georg.brandl.

Messages (2)
msg29524 - (view) Author: tinkiwinky (tinkiwinky) Date: 2006-08-16 20:59
y = ["halo:lol","ich:bin","wir:wareum","galopp:kufladen"]
for i in y:
	z = i.split(":")[0]
	if z is "wir":
		print z, "is wir"
	else: print z, "is not wir"


the output from this include: "wir is not wir"
I am using python 2.4.3 on windows xp sp2 german
msg29525 - (view) Author: Georg Brandl (georg.brandl) Date: 2006-08-16 21:07
Logged In: YES 
user_id=849994

Don't use "is" for string comparison. It compares object
identity, and while this may work in some cases, it does not
in most. Use "==" instead.

Closing as Invalid.
History
Date User Action Args
2006-08-16 20:59:15tinkiwinkycreate