You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to type a generic class with a method that takes a parameter added to its generic attribute and returns a new instance. This is the slightly simplified example:
I would like to use something other than Any to annotate the bar parameter, but I cannot find a solution that correctly handles both self.value.__add__(bar) and bar.__radd__(self.value).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to type a generic class with a method that takes a parameter added to its generic attribute and returns a new instance. This is the slightly simplified example:
I would like to use something other than
Any
to annotate thebar
parameter, but I cannot find a solution that correctly handles bothself.value.__add__(bar)
andbar.__radd__(self.value)
.Any idea?
Beta Was this translation helpful? Give feedback.
All reactions