How to test if an object IS another object?

bruno modulix onurb at xiludom.gro
Mon Jun 13 04:30:12 EDT 2005


eloff777 at yahoo.com wrote:
> 
> Tuples (which are immutable) also appear to be reused
> 
> 
>>>>foo = ()
>>>>bar = ()
>>>>foo is bar
> 
> True

Not always:

foo = (1,)
bar = (1,)
foo is bar
=> False


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list