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
This code works, but pyright thinks the x: int annotation is conflicting with it being typed as Self@A: error: Type of parameter "x" must be a supertype of its class "A". Clearly I'm missing something to communicate to the type checker that this body shouldn't be interpreted as an instance method. I can write @staticmethod and that works but I would really like to find some solution that just adjusts the signature and body of wrapper since this is gonna be a LOT of lines in the code I'm trying to write.
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.
-
This code works, but pyright thinks the x: int annotation is conflicting with it being typed as Self@A:
error: Type of parameter "x" must be a supertype of its class "A". Clearly I'm missing something to communicate to the type checker that this body shouldn't be interpreted as an instance method. I can write @staticmethod and that works but I would really like to find some solution that just adjusts the signature and body ofwrappersince this is gonna be a LOT of lines in the code I'm trying to write.Beta Was this translation helpful? Give feedback.
All reactions