Really stupid question regarding PEP 252 and type/class unification

Russell Turpin russell_turpin at hotmail.com
Fri Aug 31 20:35:29 CEST 2001


"Alex Martelli" <aleax at aleax.it> wrote in message news:<9mntls02l31 at enews2.newsguy.com>...
> Like those of many other built-in objects, instances of
> object have no __dict__ to store arbitrary attributes in:
> so, you're limited to using the predefined-slots ..

OK, all that makes sense. Everything is an object.
Some built-in types, such as functions, have a __dict__
and take attributes. Other built-in types do not. All
derived types do. Have I grokked it?

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'm going to have to think on this ..

Russell



More information about the Python-list mailing list