metaclass that inherits a class of that metaclass?

Kay Schluehr kay.schluehr at gmx.net
Wed Jun 1 14:05:39 EDT 2005


ironfroggy wrote:
> because they are representing a seperate typing system outside of
> python, to which I am creating a bridge.

Since a type-hierarchy is a tree also a subtree of it is a
type-hierarchy. You only have to map the root of a sub-hierarchy of
Python classes to the root of the hierarchy of the other typing system
and create an isomorphism between types. For exactly the same reason
you can map Pythons type hierarchy onto a sub-hierarchy of it. This
might not be completely sufficient because there are functions that
operate on types ( like mro(), isinstance(), type() etc. ). Those must
be mapped as well to counterparts of the other type-system. In
contemporary CS slang this is called a 'Functor of Categories' with
objects that are types ( and boolean values like True, False ) and
arrows that are type aware functions like those listed above.

Kay




More information about the Python-list mailing list