Thoughts on new vs traditional idioms

Jeff Epler jepler at unpythonic.net
Tue Mar 2 09:55:48 EST 2004


On Tue, Mar 02, 2004 at 03:48:19PM +0100, Peter Otten wrote:
> Do you have a class with immutable instances handy where the following
> assertion fails?
> 
> assert immutableObj.__class__(immutableObj) is immutableObj

Python 2.3.2 (#1, Oct 17 2003, 10:41:07) 
>>> import sets
>>> ii = sets.ImmutableSet([1,2,3])
>>> ii.__class__(ii) is ii
False

Jeff




More information about the Python-list mailing list