bsc-quantic / rosnet

Large-scale tensor algebra using pyCOMPSs
Apache License 2.0
4 stars 0 forks source link

Deduplicate Array-like instance methods with mixin #28

Closed mofeing closed 1 year ago

mofeing commented 2 years ago

Array-like classes that duck-type the numpy.ndarray interface expect some methods to be also callable as instance-methods; e.g. numpy.reshape and numpy.ndarray.reshape.

As the interface is the same, implementation just calls the dispatcher multimethod. Code duplication can be saved if we automatically implement this with a mixin.