- Allows an extension C module to provide subclassable types:
class MySpecial(BaseSpecial):
clvar = 42
def math(self, arg): print arg
- if...
type(BaseSpecial)
...is callable,
it will be invoked like:
t = type(BaseSpecial)
t("MySpecial", (BaseSpecial,), dict)
- ...where...
dict = {'clvar':42, 'math':}
- Layered on the first base class
- Return value of call is stored as:
MySpecial
- extension can do whatever it wants
- Don's MESS uses this
- See David Ascher's home page (from Python contrib page) and David
has a pointer to Don's MESS