Closed Wouter1 closed 2 months ago
My first guess is that the method resolver does not realize that __f results in a mangled name.
Yes, the register
method can be used explicitly instead of the "magic" namespace lookup.
class A:
@multimethod
def __f(self, x:Optional[int])->int:
return 1
@__f.register
def _(self, x:int, y:int)->int:
return 2
@coady thanks for the quick response and confirmation of the issue. Also thanks for the workaround.
However I believe this case should be handled automatically.
Describe the bug If the method being overloaded (with @multimethod) is a private method, calling the method seems to fail
To Reproduce
Now in python commandline do
Now call
A().test()
Expected behavior prints
1
Actual behavior
My first guess is that the method resolver does not realize that __f results in a mangled name.