My environment: Python 3.7.4, Multimethod was installed from source, macOS 10.14.6.
Case No:1, Dictionary
Traceback (most recent call last):
File "example03_3_args_built_in_types.py", line 40, in <module>
case_s1 = Summary(df=dfs_dct, head=0, tail=-1)
File "/path/to/multimethod/multimethod.py", line 108, in __call__
return self[tuple(map(type, args))](*args, **kwargs)
File "//path/to/multimethod/multimethod.py", line 104, in __missing__
raise DispatchError("{}{}: {} methods found".format(self.__name__, types, len(keys)))
multimethod.DispatchError: __init__(<class '__main__.Summary'>,): 0 methods found
However, when I commented line A and block B, Case 1 is works.
Case No:1, Dictionary
case_s1
Name = df1
1
12
Name = df2
4
15
Name = df3
7
18
Case No:2, List
case_s2
Traceback (most recent call last):
File "example03_3_args_built_in_types.py", line 50, in <module>
case_s2.summary()
File "example03_3_args_built_in_types.py", line 31, in summary
self.__summary2(self.df)
File "/path/to/multimethod/multimethod.py", line 108, in __call__
return self[tuple(map(type, args))](*args, **kwargs)
File "/path/to/multimethod/multimethod.py", line 104, in __missing__
raise DispatchError("{}{}: {} methods found".format(self.__name__, types, len(keys)))
multimethod.DispatchError: __summary2(<class '__main__.Summary'>, <class 'float'>): 0 methods found
I also tried to use multimethod.multimeta and the func.register syntax, but the result was the same.
Hi! I tried to use
multimethod.multimethod
to define several class methods, it works for one argument, however it doesn't work for more. For example:My environment: Python 3.7.4, Multimethod was installed from source, macOS 10.14.6.
However, when I commented line A and block B, Case 1 is works.
I also tried to use
multimethod.multimeta
and thefunc.register
syntax, but the result was the same.