-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
I have two methods in my Gradient class that I would like to overload as scalar_product:
def scalar_gradient_product(self, gradient: Gradient) -> Density:
...
and
def scalar_density_product(self, density: Density) -> ndarray:
...
I decorated both with multimethod as follows:
@multimethod
def scalar_product(self, gradient: Gradient) -> Density:
...
and
@multimethod
def scalar_product(self, density: Density) -> ndarray:
...
This works, i.e. calling scalar_product with Gradient or Density arguments yields the expected respective results. However, I seem to have lost my type-hinting benefits. My editor (VS code) now thinks scalar_product is a property with a return type of multimethod or MethodType.
Am I missing something? Is there some way of gaining the overloading functionality without losing type-hinting?
Thanks in advance 🙂
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
