Oh well. I had wanted to be able to define two functions f and g, and
have f*g be the composition of f and g.
[color=blue][color=green][color=darkred]
>>> func_type = type(lambda: None)
>>> class composable_func tion(func_type) :[/color][/color][/color]
... def __mult__(f,g):
... def c(*args, **kw):
... return f(g(*args, **kw))
... return c
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
type 'function' is not an acceptable base type[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Seems like a wart to me.
have f*g be the composition of f and g.
[color=blue][color=green][color=darkred]
>>> func_type = type(lambda: None)
>>> class composable_func tion(func_type) :[/color][/color][/color]
... def __mult__(f,g):
... def c(*args, **kw):
... return f(g(*args, **kw))
... return c
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
type 'function' is not an acceptable base type[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Seems like a wart to me.
Comment