Really stupid question regarding PEP 252 and type/class unification

Paul Prescod paulp at ActiveState.com
Fri Aug 31 20:55:15 EDT 2001


Russell Turpin wrote:
> 
>...
> 
> Now .. what about mutability? An int is immutable. But
> a type derived from int is mutable. At least in its
> attributes. But its default (core? base? what is the
> right term?) value is still immutable. So mutability
> is really a quality of the core/base/whatever value,
> rather than of the type itself.

I would say that the instance of the integer subtype is mutable but its
value as an integer is not changeable. I expect it would still be
hashable unless you override its __hash__.
-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook




More information about the Python-list mailing list