Open voidworker opened 5 years ago
Cursing object type is not working as expected. It is ok for ordinary methods:
>>> from forbiddenfruit import curse >>> curse(object, 'f', lambda x: print("boo")) >>> [].f() boo
But not for magic methods:
>>> from forbiddenfruit import curse >>> curse(object, '__matmul__', (lambda x, y: y(x))) >>> [1,2,3] @ len Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for @: 'list' and 'builtin_function_or_method'
Little testing shows that subclasses do not inherit redefined magic methods.
@alendit , please, could you pay some attention to this?
Cursing object type is not working as expected. It is ok for ordinary methods:
But not for magic methods:
Little testing shows that subclasses do not inherit redefined magic methods.
@alendit , please, could you pay some attention to this?