-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add warn-unreachable to strict mode #19047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add warn-unreachable to strict mode #19047
Conversation
This is useful check for dead code analysis
…that is no longer true
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: packaging (https://github.com/pypa/packaging)
+ src/packaging/version.py:80: error: Statement is unreachable [unreachable]
+ src/packaging/version.py:86: error: Statement is unreachable [unreachable]
+ src/packaging/version.py:98: error: Statement is unreachable [unreachable]
+ src/packaging/version.py:104: error: Statement is unreachable [unreachable]
+ src/packaging/_manylinux.py:143: error: Statement is unreachable [unreachable]
+ src/packaging/specifiers.py:805: error: Statement is unreachable [unreachable]
+ src/packaging/markers.py:345: error: Statement is unreachable [unreachable]
+ src/packaging/metadata.py:347: error: Subclass of "str" and "Header" cannot exist: would have incompatible method signatures [unreachable]
+ src/packaging/metadata.py:351: error: Statement is unreachable [unreachable]
psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/pq/__init__.py:95: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/_conninfo_attempts_async.py:104: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/sql.py:88: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/sql.py:96: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/sql.py:150: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:39: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:56: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:308: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:372: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:448: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:459: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:470: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection_async.py:481: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/connection.py:352: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/types/uuid.py:43: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/types/net.py:48: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/types/net.py:181: error: Statement is unreachable [unreachable]
+ psycopg/psycopg/types/multirange.py:335: error: Statement is unreachable [unreachable]
+ tests/test_psycopg_dbapi20.py:143: error: Statement is unreachable [unreachable]
+ tests/test_cursor_async.py:44: error: Statement is unreachable [unreachable]
+ tests/test_cursor.py:45: error: Statement is unreachable [unreachable]
+ tests/pq/test_pgconn.py:43: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:139: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:505: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:506: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:553: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:577: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:580: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:595: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:610: error: Statement is unreachable [unreachable]
+ tests/test_transaction_async.py:615: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:139: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:498: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:499: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:546: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:570: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:573: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:588: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:603: error: Statement is unreachable [unreachable]
+ tests/test_transaction.py:608: error: Statement is unreachable [unreachable]
+ tests/test_pipeline_async.py:44: error: Statement is unreachable [unreachable]
+ tests/test_pipeline_async.py:45: error: Statement is unreachable [unreachable]
+ tests/test_pipeline_async.py:464: error: Statement is unreachable [unreachable]
+ tests/test_pipeline_async.py:467: error: Statement is unreachable [unreachable]
+ tests/test_pipeline.py:47: error: Statement is unreachable [unreachable]
+ tests/test_pipeline.py:48: error: Statement is unreachable [unreachable]
+ tests/test_pipeline.py:465: error: Statement is unreachable [unreachable]
+ tests/test_pipeline.py:468: error: Statement is unreachable [unreachable]
+ tests/test_cursor_server_async.py:104: error: Statement is unreachable [unreachable]
+ tests/test_cursor_server.py:102: error: Statement is unreachable [unreachable]
+ tests/test_cursor_raw_async.py:49: error: Statement is unreachable [unreachable]
+ tests/test_cursor_raw.py:52: error: Statement is unreachable [unreachable]
+ tests/test_copy_async.py:684: error: Statement is unreachable [unreachable]
+ tests/test_copy.py:670: error: Statement is unreachable [unreachable]
+ tests/test_connection_async.py:365: error: Statement is unreachable [unreachable]
+ tests/test_connection_async.py:457: error: Statement is unreachable [unreachable]
+ tests/test_connection.py:368: error: Statement is unreachable [unreachable]
+ tests/test_connection.py:460: error: Statement is unreachable [unreachable]
+ tests/pool/test_sched_async.py:153: error: Statement is unreachable [unreachable]
+ tests/crdb/test_connection_async.py:26: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool_async.py:109: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool_async.py:132: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool_async.py:588: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool_async.py:607: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool_async.py:784: error: Statement is unreachable [unreachable]
+ psycopg_pool/psycopg_pool/pool.py:728: error: Statement is unreachable [unreachable]
+ tests/test_cursor_common_async.py:504: error: Statement is unreachable [unreachable]
+ tests/test_cursor_common.py:499: error: Statement is unreachable [unreachable]
+ tests/test_cursor_client_async.py:57: error: Statement is unreachable [unreachable]
+ tests/test_cursor_client.py:58: error: Statement is unreachable [unreachable]
+ tests/types/test_enum.py:87: error: Statement is unreachable [unreachable]
+ tests/pool/test_pool_common_async.py:71: error: Statement is unreachable [unreachable]
starlette (https://github.com/encode/starlette)
+ starlette/responses.py:130: error: Statement is unreachable [unreachable]
+ tests/test_staticfiles.py:164: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:650: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:652: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:692: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:722: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:724: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:791: error: Statement is unreachable [unreachable]
+ tests/test_routing.py:795: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:377: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:378: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:399: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:400: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:430: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:431: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:452: error: Statement is unreachable [unreachable]
+ tests/test_applications.py:453: error: Statement is unreachable [unreachable]
pyp (https://github.com/hauntsaninja/pyp)
+ pyp.py:607: error: Statement is unreachable [unreachable]
pylint (https://github.com/pycqa/pylint)
+ pylint/pyreverse/dot_printer.py:159: error: Statement is unreachable [unreachable]
+ pylint/checkers/base_checker.py:196: error: Statement is unreachable [unreachable]
+ pylint/checkers/symilar.py:832: error: Statement is unreachable [unreachable]
+ pylint/lint/run.py:222: error: Statement is unreachable [unreachable]
+ pylint/lint/run.py:231: error: Statement is unreachable [unreachable]
+ pylint/checkers/logging.py:351: error: Subclass of "str" and "int" cannot exist: would have incompatible method signatures [unreachable]
+ pylint/checkers/imports.py:629: error: Statement is unreachable [unreachable]
+ pylint/checkers/imports.py:658: error: Statement is unreachable [unreachable]
+ pylint/checkers/imports.py:705: error: Statement is unreachable [unreachable]
mypy (https://github.com/python/mypy)
+ mypyc/ir/pprint.py:231: error: Statement is unreachable [unreachable]
+ mypyc/ir/pprint.py:231: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-unreachable for more info
poetry (https://github.com/python-poetry/poetry)
+ src/poetry/utils/_compat.py:39: error: Subclass of "str" and "bytes" cannot exist: would have incompatible method signatures [unreachable]
+ src/poetry/utils/_compat.py:40: error: Statement is unreachable [unreachable]
+ src/poetry/pyproject/toml.py:49: error: Statement is unreachable [unreachable]
+ tests/utils/test_threading.py:73: error: Statement is unreachable [unreachable]
+ src/poetry/utils/helpers.py:298: error: Statement is unreachable [unreachable]
+ src/poetry/utils/helpers.py:321: error: Statement is unreachable [unreachable]
+ src/poetry/config/source.py:23: error: Subclass of "Priority" and "str" cannot exist: would have incompatible method signatures [unreachable]
+ src/poetry/config/source.py:24: error: Statement is unreachable [unreachable]
+ src/poetry/utils/env/env_manager.py:196: error: Right operand of "and" is never evaluated [unreachable]
+ src/poetry/utils/env/env_manager.py:197: error: Statement is unreachable [unreachable]
+ src/poetry/utils/env/env_manager.py:377: error: Right operand of "and" is never evaluated [unreachable]
+ src/poetry/utils/env/env_manager.py:378: error: Statement is unreachable [unreachable]
+ src/poetry/installation/executor.py:819: error: Statement is unreachable [unreachable]
+ tests/repositories/test_http_repository.py:142: error: Statement is unreachable [unreachable]
+ src/poetry/console/commands/remove.py:70: error: Statement is unreachable [unreachable]
+ tests/console/commands/test_install.py:156: error: Statement is unreachable [unreachable]
+ tests/utils/env/test_env_manager.py:120: error: Statement is unreachable [unreachable]
+ tests/installation/test_installer.py:75: error: Statement is unreachable [unreachable]
+ tests/console/commands/test_build.py:185: error: Statement is unreachable [unreachable]
+ src/poetry/console/commands/add.py:318: error: Subclass of "dict[str, Any]" and "str" cannot exist: would have incompatible method signatures [unreachable]
bidict (https://github.com/jab/bidict)
+ bidict/_base.py: note: In member "__or__" of class "BidictBase":
+ bidict/_base.py:508:13: error: Statement is unreachable [unreachable]
+ bidict/_base.py: note: In member "__ror__" of class "BidictBase":
+ bidict/_base.py:516:13: error: Statement is unreachable [unreachable]
anyio (https://github.com/agronholm/anyio)
+ src/anyio/_core/_contextmanagers.py:51: error: Statement is unreachable [unreachable]
+ src/anyio/_core/_contextmanagers.py:137: error: Statement is unreachable [unreachable]
+ src/anyio/to_interpreter.py:172: error: Statement is unreachable [unreachable]
antidote (https://github.com/Finistere/antidote)
+ src/antidote/_internal/typing.py:50: error: Subclass of "type" and "_SpecialForm" cannot exist: would have incompatible method signatures [unreachable]
+ src/antidote/_internal/typing.py:50: error: Right operand of "and" is never evaluated [unreachable]
+ src/antidote/lib/interface_ext/_provider.py:259: error: Statement is unreachable [unreachable]
+ tests/lib/injectable/test_injectable.py:120: error: Statement is unreachable [unreachable]
+ tests/core/test_provider.py:92: error: Statement is unreachable [unreachable]
+ tests/core/test_inject_wrapper.py:426: error: Statement is unreachable [unreachable]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/decimal128.py:226: error: Statement is unreachable [unreachable]
+ bson/binary.py:545: error: Statement is unreachable [unreachable]
+ pymongo/_asyncio_task.py:49: error: Statement is unreachable [unreachable]
+ pymongo/periodic_executor.py:276: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:129: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:145: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:164: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:189: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:494: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:506: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:573: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:724: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/topology.py:934: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/pool.py:213: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/monitor.py:517: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1208: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1231: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1279: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1587: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1611: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1626: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1638: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:1698: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/mongo_client.py:2611: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/database.py:129: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/collection.py:239: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/client_session.py:881: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/client_session.py:1057: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/bulk.py:492: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/bulk.py:629: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:129: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:145: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:164: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:189: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:494: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:506: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:573: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:726: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/topology.py:936: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/pool.py:213: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/monitor.py:519: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1210: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1233: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1281: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1593: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1617: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1632: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1644: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:1704: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/mongo_client.py:2625: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/database.py:129: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/collection.py:236: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/client_session.py:886: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/client_session.py:1062: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/bulk.py:492: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/bulk.py:631: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/encryption.py:406: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/encryption.py:409: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/encryption.py:658: error: Statement is unreachable [unreachable]
+ pymongo/synchronous/encryption.py:755: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/encryption.py:409: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/encryption.py:412: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/encryption.py:661: error: Statement is unreachable [unreachable]
+ pymongo/asynchronous/encryption.py:762: error: Statement is unreachable [unreachable]
pywin32 (https://github.com/mhammond/pywin32)
+ setup.py:919:13: error: Statement is unreachable [unreachable]
+ com/win32comext/mapi/__init__.py:1:15: error: Subclass of "List[str]" and "str" cannot exist: would have incompatible method signatures [unreachable]
+ com/win32comext/mapi/__init__.py:3:5: error: Statement is unreachable [unreachable]
+ com/win32comext/adsi/__init__.py:4:15: error: Subclass of "List[str]" and "str" cannot exist: would have incompatible method signatures [unreachable]
+ com/win32comext/adsi/__init__.py:6:5: error: Statement is unreachable [unreachable]
+ com/win32comext/axscript/client/error.py:101:13: error: Statement is unreachable [unreachable]
+ com/win32comext/axscript/client/framework.py:1120:13: error: Statement is unreachable [unreachable]
build (https://github.com/pypa/build)
+ src/build/__main__.py:195: error: Statement is unreachable [unreachable]
isort (https://github.com/pycqa/isort)
+ isort/settings.py:754: error: Subclass of "str" and "list[Any]" cannot exist: would have incompatible method signatures [unreachable]
+ isort/settings.py:755: error: Statement is unreachable [unreachable]
nionutils (https://github.com/nion-software/nionutils)
+ nion/utils/Event.py:39: error: Statement is unreachable [unreachable]
+ nion/utils/Selection.py:124: error: Subclass of "int" and "Integral" cannot exist: would have incompatible method signatures [unreachable]
+ nion/utils/Selection.py:125: error: Statement is unreachable [unreachable]
+ nion/utils/Selection.py:138: error: Subclass of "int" and "Integral" cannot exist: would have incompatible method signatures [unreachable]
+ nion/utils/Selection.py:139: error: Statement is unreachable [unreachable]
+ nion/utils/Selection.py:169: error: Subclass of "int" and "Integral" cannot exist: would have incompatible method signatures [unreachable]
+ nion/utils/Selection.py:170: error: Statement is unreachable [unreachable]
+ nion/utils/Selection.py:181: error: Subclass of "int" and "Integral" cannot exist: would have incompatible method signatures [unreachable]
+ nion/utils/Selection.py:182: error: Statement is unreachable [unreachable]
+ nion/utils/Selection.py:188: error: Subclass of "int" and "Integral" cannot exist: would have incompatible method signatures [unreachable]
+ nion/utils/Selection.py:189: error: Statement is unreachable [unreachable]
+ nion/utils/ListModel.py:607: error: Statement is unreachable [unreachable]
+ nion/utils/ListModel.py:771: error: Statement is unreachable [unreachable]
+ nion/utils/ListModel.py:780: error: Statement is unreachable [unreachable]
+ nion/utils/ListModel.py:881: error: Statement is unreachable [unreachable]
+ nion/utils/ListModel.py:888: error: Statement is unreachable [unreachable]
pyjwt (https://github.com/jpadilla/pyjwt)
+ jwt/jwk_set_cache.py:17: error: Statement is unreachable [unreachable]
artigraph (https://github.com/artigraph/artigraph)
+ src/arti/internal/type_hints.py:50: error: Subclass of "type" and "TypeVar" cannot exist: "TypeVar" is final [unreachable]
+ src/arti/internal/type_hints.py:51: error: Statement is unreachable [unreachable]
+ src/arti/internal/type_hints.py:58: error: Statement is unreachable [unreachable]
+ src/arti/types/python.py:68: error: Subclass of "Type" and "_ContainerMixin" cannot exist: would have incompatible method signatures [unreachable]
+ src/arti/types/python.py:69: error: Statement is unreachable [unreachable]
+ src/arti/views/__init__.py:71: error: Statement is unreachable [unreachable]
+ src/arti/views/__init__.py:78: error: Statement is unreachable [unreachable]
+ src/arti/views/__init__.py:95: error: Statement is unreachable [unreachable]
+ src/arti/types/pydantic.py:25: error: Subclass of "Type" and "_NamedMixin" cannot exist: would have incompatible method signatures [unreachable]
+ src/arti/types/pydantic.py:26: error: Statement is unreachable [unreachable]
+ src/arti/types/pyarrow.py:291: error: Subclass of "Type" and "_TimeMixin" cannot exist: would have incompatible method signatures [unreachable]
+ src/arti/types/pyarrow.py:292: error: Statement is unreachable [unreachable]
+ src/arti/types/bigquery.py:100: error: Subclass of "Type" and "_TimeMixin" cannot exist: would have incompatible method signatures [unreachable]
+ src/arti/types/bigquery.py:101: error: Statement is unreachable [unreachable]
+ tests/arti/internal/test_utils.py:158: error: Statement is unreachable [unreachable]
websockets (https://github.com/aaugustin/websockets)
+ src/websockets/legacy/protocol.py:321: error: Statement is unreachable [unreachable]
+ src/websockets/legacy/protocol.py:1077: error: Argument 1 to "join" of "str" has incompatible type "list[str | bytes]"; expected "Iterable[str]" [arg-type]
+ src/websockets/legacy/protocol.py:1077: error: Argument 1 to "join" of "bytes" has incompatible type "list[str | bytes]"; expected "Iterable[Buffer]" [arg-type]
+ src/websockets/legacy/server.py:366: error: Statement is unreachable [unreachable]
+ src/websockets/legacy/server.py:591: error: Statement is unreachable [unreachable]
cki-lib (https://gitlab.com/cki-project/cki-lib)
+ cki_lib/logger.py:88: error: Statement is unreachable [unreachable]
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/requests.py: note: In member "request" of class "_Session":
+ sphinx/util/requests.py:103:13: error: Statement is unreachable [unreachable]
+ sphinx/util/typing.py: note: In function "restify":
+ sphinx/util/typing.py:297:13: error: Statement is unreachable [unreachable]
+ sphinx/util/typing.py:323:48: error: Subclass of "type" and "<typing special form>" cannot exist: "_SpecialForm" is final [unreachable]
+ sphinx/util/typing.py:323:48: error: Subclass of "TypeAliasType" and "<typing special form>" cannot exist: "TypeAliasType" is final [unreachable]
+ sphinx/util/typing.py:323:48: error: Subclass of "TypeAliasType" and "<typing special form>" cannot exist: "_SpecialForm" is final [unreachable]
+ sphinx/util/typing.py: note: In function "stringify_annotation":
+ sphinx/util/typing.py:591:13: error: Statement is unreachable [unreachable]
+ sphinx/util/osutil.py: note: In function "_relative_path":
+ sphinx/util/osutil.py:191:5: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py: note: In function "apply_source_workaround":
+ sphinx/util/nodes.py:149:9: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py:156:9: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py:175:9: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py:185:9: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py: note: In function "_deepcopy":
+ sphinx/util/nodes.py:746:17: error: Statement is unreachable [unreachable]
+ sphinx/util/nodes.py:748:17: error: Statement is unreachable [unreachable]
+ sphinx/pycode/parser.py: note: In member "visit_Expr" of class "VariableCommentPicker":
+ sphinx/pycode/parser.py:442:25: error: Statement is unreachable [unreachable]
+ sphinx/directives/__init__.py: note: In function "optional_int":
+ sphinx/directives/__init__.py:35:9: error: Statement is unreachable [unreachable]
+ sphinx/directives/__init__.py:338:13: error: Statement is unreachable [unreachable]
+ sphinx/domains/python/_object.py: note: In member "handle_signature" of class "PyObject":
+ sphinx/domains/python/_object.py:317:21: error: Subclass of "Sequence[Node]" and "str" cannot exist: would have inconsistent method resolution order [unreachable]
+ sphinx/domains/python/_object.py:318:17: error: Statement is unreachable [unreachable]
+ sphinx/highlighting.py: note: In member "highlight_block" of class "PygmentsBridge":
+ sphinx/highlighting.py:193:13: error: Statement is unreachable [unreachable]
+ sphinx/config.py: note: In member "add" of class "Config":
+ sphinx/config.py:528:13: error: Statement is unreachable [unreachable]
+ sphinx/config.py: note: In member "filter" of class "Config":
+ sphinx/config.py:535:23: error: Subclass of "AbstractSet[Literal['', 'env', 'epub', 'gettext', 'html', 'applehelp', 'devhelp']]" and "str" cannot exist: would have incompatible method signatures [unreachable]
+ sphinx/config.py:536:13: error: Statement is unreachable [unreachable]
+ sphinx/config.py: note: In member "__getstate__" of class "Config":
+ sphinx/config.py:550:16: error: Right operand of "and" is never evaluated [unreachable]
+ sphinx/config.py:550:57: error: Subclass of "_Opt" and "tuple[Any, ...]" cannot exist: would have incompatible method signatures [unreachable]
+ sphinx/config.py:552:17: error: Statement is unreachable [unreachable]
+ sphinx/config.py: note: At top level:
+ sphinx/util/rst.py:73:13: error: Statement is unreachable [unreachable]
+ sphinx/domains/std/__init__.py: note: In member "process_doc" of class "StandardDomain":
+ sphinx/domains/std/__init__.py:944:17: error: Statement is unreachable [unreachable]
+ sphinx/theming.py: note: In function "_validate_theme_toml":
+ sphinx/theming.py:335:9: error: Statement is unreachable [unreachable]
+ sphinx/theming.py:339:9: error: Statement is unreachable [unreachable]
+ sphinx/theming.py:347:13: error: Statement is unreachable [unreachable]
+ sphinx/theming.py: note: In function "_convert_theme_toml":
+ sphinx/theming.py:364:9: error: Statement is unreachable [unreachable]
+ sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py:95:13: error: Statement is unreachable [unreachable]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "GlossarySorter":
+ sphinx/transforms/__init__.py:429:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
+ sphinx/transforms/__init__.py: note: In function "apply":
+ sphinx/transforms/__init__.py:429:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "GlossarySorter":
+ sphinx/transforms/__init__.py:429:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
+ sphinx/transforms/__init__.py: note: In function "apply":
+ sphinx/transforms/__init__.py:429:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
+ sphinx/transforms/__init__.py: note: In function "_reorder_index_target_nodes":
+ sphinx/transforms/__init__.py:483:9: error: Statement is unreachable [unreachable]
+ sphinx/ext/autodoc/__init__.py: note: In function "_get_signature":
+ sphinx/ext/autodoc/__init__.py:1726:38: error: Subclass of "str" and "MethodType" cannot exist: "MethodType" is final [unreachable]
+ sphinx/ext/autodoc/__init__.py:1726:66: error: Subclass of "str" and "FunctionType" cannot exist: "FunctionType" is final [unreachable]
+ sphinx/ext/autodoc/__init__.py:1728:13: error: Statement is unreachable [unreachable]
+ sphinx/ext/autodoc/__init__.py: note: In member "format_signature" of class "MethodDocumenter":
+ sphinx/ext/autodoc/__init__.py:2517:25: error: Statement is unreachable [unreachable]
+ sphinx/ext/autodoc/__init__.py: note: In member "import_object" of class "PropertyDocumenter":
+ sphinx/ext/autodoc/__init__.py:3076:17: error: Statement is unreachable [unreachable]
+ sphinx/environment/adapters/toctree.py: note: In function "_toctree_url_entry":
+ sphinx/environment/adapters/toctree.py:377:9: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_ast.py: note: In member "describe_signature" of class "ASTNestedName":
+ sphinx/domains/cpp/_ast.py:290:17: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_ast.py:295:21: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_ast.py:300:21: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_ast.py: note: In member "get_ptr_suffix_id" of class "ASTDeclaratorMemPtr":
+ sphinx/domains/cpp/_ast.py:3133:9: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_ast.py: note: In member "get_ptr_suffix_id" of class "ASTDeclaratorParen":
+ sphinx/domains/cpp/_ast.py:3230:13: error: Statement is unreachable [unreachable]
+ sphinx/domains/c/_ast.py: note: In member "describe_signature" of class "ASTNestedName":
+ sphinx/domains/c/_ast.py:166:17: error: Statement is unreachable [unreachable]
+ sphinx/domains/c/_ast.py:171:21: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/_parser.py: note: In member "_parse_type" of class "DefinitionParser":
+ sphinx/domains/cpp/_parser.py:1699:25: error: Statement is unreachable [unreachable]
+ sphinx/domains/c/_parser.py: note: In member "_parse_initializer" of class "DefinitionParser":
+ sphinx/domains/c/_parser.py:875:13: error: Statement is unreachable [unreachable]
+ sphinx/domains/c/_parser.py: note: In member "_parse_type" of class "DefinitionParser":
+ sphinx/domains/c/_parser.py:944:25: error: Statement is unreachable [unreachable]
+ sphinx/domains/cpp/__init__.py: note: In member "add_target_and_index" of class "CPPObject":
+ sphinx/domains/cpp/__init__.py:242:13: error: Statement is unreachable [unreachable]
+ sphinx/environment/__init__.py: note: In member "setup" of class "BuildEnvironment":
+ sphinx/environment/__init__.py:270:13: error: Statement is unreachable [unreachable]
+ sphinx/registry.py: note: In member "preload_builder" of class "SphinxComponentRegistry":
+ sphinx/registry.py:178:13: error: Statement is unreachable [unreachable]
+ sphinx/registry.py: note: In member "load_extension" of class "SphinxComponentRegistry":
+ sphinx/registry.py:573:17: error: Statement is unreachable [unreachable]
+ sphinx/registry.py:575:17: error: Statement is unreachable [unreachable]
+ sphinx/application.py: note: In member "create_builder" of class "Sphinx":
+ sphinx/application.py:407:13: error: Statement is unreachable [unreachable]
+ sphinx/jinja2glue.py: note: In function "_tobool":
+ sphinx/jinja2glue.py:37:5: error: Statement is unreachable [unreachable]
+ sphinx/jinja2glue.py: note: In function "_todim":
+ sphinx/jinja2glue.py:58:9: error: Statement is unreachable [unreachable]
+ sphinx/writers/latex.py: note: In function "visit_enumerated_list":
+ sphinx/writers/latex.py:1421:17: error: Statement is unreachable [unreachable]
+ sphinx/testing/util.py: note: In member "__init__" of class "SphinxTestApp":
+ sphinx/testing/util.py:147:13: error: Statement is unreachable [unreachable]
+ sphinx/testing/util.py:155:13: error: Statement is unreachable [unreachable]
+ sphinx/ext/viewcode.py: note: In function "_get_full_modname":
+ sphinx/ext/viewcode.py:57:9: error: Statement is unreachable [unreachable]
+ sphinx/ext/doctest.py: note: In member "get_line_number" of class "DocTestBuilder":
+ sphinx/ext/doctest.py:413:9: error: Statement is unreachable [unreachable]
+ sphinx/ext/napoleon/docstring.py: note: In member "_get_location" of class "GoogleDocstring":
+ sphinx/ext/napoleon/docstring.py:431:13: error: Statement is unreachable [unreachable]
+ sphinx/ext/napoleon/__init__.py: note: In function "setup":
+ sphinx/ext/napoleon/__init__.py:324:9: error: Statement is unreachable [unreachable]
+ sphinx/ext/autosummary/generate.py: note: In member "__init__" of class "AutosummaryRenderer":
+ sphinx/ext/autosummary/generate.py:138:23: error: Subclass of "Sphinx" and "Builder" cannot exist: would have incompatible method signatures [unreachable]
+ sphinx/ext/autosummary/generate.py:139:13: error: Statement is unreachable [unreachable]
+ sphinx/ext/autosummary/generate.py: note: In function "_get_members":
+ sphinx/ext/autosummary/generate.py:513:21: error: Statement is unreachable [unreachable]
+ sphinx/environment/collectors/toctree.py: note: In function "process_doc":
+ sphinx/environment/collectors/toctree.py:121:25: error: Statement is unreachable [unreachable]
+ sphinx/environment/collectors/metadata.py: note: In member "process_doc" of class "MetadataCollector":
+ sphinx/environment/collectors/metadata.py:42:13: error: Statement is unreachable [unreachable]
+ sphinx/environment/collectors/dependencies.py: note: In member "process_doc" of class "DependenciesCollector":
+ sphinx/environment/collectors/dependencies.py:47:27: error: Subclass of "str" and "bytes" cannot exist: would have incompatible method signatures [unreachable]
+ sphinx/environment/collectors/dependencies.py:48:17: error: Statement is unreachable [unreachable]
+ sphinx/directives/patches.py: note: In member "run" of class "Figure":
+ sphinx/directives/patches.py:52:41: error: Right operand of "and" is never evaluated [unreachable]
+ sphinx/directives/patches.py:53:13: error: Statement is unreachable [unreachable]
+ sphinx/directives/patches.py: note: At top level:
+ sphinx/writers/text.py: note: In member "visit_paragraph" of class "TextTranslator":
+ sphinx/writers/text.py:1159:27: error: Subclass of "Element", "Admonition", and "seealso" cannot exist: would have inconsistent method resolution order [unreachable]
+ sphinx/writers/text.py: note: In member "depart_paragraph" of class "TextTranslator":
+ sphinx/writers/text.py:1166:27: error: Subclass of "Element", "Admonition", and "seealso" cannot exist: would have inconsistent method resolution order [unreachable]
+ sphinx/testing/fixtures.py: note: In function "test_params":
+ sphinx/testing/fixtures.py:144:36: error: Right operand of "and" is never evaluated [unreachable]
+ sphinx/testing/fixtures.py:145:9: error: Statement is unreachable [unreachable]
+ sphinx/testing/fixtures.py: note: At top level:
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkAvailabilityCheckWorker":
+ sphinx/builders/linkcheck.py:420:17: error: Statement is unreachable [unreachable]
+ sphinx/ext/apidoc/_extension.py: note: In function "_parse_module_options":
+ sphinx/ext/apidoc/_extension.py:102:9: error: Statement is unreachable [unreachable]
pip (https://github.com/pypa/pip)
+ src/pip/_internal/utils/glibc.py:70: error: Statement is unreachable [unreachable]
+ src/pip/_internal/utils/logging.py:155: error: Statement is unreachable [unreachable]
+ src/pip/_internal/utils/logging.py:158: error: Statement is unreachable [unreachable]
+ src/pip/_internal/utils/hashes.py:44: error: Statement is unreachable [unreachable]
+ src/pip/_internal/build_env.py:200: error: Statement is unreachable [unreachable]
+ src/pip/_internal/network/auth.py:132: error: Statement is unreachable [unreachable]
+ src/pip/_internal/network/auth.py:150: error: Statement is unreachable [unreachable]
+ src/pip/_internal/index/package_finder.py:689: error: Subclass of "bool" and "str" cannot exist: "bool" is final [unreachable]
+ src/pip/_internal/resolution/resolvelib/base.py:45: error: Statement is unreachable [unreachable]
+ src/pip/_internal/resolution/legacy/resolver.py:455: error: Statement is unreachable [unreachable]
+ src/pip/_internal/resolution/legacy/resolver.py:473: error: Statement is unreachable [unreachable]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:450: error: Statement is unreachable [unreachable]
+ src/werkzeug/datastructures/structures.py:464: error: Statement is unreachable [unreachable]
+ src/werkzeug/datastructures/headers.py:542: error: Statement is unreachable [unreachable]
+ src/werkzeug/datastructures/headers.py:556: error: Statement is unreachable [unreachable]
+ src/werkzeug/serving.py:172: error: Statement is unreachable [unreachable]
+ src/werkzeug/serving.py:174: error: Statement is unreachable [unreachable]
+ src/werkzeug/serving.py:427: error: Statement is unreachable [unreachable]
+ src/werkzeug/utils.py:483: error: Subclass of "IO[bytes]" and "TextIOBase" cannot exist: would have incompatible method signatures [unreachable]
+ src/werkzeug/formparser.py:63: error: Statement is unreachable [unreachable]
+ src/werkzeug/formparser.py:66: error: Statement is unreachable [unreachable]
+ src/werkzeug/sansio/response.py:647: error: Statement is unreachable [unreachable]
+ src/werkzeug/sansio/response.py:682: error: Statement is unreachable [unreachable]
+ src/werkzeug/middleware/shared_data.py:137: error: Statement is unreachable [unreachable]
+ src/werkzeug/debug/tbtools.py:263: error: Statement is unreachable [unreachable]
+ src/werkzeug/wrappers/response.py:229: error: Statement is unreachable [unreachable]
+ src/werkzeug/wrappers/request.py:471: error: Statement is unreachable [unreachable]
+ src/werkzeug/local.py:293: error: Statement is unreachable [unreachable]
+ src/werkzeug/local.py:312: error: Statement is unreachable [unreachable]
+ src/werkzeug/routing/rules.py:919: error: Statement is unreachable [unreachable]
+ src/werkzeug/routing/map.py:370: error: Statement is unreachable [unreachable]
+ src/werkzeug/middleware/lint.py:156: error: Statement is unreachable [unreachable]
+ src/werkzeug/middleware/lint.py:342: error: Statement is unreachable [unreachable]
+ src/werkzeug/middleware/lint.py:377: error: Subclass of "Iterable[bytes]" and "str" cannot exist: would have inconsistent method resolution order [unreachable]
+ src/werkzeug/middleware/lint.py:378: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:729: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:883: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:974: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:1059: error: Subclass of "list[str]" and "tuple[Any, ...]" cannot exist: would have incompatible method signatures [unreachable]
+ tests/test_wrappers.py:1119: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:1144: error: Statement is unreachable [unreachable]
+ tests/test_wrappers.py:1177: error: Statement is unreachable [unreachable]
+ tests/test_utils.py:172: error: Statement is unreachable [unreachable]
+ tests/test_http.py:139: error: Right operand of "and" is never evaluated [unreachable]
+ tests/test_http.py:141: error: Statement is unreachable [unreachable]
+ tests/test_datastructures.py:627: error: Statement is unreachable [unreachable]
AutoSplit (https://github.com/Toufool/AutoSplit)
+ src/d3d11.py:8:1: error: Statement is unreachable [unreachable]
+ src/utils.py:131:5: error: Statement is unreachable [unreachable]
+ src/utils.py:141:5: error: Statement is unreachable [unreachable]
+ src/utils.py:162:5: error: Statement is unreachable [unreachable]
+ src/split_parser.py:208:5: error: Statement is unreachable [unreachable]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:5:1: error: Statement is unreachable [unreachable]
+ src/capture_method/BitBltCaptureMethod.py:5:1: error: Statement is unreachable [unreachable]
+ src/capture_method/ForceFullContentRenderingCaptureMethod.py:5:1: error: Statement is unreachable [unreachable]
+ src/capture_method/DesktopDuplicationCaptureMethod.py:5:1: error: Statement is unreachable [unreachable]
|
will this affect performance? |
Good question! That hadn't crossed my mind. I'll look into that as well. Edit: the performance readout from perf_compare seems to be:
n=15, and I wasn't a purist about not running any other programs in the background. But it's suggestive of no change. I decided to test it again, a little more careful about background processes, and with my updated version of perf_compare:
still n=15, etc. |
This is useful check for dead code analysis. Iff the rate of false-positives is low enough, then this is a worthwhile addition to strict. (I am currently investigating the current rate of false-positives, eg #10806 ; #14987 ; mypyc/ir/pprint.py:231: error: Statement is unreachable )
This PR is largely a copy of #17944 , which is now closed.
Fixes #11223, #18078
This adds a useful check to the default list of strict arguments.
I personally do not see this as a breaking change, due to the documentation of --strict stating it may include different flags over time. I think this could just be in a minor version. (Either way, this pull request could be used.)