-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.narrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing
Milestone
Description
When strictly maintaining soundness, narrowing tends to produce results that are quite different from user intuition.
Users may not realize that this is due to the specifications of ty (or Python type system), and may consider it an incompleteness or a bug (e.g. #2215).
Therefore, if the cause of the error is thought to be a narrowing failure, it may be better to provide a hint as to why narrowing could not be applied.
Also, in some cases, alternatives can be suggested that make narrowing applicable (such as using is instead of ==, typing explicitly, or marking the class as non-inheritable with typing.final).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.narrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing