Skip to content

Conversation

tyralla
Copy link
Collaborator

@tyralla tyralla commented Aug 23, 2025

Fixes #18386

I'm curious to see what the Mypy primer thinks of it...

I'm curious to see what the Mypy primer thinks of it...
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

mypy_primer (https://github.com/hauntsaninja/mypy_primer)
+ mypy_primer/utils.py:109: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ mypy_primer/utils.py:110: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]

typeshed-stats (https://github.com/AlexWaygood/typeshed-stats)
+ scripts/regenerate.py:43: error: Non-overlapping identity check (left operand type: "Sequence[PackageInfo]", right operand type: "None")  [comparison-overlap]

optuna (https://github.com/optuna/optuna)
+ optuna/_convert_positional_args.py:69: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ optuna/_convert_positional_args.py:70: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ optuna/_convert_positional_args.py:74: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ optuna/storages/journal/_file.py:166: error: Non-overlapping equality check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/storages/journal/_file.py:249: error: Non-overlapping equality check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/study/_tell.py:162: error: Non-overlapping identity check (left operand type: "TrialState", right operand type: "None")  [comparison-overlap]
+ optuna/samplers/_base.py:261: error: Non-overlapping identity check (left operand type: "tuple[float, ...]", right operand type: "None")  [comparison-overlap]
+ optuna/pruners/_successive_halving.py:182: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ optuna/samplers/_cmaes.py:615: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/storages/_grpc/servicer.py:117: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ optuna/storages/_grpc/servicer.py:132: error: Non-overlapping identity check (left operand type: "list[StudyDirection]", right operand type: "None")  [comparison-overlap]
+ tests/trial_tests/test_trials.py:31: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ tests/trial_tests/test_trials.py:34: error: Non-overlapping identity check (left operand type: "dict[str, BaseDistribution]", right operand type: "None")  [comparison-overlap]
+ optuna/importance/_base.py:81: error: Non-overlapping identity check (left operand type: "list[str]", right operand type: "None")  [comparison-overlap]
+ tests/storages_tests/journal_tests/test_log_compatibility.py:28: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ optuna/importance/_mean_decrease_impurity.py:77: error: Non-overlapping identity check (left operand type: "list[str]", right operand type: "None")  [comparison-overlap]
+ optuna/importance/_ped_anova/evaluator.py:199: error: Non-overlapping identity check (left operand type: "list[str]", right operand type: "None")  [comparison-overlap]
+ optuna/importance/_fanova/_evaluator.py:85: error: Non-overlapping identity check (left operand type: "list[str]", right operand type: "None")  [comparison-overlap]
+ tests/test_cli.py:1297: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ tests/test_cli.py:1337: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ tests/study_tests/test_study.py:219: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ tests/study_tests/test_study.py:394: error: Non-overlapping identity check (left operand type: "InMemoryStorage | _CachedStorage | RDBStorage | JournalStorage | GrpcStorageProxy", right operand type: "None")  [comparison-overlap]
+ tests/study_tests/test_study.py:415: error: Non-overlapping identity check (left operand type: "InMemoryStorage | _CachedStorage | RDBStorage | JournalStorage | GrpcStorageProxy", right operand type: "None")  [comparison-overlap]
+ tests/study_tests/test_study.py:1426: error: Non-overlapping equality check (left operand type: "None", right operand type: "float")  [comparison-overlap]
+ tests/study_tests/test_study.py:1433: error: Non-overlapping equality check (left operand type: "None", right operand type: "float")  [comparison-overlap]
+ tests/study_tests/test_study.py:1739: error: Non-overlapping equality check (left operand type: "None", right operand type: "list[str]")  [comparison-overlap]
+ tests/study_tests/test_study.py:1741: error: Non-overlapping equality check (left operand type: "None", right operand type: "list[str]")  [comparison-overlap]
+ optuna/terminator/median_erroreval.py:84: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/_slice.py:231: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['None']")  [comparison-overlap]
+ optuna/visualization/_slice.py:231: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/_optimization_history.py:139: error: Non-overlapping identity check (left operand type: "list[_OptimizationHistoryInfo]", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_slice.py:118: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['None']")  [comparison-overlap]
+ optuna/visualization/matplotlib/_slice.py:118: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_pareto_front.py:137: error: Non-overlapping identity check (left operand type: "list[tuple[FrozenTrial, list[float]]]", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_pareto_front.py:157: error: Non-overlapping identity check (left operand type: "list[tuple[FrozenTrial, list[float]]]", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_pareto_front.py:169: error: Non-overlapping identity check (left operand type: "list[tuple[FrozenTrial, list[float]]]", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_pareto_front.py:178: error: Non-overlapping identity check (left operand type: "list[tuple[FrozenTrial, list[float]]]", right operand type: "None")  [comparison-overlap]
+ optuna/visualization/matplotlib/_pareto_front.py:187: error: Non-overlapping identity check (left operand type: "list[tuple[FrozenTrial, list[float]]]", right operand type: "None")  [comparison-overlap]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/sandbox.py:280:8: error: Non-overlapping identity check (left operand type: "CDLL", right operand type: "None")  [comparison-overlap]
+ mkosi/sandbox.py:365:8: error: Non-overlapping identity check (left operand type: "CDLL", right operand type: "None")  [comparison-overlap]
+ mkosi/run.py:245:22: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ mkosi/manifest.py:244:12: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/uuid.py:42: error: Non-overlapping identity check (left operand type: "Callable[..., UUID]", right operand type: "None")  [comparison-overlap]
+ psycopg/psycopg/types/net.py:47: error: Non-overlapping identity check (left operand type: "Callable[[str], IPv4Address | IPv6Address]", right operand type: "None")  [comparison-overlap]
+ psycopg/psycopg/types/hstore.py:131: error: Non-overlapping identity check (left operand type: "Match[str]", right operand type: "None")  [comparison-overlap]
+ tests/test_module.py:44: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ tests/test_module.py:62: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ tests/test_adapt.py:414: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ tests/pq/test_pgresult.py:42: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ tests/test_pipeline_async.py:43: error: Non-overlapping identity check (left operand type: "None", right operand type: "AsyncPipeline")  [comparison-overlap]
+ tests/test_pipeline_async.py:214: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['SELECT 1']")  [comparison-overlap]
+ tests/test_pipeline.py:46: error: Non-overlapping identity check (left operand type: "None", right operand type: "Pipeline")  [comparison-overlap]
+ tests/test_pipeline.py:217: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['SELECT 1']")  [comparison-overlap]
+ tests/test_cursor_server_async.py:414: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_server_async.py:417: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/test_cursor_server_async.py:419: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/test_cursor_server_async.py:421: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[12]")  [comparison-overlap]
+ tests/test_cursor_server_async.py:423: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[42]")  [comparison-overlap]
+ tests/test_cursor_server.py:408: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_server.py:411: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/test_cursor_server.py:413: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/test_cursor_server.py:415: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[12]")  [comparison-overlap]
+ tests/test_cursor_server.py:417: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[42]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:148: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['SELECT 10']")  [comparison-overlap]
+ tests/test_cursor_common_async.py:151: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['CREATE TABLE']")  [comparison-overlap]
+ tests/test_cursor_common_async.py:493: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:496: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:498: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:500: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[12]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:509: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[42]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:536: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_common_async.py:538: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/test_cursor_common.py:149: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['SELECT 10']")  [comparison-overlap]
+ tests/test_cursor_common.py:152: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['CREATE TABLE']")  [comparison-overlap]
+ tests/test_cursor_common.py:488: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_common.py:491: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/test_cursor_common.py:493: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/test_cursor_common.py:495: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[12]")  [comparison-overlap]
+ tests/test_cursor_common.py:504: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[42]")  [comparison-overlap]
+ tests/test_cursor_common.py:531: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[0]")  [comparison-overlap]
+ tests/test_cursor_common.py:533: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pq/test_pgconn.py:121: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/periodic_executor.py:278: error: Non-overlapping identity check (left operand type: "set[ReferenceType[PeriodicExecutor]]", right operand type: "None")  [comparison-overlap]
+ pymongo/pyopenssl_context.py:309: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ pymongo/topology_description.py:124: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/topology_description.py:130: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/topology_description.py:571: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/operations.py:155: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ pymongo/operations.py:371: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ pymongo/operations.py:486: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/server.py:193: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/server.py:253: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/server.py:296: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/pool.py:159: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/pool.py:487: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/pool.py:1436: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/monitor.py:517: error: Non-overlapping identity check (left operand type: "set[ReferenceType[MonitorBase]]", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/mongo_client.py:1305: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/server.py:193: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/server.py:253: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/server.py:296: error: Non-overlapping identity check (left operand type: "_EventListeners", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/pool.py:159: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/pool.py:487: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/pool.py:1440: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/monitor.py:519: error: Non-overlapping identity check (left operand type: "set[ReferenceType[MonitorBase]]", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/mongo_client.py:1305: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/auth_oidc.py:194: error: Non-overlapping identity check (left operand type: "OIDCCallback", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/auth_oidc.py:251: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/auth_oidc.py:194: error: Non-overlapping identity check (left operand type: "OIDCCallback", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/auth_oidc.py:253: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ pymongo/synchronous/encryption.py:397: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ pymongo/asynchronous/encryption.py:400: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ gridfs/synchronous/grid_file.py:305: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ gridfs/asynchronous/grid_file.py:307: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/client_exceptions.py:329:4: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ aiohttp/client_exceptions.py:329:4: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-comparison-overlap for more info
+ aiohttp/helpers.py:136:12: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/helpers.py:139:12: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/helpers.py:272:35: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/helpers.py:276:8: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/http_writer.py:244:20: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ aiohttp/http_writer.py:262:24: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ aiohttp/payload.py:478:43: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/connector.py:176:12: error: Non-overlapping identity check (left operand type: "Callable[[], None]", right operand type: "None")  [comparison-overlap]
+ aiohttp/connector.py:829:8: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ aiohttp/connector.py:1184:12: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ aiohttp/client_ws.py:109:16: error: Non-overlapping identity check (left operand type: "AbstractEventLoop", right operand type: "None")  [comparison-overlap]
+ aiohttp/client_ws.py:267:20: error: Non-overlapping identity check (left operand type: "AbstractEventLoop", right operand type: "None")  [comparison-overlap]
+ aiohttp/client_reqrep.py:183:4: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ aiohttp/client_reqrep.py:289:12: error: Non-overlapping identity check (left operand type: "ClientSession", right operand type: "None")  [comparison-overlap]
+ aiohttp/client_reqrep.py:1424:16: error: Non-overlapping identity check (left operand type: "type[ClientResponse]", right operand type: "None")  [comparison-overlap]
+ aiohttp/client_middleware_digest_auth.py:187:12: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/client_middleware_digest_auth.py:190:12: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ aiohttp/client.py:841:16: error: Non-overlapping identity check (left operand type: "bool | Callable[[ClientResponse], Awaitable[None]]", right operand type: "None")  [comparison-overlap]
+ aiohttp/web_fileresponse.py:337:16: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ aiohttp/web_runner.py:263:20: error: Non-overlapping identity check (left operand type: "tuple[socket, ...]", right operand type: "None")  [comparison-overlap]
+ aiohttp/worker.py:103:16: error: Non-overlapping identity check (left operand type: "AppRunner", right operand type: "None")  [comparison-overlap]
+ aiohttp/worker.py:139:16: error: Non-overlapping identity check (left operand type: "AbstractEventLoop", right operand type: "None")  [comparison-overlap]
+ aiohttp/worker.py:211:12: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ aiohttp/test_utils.py:151:16: error: Non-overlapping identity check (left operand type: "tuple[socket, ...]", right operand type: "None")  [comparison-overlap]

anyio (https://github.com/agronholm/anyio)
+ src/anyio/_backends/_trio.py:903: error: Non-overlapping identity check (left operand type: "MemoryObjectSendStream[Any]", right operand type: "None")  [comparison-overlap]

parso (https://github.com/davidhalter/parso)
+ parso/grammar.py:113: error: Non-overlapping identity check (left operand type: "Path | PathLike[Any]", right operand type: "None")  [comparison-overlap]

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/core/failures.py: note: In function "format_failures":
+ src/schemathesis/core/failures.py:301: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/specs/graphql/validation.py: note: In function "validate_graphql_response":
+ src/schemathesis/specs/graphql/validation.py:24: error: Non-overlapping identity check (left operand type: "list[Any]", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/schemas.py: note: In member "__post_init__" of class "APIOperation":
+ src/schemathesis/schemas.py:640: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/pytest/plugin.py: note: In member "_gen_items" of class "SchemathesisCase":
+ src/schemathesis/pytest/plugin.py:147: error: Non-overlapping identity check (left operand type: "Override", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/generation/hypothesis/builder.py: note: In function "generate_example_cases":
+ src/schemathesis/generation/hypothesis/builder.py:298: error: Non-overlapping identity check (left operand type: "CaseInsensitiveDict[Any]", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/specs/openapi/expressions/__init__.py: note: In function "evaluate":
+ src/schemathesis/specs/openapi/expressions/__init__.py:31: error: Non-overlapping identity check (left operand type: "Union[str, Unresolvable]", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/cli/commands/run/handlers/output.py: note: In member "display_stateful_failures" of class "OutputHandler":
+ src/schemathesis/cli/commands/run/handlers/output.py:1304: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/cli/commands/run/handlers/output.py: note: In member "display_seed" of class "OutputHandler":
+ src/schemathesis/cli/commands/run/handlers/output.py:1483: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/cli/commands/run/handlers/cassettes.py: note: In function "vcr_writer":
+ src/schemathesis/cli/commands/run/handlers/cassettes.py:196: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/cli/commands/run/handlers/cassettes.py: note: In function "har_writer":
+ src/schemathesis/cli/commands/run/handlers/cassettes.py:398: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ src/schemathesis/cli/commands/run/handlers/cassettes.py:401: error: Non-overlapping identity check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]

core (https://github.com/home-assistant/core)
+ homeassistant/util/package.py:81: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/conversation/trace.py:73: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/core.py:588: error: Non-overlapping identity check (left operand type: "Callable[[VarArg(*_Ts)], Any] | Coroutine[Any, Any, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/core.py:655: error: Non-overlapping identity check (left operand type: "Callable[[VarArg(*_Ts)], Coroutine[Any, Any, _R] | _R] | Coroutine[Any, Any, _R]", right operand type: "None")  [comparison-overlap]
+ homeassistant/loader.py:313: error: Non-overlapping identity check (left operand type: "Integration", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/backup/util.py:647: error: Non-overlapping identity check (left operand type: "Future[None]", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity_registry.py:393: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/area_registry.py:435: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/event.py:1045: error: Non-overlapping identity check (left operand type: "str | TemplateError", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/config_validation.py:387: error: Non-overlapping identity check (left operand type: "str | list[Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/core_config.py:650: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:658: error: Non-overlapping identity check (left operand type: "PlatformData", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:952: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:955: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:986: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:991: error: Non-overlapping identity check (left operand type: "EntityPlatform", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:991: note: Error code "comparison-overlap" not covered by "type: ignore" comment
+ homeassistant/helpers/entity.py:1005: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity.py:1299: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/websocket_api/connection.py:127: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/restore_state.py:289: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/restore_state.py:289: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/websocket_api/decorators.py:66: error: Non-overlapping identity check (left operand type: "User", right operand type: "None")  [comparison-overlap]
+ homeassistant/config_entries.py:1892: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/config_entries.py:3555: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/config_entries.py:3621: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/config_entries.py:3638: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/discovery.py:163: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/trigger.py:514: error: Non-overlapping identity check (left operand type: "Callable[[], None]", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity_platform.py:794: error: Non-overlapping identity check (left operand type: "Entity", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity_platform.py:932: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/helpers/entity_platform.py:940: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/http/__init__.py:252: error: Non-overlapping identity check (left operand type: "ConfData", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/http/__init__.py:262: error: Non-overlapping identity check (left operand type: "list[str]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/event/__init__.py:194: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/wake_word/__init__.py:127: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/stt/__init__.py:206: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/scene/__init__.py:126: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/matter/select.py:184: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/device_automation/__init__.py:275: error: Non-overlapping identity check (left operand type: "list[dict[str, Any]] | Exception", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/number/__init__.py:483: error: Non-overlapping identity check (left operand type: "float", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/matter/update.py:114: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/matter/sensor.py:535: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/device_tracker/legacy.py:580: error: Non-overlapping identity check (left operand type: "bool", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/matter/discovery.py:108: error: Non-overlapping identity check (left operand type: "tuple[type[Any], ...]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/alexa/auth.py:170: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/alexa/auth.py:172: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/alexa/auth.py:174: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/recorder/purge.py:647: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/recorder/purge.py:659: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/blueprint/websocket_api.py:116: error: Non-overlapping identity check (left operand type: "ImportedBlueprint", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/alexa/intent.py:77: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/intent/__init__.py:622: error: Non-overlapping identity check (left operand type: "IntentResponse", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/camera/__init__.py:210: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/camera/__init__.py:211: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/camera/__init__.py:313: error: Non-overlapping equality check (left operand type: "bytes", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/recorder/core.py:1133: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/calendar/__init__.py:456: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/tts/entity.py:122: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/hassio/__init__.py:411: error: Non-overlapping equality check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/conversation/entity.py:43: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/alexa/smart_home.py:172: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/cloud/prefs.py:387: error: Non-overlapping identity check (left operand type: "User", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/assist_pipeline/pipeline.py:1638: error: Non-overlapping identity check (left operand type: "AsyncIterable[EnhancedAudioChunk]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/cloud/client.py:233: error: Non-overlapping identity check (left operand type: "set[str]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/ai_task/entity.py:50: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/cloud/http_api.py:367: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/cloud/http_api.py:369: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/cloud/http_api.py:371: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/tod/binary_sensor.py:68: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/tod/binary_sensor.py:91: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/telegram_bot/bot.py:390: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/telegram_bot/bot.py:932: error: Non-overlapping identity check (left operand type: "SSLContext", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/squeezebox/browse_media.py:350: error: Non-overlapping identity check (left operand type: "MediaClass | str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/squeezebox/browse_media.py:363: error: Non-overlapping identity check (left operand type: "list[BrowseMedia]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/squeezebox/browse_media.py:373: error: Non-overlapping identity check (left operand type: "MediaClass | str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/squeezebox/browse_media.py:413: error: Non-overlapping identity check (left operand type: "MediaClass | str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/slide_local/coordinator.py:96: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/sense/config_flow.py:150: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/peco/config_flow.py:81: error: Non-overlapping identity check (left operand type: "dict[str, str]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/lutron_caseta/config_flow.py:77: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/livisi/coordinator.py:101: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/izone/climate.py:260: error: Non-overlapping identity check (left operand type: "HomeAssistant", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/iotty/api.py:29: error: Non-overlapping identity check (left operand type: "OAuth2Session", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/husqvarna_automower_ble/coordinator.py:86: error: Non-overlapping identity check (left operand type: "str | int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/husqvarna_automower_ble/coordinator.py:92: error: Non-overlapping identity check (left operand type: "str | int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/husqvarna_automower_ble/coordinator.py:98: error: Non-overlapping identity check (left operand type: "str | int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/elvia/importer.py:91: error: Non-overlapping identity check (left operand type: "list[Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/elvia/importer.py:109: error: Non-overlapping identity check (left operand type: "list[Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/demo/water_heater.py:64: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/demo/water_heater.py:66: error: Non-overlapping identity check (left operand type: "bool", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/demo/water_heater.py:68: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/config/auth_provider_homeassistant.py:112: error: Non-overlapping identity check (left operand type: "User", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/bluetooth/config_flow.py:112: error: Non-overlapping identity check (left operand type: "dict[str, str]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/bluetooth/config_flow.py:133: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/awair/config_flow.py:93: error: Non-overlapping identity check (left operand type: "Mapping[str, Any]", right operand type: "None")  [comparison-overlap]
+ homeassistant/components/aprilaire/coordinator.py:193: error: Non-overlapping identity check (left operand type: "dict[str, Any]", right operand type: "None")  [comparison-overlap]

... (truncated 170 lines) ...

starlette (https://github.com/encode/starlette)
+ starlette/schemas.py:21: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ starlette/schemas.py:105: error: Non-overlapping identity check (left operand type: Module, right operand type: "None")  [comparison-overlap]
+ tests/test_websockets.py:409: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['wamp']")  [comparison-overlap]
+ tests/test_websockets.py:420: error: Non-overlapping equality check (left operand type: "None", right operand type: "list[tuple[bytes, bytes]]")  [comparison-overlap]
+ tests/test_websockets.py:431: error: Non-overlapping equality check (left operand type: "None", right operand type: "list[Never]")  [comparison-overlap]
+ tests/test_routing.py:1131: error: Non-overlapping equality check (left operand type: "None", right operand type: "list[tuple[bytes, bytes]]")  [comparison-overlap]
+ tests/test_endpoints.py:58: error: Non-overlapping equality check (left operand type: "None", right operand type: "Literal['wamp']")  [comparison-overlap]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/checks.py:528: error: Non-overlapping identity check (left operand type: "Permissions", right operand type: "None")  [comparison-overlap]

mypy (https://github.com/python/mypy)
+ mypy/nodes.py:870: error: Non-overlapping identity check (left operand type: "Argument", right operand type: "None")  [comparison-overlap]
+ mypy/nodes.py:3665: error: Non-overlapping identity check (left operand type: "TypeInfo", right operand type: "None")  [comparison-overlap]
+ mypy/nodes.py:3696: error: Non-overlapping identity check (left operand type: "TypeInfo", right operand type: "None")  [comparison-overlap]
+ mypy/nodes.py:4520: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/nodes.py:4520: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-comparison-overlap for more info
+ mypy/nodes.py:4569: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/nodes.py:4583: error: Non-overlapping identity check (left operand type: "SymbolNode", right operand type: "None")  [comparison-overlap]
+ mypy/types.py:668: error: Non-overlapping identity check (left operand type: "list[Type]", right operand type: "None")  [comparison-overlap]
+ mypy/types.py:1672: error: Non-overlapping identity check (left operand type: "TypeInfo", right operand type: "None")  [comparison-overlap]
+ mypyc/ir/ops.py:663: error: Non-overlapping identity check (left operand type: "FuncSignature", right operand type: "None")  [comparison-overlap]
+ mypyc/ir/func_ir.py:194: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ mypy/traverser.py:126: error: Non-overlapping identity check (left operand type: "list[Argument]", right operand type: "None")  [comparison-overlap]
+ mypy/traverser.py:195: error: Non-overlapping identity check (left operand type: "Expression", right operand type: "None")  [comparison-overlap]
+ mypy/traverser.py:201: error: Non-overlapping identity check (left operand type: "Expression", right operand type: "None")  [comparison-overlap]
+ mypy/mro.py:40: error: Non-overlapping identity check (left operand type: "TypeInfo", right operand type: "None")  [comparison-overlap]
+ mypy/fixup.py:280: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/fixup.py:282: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/fixup.py:361: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/test/visitors.py:62: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/fastparse.py:1310: error: Non-overlapping identity check (left operand type: "ProperType", right operand type: "None")  [comparison-overlap]
+ mypy/fastparse.py:1448: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ mypy/fastparse.py:1524: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/fastparse.py:2006: error: Non-overlapping identity check (left operand type: "ProperType", right operand type: "None")  [comparison-overlap]
+ mypy/fastparse.py:2030: error: Non-overlapping identity check (left operand type: "ProperType", right operand type: "None")  [comparison-overlap]
+ mypy/argmap.py:246: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/constraints.py:133: error: Non-overlapping identity check (left operand type: "int", right operand type: "None")  [comparison-overlap]
+ mypy/constraints.py:133: note: Error code "comparison-overlap" not covered by "type: ignore" comment
+ mypy/messages.py:2775: error: Non-overlapping identity check (left operand type: "ProperType", right operand type: "None")  [comparison-overlap]
+ mypyc/analysis/ircheck.py:313: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/semanal_typeargs.py:105: error: Non-overlapping identity check (left operand type: "TypeAlias", right operand type: "None")  [comparison-overlap]
+ mypy/plugins/enums.py:228: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/checkpattern.py:672: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypyc/codegen/emitclass.py:324: error: Non-overlapping identity check (left operand type: "FuncDecl", right operand type: "None")  [comparison-overlap]
+ mypy/typeanal.py:1628: error: Non-overlapping identity check (left operand type: "str", right operand type: "None")  [comparison-overlap]
+ mypy/checkstrformat.py:347: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]
+ mypy/checkstrformat.py:935: error: Non-overlapping identity check (left operand type: "Type", right operand type: "None")  [comparison-overlap]

... (truncated 471 lines) ...```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flag None check on value that cannot be None
1 participant