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
-
Came across something like this today
CoordinatorEntity
for classA
is (obviously) missing a generic argument. Let's assume for a moment that it's not possible to add one in a legacy codebase. Canself.coordinator
still be narrowed toDataUpdateCoordinator
?mypy and pyre just infer it as
Any
whereas pyright says it'sunknown
. We do know that_T
has an upper bound inDataUpdateCoordinator
so every generic argument will need to be a subclass ofDataUpdateCoordinator
and thus also have adata
attribute.error
is 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