At 01:32 PM 10/14/2005 +1300, Greg Ewing wrote: >Phillip J. Eby wrote: > > > Actually, it's desirable to be *able* to do it for anything. But > certainly > > for otherwise-immutable objects it can lead to aliasing issues. > >Even for immutables, it could be useful to be able to >add behaviour that doesn't mutate anything.
I meant that just changing its class is a mutation, and since immutables can be shared or cached, that could lead to problems. So I do think it's a reasonable implementation limit to disallow changing the __class__ of an immutable. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com