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
See #432 where methods were added to TimestampSeries and TimedeltaSeries that return Never, which pyright will pick up as invalid.
We could add more of these to disallow certain operations between incompatible types, and then use the TYPE_CHECKING_INVALID_USAGE pattern to check for these.
The text was updated successfully, but these errors were encountered:
Turns out that we should not do this. See discussion here: python/mypy#14424
If you have a base class Base and a subclass Sub, then just declare the valid parameters for a method in Sub. This will override any declaration in Base. For mypy, probably need # type: ignore[override].
If you have a method xyz(self, x: Any) in Base and you don't want to allow Sub to be called then add def xyz(self, x: Never) -> Never in Sub, or in Sub, you can write xyz = None.
See #432 where methods were added to
TimestampSeries
andTimedeltaSeries
that returnNever
, whichpyright
will pick up as invalid.We could add more of these to disallow certain operations between incompatible types, and then use the
TYPE_CHECKING_INVALID_USAGE
pattern to check for these.The text was updated successfully, but these errors were encountered: