Replies: 1 comment
-
|
The type of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Came across something like this today
CoordinatorEntityfor classAis (obviously) missing a generic argument. Let's assume for a moment that it's not possible to add one in a legacy codebase. Canself.coordinatorstill be narrowed toDataUpdateCoordinator?mypy and pyre just infer it as
Anywhereas pyright says it'sunknown. We do know that_Thas an upper bound inDataUpdateCoordinatorso every generic argument will need to be a subclass ofDataUpdateCoordinatorand thus also have adataattribute.erroris more complicate. Without a concrete type, I would assume this should be an error though.Am I missing something? If not, improving the type narrowing here could help with better intellisense suggestions and type checking in partially typed code bases.
Beta Was this translation helpful? Give feedback.
All reactions