[ty] Support isinstance() and issubclass() narrowing when the second argument is a typing.py stdlib alias by AlexWaygood · Pull Request #21391 · astral-sh/ruff (original) (raw)
mypy_primer results
Changes were detected when running on open source projects
kornia (https://github.com/kornia/kornia)
- kornia/utils/draw.py:379:38: warning[possibly-missing-attribute] Attribute
shapemay be missing on object of typeUnknown | list[Unknown] - kornia/utils/draw.py:379:54: warning[possibly-missing-attribute] Attribute
devicemay be missing on object of typeUnknown | list[Unknown] - kornia/utils/draw.py:379:71: warning[possibly-missing-attribute] Attribute
dtypemay be missing on object of typeUnknown | list[Unknown] - Found 762 diagnostics
- Found 759 diagnostics
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/appsec/_iast/_ast/visitor.py:785:32: warning[possibly-missing-attribute] Attribute
eltsmay be missing on object of type(expr & Top[list[Unknown]] & ~Subscript) | (Tuple & ~Subscript)
- ddtrace/appsec/_iast/_ast/visitor.py:785:32: error[unresolved-attribute] Object of type
expr & ~Subscripthas no attributeelts - ddtrace/appsec/_iast/_ast/visitor.py:787:55: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - Found 8226 diagnostics
- Found 8225 diagnostics
sympy (https://github.com/sympy/sympy)
- sympy/matrices/sparse.py:143:46: error[call-non-callable] Object of type
Noneis not callable - sympy/matrices/sparse.py:174:56: error[not-iterable] Object of type
(Unknown & ~Top[dict[Unknown, Unknown]] & ~Dict) | Nonemay not be iterable
- sympy/matrices/sparse.py:174:56: error[not-iterable] Object of type
(Unknown & ~(() -> object) & ~Top[dict[Unknown, Unknown]] & ~Dict) | Nonemay not be iterable
- sympy/matrices/sparse.py:184:41: error[invalid-argument-type] Argument to function
lenis incorrect: ExpectedSized, found(Unknown & ~Top[dict[Unknown, Unknown]] & ~Dict) | None
- sympy/matrices/sparse.py:184:41: error[invalid-argument-type] Argument to function
lenis incorrect: ExpectedSized, found(Unknown & ~(() -> object) & ~Top[dict[Unknown, Unknown]] & ~Dict) | None
- Found 14444 diagnostics
- Found 14443 diagnostics
No memory usage changes detected ✅