equality & comparison by default (was Re: Too many 'self' in python.That's a big flaw in this language.)
aisaac at american.edu
Thu Jun 28 15:52:13 CEST 2007
>>>>a = Car2(123)
>>>>b = Car2(123)
>>>>a == b
> set([Car2(123), Car2(123)])
> I get a set with two equal cars, something that never happens with a set
> my math teacher once told me.
Then your math teacher misspoke.
You have two different cars in the set,
just as expected. Use `is`.
This is good behavior.
More information about the Python-list