[ty] Fix binary intersection comparison inference logic by InSyncWithFoo · Pull Request #18266 · astral-sh/ruff (original) (raw)
mypy_primer results
Changes were detected when running on open source projects
beartype (https://github.com/beartype/beartype)
- error[unsupported-operator] beartype/_cave/_cavemap.py:144:18: Operator
inis not supported for typestypeandstr, in comparingtypewith(str & tuple[Unknown, ...] & ~type & ~AlwaysFalsy) | (@Todo(Inference of subscript on special form) & tuple[Unknown, ...] & ~type & ~AlwaysFalsy) - Found 551 diagnostics
- Found 550 diagnostics
stone (https://github.com/dropbox/stone)
- error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:305:20: Operator
>=is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:309:20: Operator
>is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:367:20: Operator
>=is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:371:20: Operator
>is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:430:20: Operator
>=is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] stone/backends/python_rsrc/stone_validators.py:434:20: Operator
>is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - Found 179 diagnostics
- Found 173 diagnostics
graphql-core (https://github.com/graphql-python/graphql-core)
- error[unsupported-operator] tests/language/test_visitor.py:44:16: Operator
<=is not supported for typesintandstr, in comparingLiteral[0]with(Unknown & int) | (Unknown & str & int) - error[unsupported-operator] tests/language/test_visitor.py:44:21: Operator
<=is not supported for typesstrandint, in comparing(Unknown & int) | (Unknown & str & int)withint - error[unsupported-operator] tests/language/test_visitor.py:64:24: Operator
<=is not supported for typesintandstr, in comparingLiteral[0]with(@Todo(Type::Intersection.call()) & int) | (@Todo(Type::Intersection.call()) & str & int) - error[unsupported-operator] tests/language/test_visitor.py:64:29: Operator
<=is not supported for typesstrandint, in comparing(@Todo(Type::Intersection.call()) & int) | (@Todo(Type::Intersection.call()) & str & int)withint - Found 411 diagnostics
- Found 407 diagnostics
pybind11 (https://github.com/pybind/pybind11)
- error[unsupported-operator] tests/test_multiple_interpreters.py:67:12: Operator
inis not supported for typesstrandNone, in comparingLiteral["does not support loading in subinterpreters"]with(Unknown & None) | @Todo(map_with_boundness: intersections with negative contributions) | str - Found 264 diagnostics
- Found 263 diagnostics
ignite (https://github.com/pytorch/ignite)
- error[unsupported-operator] ignite/engine/events.py:90:81: Operator
>is not supported for typesIntegralandint, in comparingint & IntegralwithLiteral[0]
- error[unsupported-operator] ignite/engine/events.py:94:57: Operator
>is not supported for typeslist[Unknown]andint, in comparing(int & Integral) | (list[Unknown] & Integral)withLiteral[0]
- error[unsupported-operator] ignite/engine/events.py:94:57: Operator
>is not supported for typesIntegralandint, in comparing(int & Integral) | (list[Unknown] & Integral)withLiteral[0] - error[unsupported-operator] ignite/engine/events.py:101:83: Operator
>=is not supported for typesIntegralandint, in comparingint & IntegralwithLiteral[0] - error[unsupported-operator] ignite/engine/events.py:104:81: Operator
>=is not supported for typesIntegralandint, in comparingint & IntegralwithLiteral[0] - error[unsupported-operator] ignite/handlers/param_scheduler.py:1128:13: Operator
>is not supported for typesIntegralandint, in comparingint & IntegralwithLiteral[1] - error[unsupported-operator] ignite/handlers/param_scheduler.py:1156:20: Operator
>is not supported for typesIntegralandint, in comparingint & IntegralwithLiteral[2] - error[unsupported-operator] ignite/metrics/confusion_matrix.py:253:64: Operator
<=is not supported for typesintandIntegral, in comparingLiteral[0]withint & Integral - error[unsupported-operator] ignite/metrics/confusion_matrix.py:409:64: Operator
<=is not supported for typesintandIntegral, in comparingLiteral[0]withint & Integral - Found 2229 diagnostics
- Found 2222 diagnostics
vision (https://github.com/pytorch/vision)
- error[unsupported-operator] torchvision/transforms/functional.py:373:16: Operator
<=is not supported for typesintandlist[int], in comparingintwith(list[int] & int) | @Todo(map_with_boundness: intersections with negative contributions) - error[unsupported-operator] torchvision/transforms/transforms.py:1208:16: Operator
<is not supported for typesNumberandint, in comparingUnknown & NumberwithLiteral[0] - error[unsupported-operator] torchvision/transforms/transforms.py:1779:16: Operator
<=is not supported for typesNumberandint, in comparing(Unknown & Number) | (tuple[float, float] & Number)withLiteral[0]
- error[unsupported-operator] torchvision/transforms/transforms.py:1779:16: Operator
<=is not supported for typestuple[float, float]andLiteral[0], in comparing(Unknown & Number) | (tuple[float, float] & Number)withLiteral[0]
- error[unsupported-operator] torchvision/transforms/transforms.py:1842:12: Operator
<is not supported for typesNumberandint, in comparingUnknown & NumberwithLiteral[0] - Found 1843 diagnostics
- Found 1840 diagnostics
paasta (https://github.com/yelp/paasta)
- error[unsupported-operator] paasta_tools/api/views/autoscaler.py:84:10: Operator
<is not supported for typesintandNone, in comparingUnknown & intwithint | None - Found 935 diagnostics
- Found 934 diagnostics
schema_salad (https://github.com/common-workflow-language/schema_salad)
- error[unsupported-operator] schema_salad/jsonld_context.py:210:16: Operator
inis not supported for typesstrandint, in comparingstrwith(CommentedMap & MutableMapping[Unknown, Unknown]) | (int & MutableMapping[Unknown, Unknown]) | (float & MutableMapping[Unknown, Unknown]) | (str & MutableMapping[Unknown, Unknown]) | (CommentedSeq & MutableMapping[Unknown, Unknown]) - Found 251 diagnostics
- Found 250 diagnostics
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- error[unsupported-operator] mitmproxy/io/compat.py:519:21: Operator
>is not supported for typestuple[Unknown, ...]andint, in comparing(Any & int) | (tuple[Unknown, ...] & int)withUnknown | Literal[21] - Found 2112 diagnostics
- Found 2111 diagnostics
PyGithub (https://github.com/PyGithub/PyGithub)
- error[unsupported-operator] github/AdvisoryCredit.py:94:20: Operator
inis not supported for typesstrandAdvisoryCredit, in comparingLiteral["login"]with(Unknown & dict[Unknown, Unknown]) | (Unknown & AdvisoryCredit & dict[Unknown, Unknown]) - error[unsupported-operator] github/AdvisoryCredit.py:95:20: Operator
inis not supported for typesstrandAdvisoryCredit, in comparingLiteral["type"]with(Unknown & dict[Unknown, Unknown]) | (Unknown & AdvisoryCredit & dict[Unknown, Unknown]) - error[unsupported-operator] github/AdvisoryCredit.py:106:20: Operator
inis not supported for typesstrandAdvisoryCredit, in comparingLiteral["login"]with(Unknown & dict[Unknown, Unknown]) | (Unknown & AdvisoryCredit & dict[Unknown, Unknown]) - error[unsupported-operator] github/AdvisoryCredit.py:107:20: Operator
inis not supported for typesstrandAdvisoryCredit, in comparingLiteral["type"]with(Unknown & dict[Unknown, Unknown]) | (Unknown & AdvisoryCredit & dict[Unknown, Unknown]) - Found 316 diagnostics
- Found 312 diagnostics
cloud-init (https://github.com/canonical/cloud-init)
- error[unsupported-operator] cloudinit/sources/DataSourceAliYun.py:366:35: Operator
>=is not supported for typesNoneandint, in comparingUnknown | (Unknown & int) | (Unknown & None)withLiteral[400] - error[unsupported-operator] tests/unittests/sources/helpers/test_ec2.py:279:38: Operator
inis not supported for typesstrandNone, in comparingLiteral["meta-data/tags/"]withUnknown | (Unknown & str) | (Unknown & None) - Found 717 diagnostics
- Found 715 diagnostics
django-stubs (https://github.com/typeddjango/django-stubs)
- error[unsupported-operator] mypy_django_plugin/django/context.py:383:18: Operator
not inis not supported for typesstrandtype[Model], in comparingLiteral["."]with(type[Model] & str) | (@Todo(map_with_boundness: intersections with negative contributions) & str & ~Literal["self"]) - Found 473 diagnostics
- Found 472 diagnostics
sphinx (https://github.com/sphinx-doc/sphinx)
- error[unsupported-operator] sphinx/builders/html/init.py:471:40: Operator
not inis not supported for typesstrandLiteral[True], in comparingstrwith(Unknown & Literal[True]) | frozenset[Unknown] - error[unsupported-operator] sphinx/writers/latex.py:567:40: Operator
not inis not supported for typesstrandLiteral[True], in comparingstrwith(Unknown & Literal[True]) | frozenset[Unknown] - error[unsupported-operator] sphinx/writers/texinfo.py:500:40: Operator
not inis not supported for typesstrandLiteral[True], in comparingstrwith(Unknown & Literal[True]) | frozenset[Unknown] - Found 660 diagnostics
- Found 657 diagnostics
static-frame (https://github.com/static-frame/static-frame)
- error[unsupported-operator] static_frame/profile/main.py:2502:42: Operator
inis not supported for types@Todo(Type::Intersection.call())andNone, in comparing@Todo(Type::Intersection.call())with(Any & dict[Unknown, Unknown]) | (Any & None) - Found 2063 diagnostics
- Found 2062 diagnostics
apprise (https://github.com/caronc/apprise)
- error[unsupported-operator] test/test_api.py:452:12: Operator
inis not supported for typesstrandNotifyBase, in comparingLiteral["good"]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:453:12: Operator
not inis not supported for typesstrandNotifyBase, in comparingLiteral["bad"]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:458:12: Operator
inis not supported for typeslist[Unknown]andNotifyBase, in comparinglist[Unknown]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:459:12: Operator
inis not supported for typesset[Unknown]andNotifyBase, in comparingset[Unknown]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:460:12: Operator
inis not supported for typestuple[Literal["bad"], Literal["good"]]andNotifyBase, in comparingtuple[Literal["bad"], Literal["good"]]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:497:12: Operator
inis not supported for typesstrandNotifyBase, in comparingLiteral["good"]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:498:12: Operator
not inis not supported for typesstrandNotifyBase, in comparingLiteral["bad"]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:503:12: Operator
inis not supported for typeslist[Unknown]andNotifyBase, in comparinglist[Unknown]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:504:12: Operator
inis not supported for typesset[Unknown]andNotifyBase, in comparingset[Unknown]withUnknown & NotifyBase - error[unsupported-operator] test/test_api.py:505:12: Operator
inis not supported for typestuple[Literal["bad"], Literal["good"]]andNotifyBase, in comparingtuple[Literal["bad"], Literal["good"]]withUnknown & NotifyBase - Found 3704 diagnostics
- Found 3694 diagnostics
sympy (https://github.com/sympy/sympy)
- error[unsupported-operator] sympy/core/relational.py:354:56: Operator
>is not supported for typesBasicandBasic, in comparing(Unknown & Basic) | Unknownwith(Unknown & Basic) | Unknown - error[unsupported-operator] sympy/holonomic/holonomic.py:1760:32: Operator
inis not supported for typesUnknownand<Protocol with members '__iter__'>, in comparingUnknownwith(Unknown & <Protocol with members '__iter__'>) | list[Unknown] - Found 18754 diagnostics
- Found 18752 diagnostics
scipy (https://github.com/scipy/scipy)
- error[unsupported-operator] scipy/special/_multiufuncs.py:327:17: Operator
>=is not supported for typesIntegralandint, in comparingUnknown & IntegralwithLiteral[0] - error[unsupported-operator] scipy/special/_multiufuncs.py:331:12: Operator
<=is not supported for typesintandIntegral, in comparingLiteral[0]withUnknown & Integral - error[unsupported-operator] scipy/special/_multiufuncs.py:407:12: Operator
<=is not supported for typesintandIntegral, in comparingLiteral[0]withUnknown & Integral - error[unsupported-operator] scipy/stats/_mstats_basic.py:2255:12: Operator
>is not supported for typestuple[float, float]andfloat, in comparing(@Todo(Type::Intersection.call()) & ~None) | (Unknown & float & ~tuple[Unknown, ...]) | (tuple[float, float] & float & ~tuple[Unknown, ...])withfloat - error[unsupported-operator] scipy/stats/_mstats_basic.py:2255:26: Operator
<is not supported for typestuple[float, float]andLiteral[0], in comparing(@Todo(Type::Intersection.call()) & ~None) | (Unknown & float & ~tuple[Unknown, ...]) | (tuple[float, float] & float & ~tuple[Unknown, ...])withLiteral[0] - error[unsupported-operator] scipy/stats/_mstats_basic.py:2258:12: Operator
>is not supported for typestuple[float, float]andfloat, in comparing(@Todo(Type::Intersection.call()) & ~None) | (Unknown & float & ~tuple[Unknown, ...]) | (tuple[float, float] & float & ~tuple[Unknown, ...])withfloat - error[unsupported-operator] scipy/stats/_mstats_basic.py:2258:26: Operator
<is not supported for typestuple[float, float]andLiteral[0], in comparing(@Todo(Type::Intersection.call()) & ~None) | (Unknown & float & ~tuple[Unknown, ...]) | (tuple[float, float] & float & ~tuple[Unknown, ...])withLiteral[0] - Found 7819 diagnostics
- Found 7812 diagnostics
manticore (https://github.com/trailofbits/manticore)
- error[unsupported-operator] manticore/wasm/structure.py:1580:32: Operator
>=is not supported for typesExpressionandint, in comparing@Todo(Inference of subscript on special form) & ExpressionwithLiteral[0] - error[unsupported-operator] manticore/wasm/structure.py:1580:42: Operator
<is not supported for typesExpressionandU32, in comparing@Todo(Inference of subscript on special form) & ExpressionwithU32 - error[unsupported-operator] manticore/wasm/structure.py:1661:18: Operator
>=is not supported for typesExpressionandint, in comparing@Todo(Inference of subscript on special form) & ExpressionwithLiteral[0] - error[unsupported-operator] manticore/wasm/structure.py:1661:32: Operator
<is not supported for typesExpressionandint, in comparing@Todo(Inference of subscript on special form) & Expressionwithint - Found 1236 diagnostics
- Found 1232 diagnostics