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 is a followup issue to #1212. #2193 enabled method type annotations to refer to the type of self, but (intentionally) didn't address generic classes. In many cases, the self types added there meet the needs of generic classes, but not always.
This feels like a duplicate of #2354, but the example raises somewhat different concerns. Maybe we should copy the example to #2354 and close this issue?
This is a followup issue to #1212. #2193 enabled method type annotations to refer to the type of
self
, but (intentionally) didn't address generic classes. In many cases, the self types added there meet the needs of generic classes, but not always.A motivating example is typeshed's AbstractClass:
With #2193 we can annotate
__and__
, and it works beautifully:But, we don't have the tools to give
__or__
a similarly specific type. To do this, we need some way to talk about the "generic" part of the self type.The text was updated successfully, but these errors were encountered: