Deriving from builtin types with limited instances and Extending FAQ 6.6

Gerrit Holl gerrit at nl.linux.org
Sun Feb 9 05:46:08 EST 2003


Gerrit Holl schreef op zondag  9 februari om 09:48:41 +0000:
> Laura Creighton schreef op zondag  9 februari om 03:20:32 +0000:
> > <snip Gerrit playing with deriving from classes>
> > 
> > Can you write up a better FAQ entry based on your experiences?
> 
> I can describe the behaviour, but I can't describe why it behaves as such.

Yes I can, because I found the answer:

http://www.python.org/2.2/descrintro.html:
You can use multiple inheritance, but you can't multiply inherit from
different built-in types (for example, you can't create a type that
inherits from both the built-in dict and list types). This is a
permanent restriction; it would require too many changes to Python's
object implementation to lift it. However, you can create mix-in
classes by inheriting from "object". This is a new built-in, naming
the featureless base type of all built-in types under the new system

I think I will try to write up a better FAQ entry answer.

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list