Skip to content
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

a different alternate of dict.get #13229

Closed
wants to merge 1 commit into from
Closed

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Dec 11, 2024

Pushing this up just to compare the mypy-primer damage as compared with #13222. I expect it to be more disruptive, but I'm curious how much more. It seems similar to but dramatically less disruptive than an older attempt at changing dict.get in #10294.

Pushing this up just to compare the mypy-primer damage as compared
with python#13222. I expect it to be more disruptive, but I'm curious how
much more. It seems similar to but dramatically less disruptive than
an older attempt at changing dict.get in python#10294.
Copy link
Contributor

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

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has incompatible type "**dict[str, object]"; expected "float"  [arg-type]
+ pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has incompatible type "**dict[str, object]"; expected "bool | None"  [arg-type]

alerta (https://github.com/alerta/alerta)
+ alerta/models/token.py:33: error: Need type annotation for "orgs"  [var-annotated]
+ alerta/models/token.py:34: error: Need type annotation for "groups"  [var-annotated]
+ alerta/models/token.py:35: error: Need type annotation for "roles"  [var-annotated]
+ alerta/models/token.py:36: error: Need type annotation for "scopes"  [var-annotated]
+ alerta/models/permission.py:29: error: Argument "match" to "Permission" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/permission.py:49: error: Argument "match" to "Permission" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:34: error: Argument "text" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:35: error: Argument "user" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:37: error: Argument "note_type" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:40: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ alerta/models/note.py:40: note: Possible overload variants:
+ alerta/models/note.py:40: note:     def get(self, Never, None = ..., /) -> None
+ alerta/models/note.py:40: note:     def [_T] get(self, Never, _T, /) -> _T
+ alerta/models/note.py:76: error: Argument "text" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:77: error: Argument "user" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:79: error: Argument "note_type" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:51: error: Argument "user" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:53: error: Argument "text" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:55: error: Argument "customer" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:89: error: Argument "user" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:91: error: Argument 1 to "type_to_scopes" of "ApiKeyHelper" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:91: error: Argument 2 to "type_to_scopes" of "ApiKeyHelper" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:92: error: Argument "text" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:93: error: Argument "expire_time" to "ApiKey" has incompatible type "Any | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:96: error: Argument "customer" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:85: error: Argument "origin" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:89: error: Argument "timeout" to "Heartbeat" has incompatible type "Any | None"; expected "int"  [arg-type]
+ alerta/models/heartbeat.py:90: error: Argument "customer" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:120: error: Argument "origin" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:124: error: Argument "create_time" to "Heartbeat" has incompatible type "Any | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:125: error: Argument "timeout" to "Heartbeat" has incompatible type "Any | None"; expected "int"  [arg-type]
+ alerta/models/heartbeat.py:129: error: Argument "customer" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:32: error: Argument "id" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:33: error: Argument "name" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:34: error: Argument "login" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:35: error: Argument "status" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:84: error: Argument "name" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:85: error: Argument "text" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:106: error: Argument "name" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:107: error: Argument "text" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:23: error: Argument "match" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:24: error: Argument "customer" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:44: error: Argument "match" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:45: error: Argument "customer" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:98: error: Argument "resource" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:99: error: Argument "event" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:173: error: Argument "resource" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:174: error: Argument "event" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:66: error: Argument "login" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:68: error: Argument "email" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:72: error: Argument "text" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:107: error: Argument "name" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:109: error: Argument "password" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:110: error: Argument "email" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:116: error: Argument "text" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/web.py:1534: error: Need type annotation for "cookie_kwargs"  [var-annotated]
+ tornado/web.py:2195: error: Need type annotation for "static_handler_args"  [var-annotated]

pylint (https://github.com/pycqa/pylint)
+ pylint/config/utils.py:52: error: Argument "action" to "_StoreTrueArgument" has incompatible type "Any | str"; expected "Literal['store_true']"  [arg-type]
+ pylint/config/utils.py:66: error: Argument "metavar" to "_CallableArgument" has incompatible type "Any | None"; expected "str"  [arg-type]
+ pylint/config/utils.py:74: error: Argument "action" to "_ExtendArgument" has incompatible type "Any | str"; expected "Literal['extend']"  [arg-type]

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/settings/sources.py:146: error: Need type annotation for "profiles_data"  [var-annotated]
+ src/prefect/settings/sources.py:157: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/prefect/settings/sources.py:157: note: Possible overload variants:
+ src/prefect/settings/sources.py:157: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/settings/sources.py:157: note:     def [_T] get(self, Never, _T, /) -> _T
- src/prefect/locking/memory.py:194: note:     def get(self, Never, /) -> None
+ src/prefect/locking/memory.py:194: note:     def get(self, Never, None = ..., /) -> None
- src/prefect/locking/memory.py:194: note:     def get(self, Never, Never, /) -> Never
- src/prefect/locking/memory.py:205: note:     def get(self, Never, /) -> None
+ src/prefect/locking/memory.py:205: note:     def get(self, Never, None = ..., /) -> None
- src/prefect/locking/memory.py:205: note:     def get(self, Never, Never, /) -> Never
+ src/prefect/utilities/templating.py:240: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ src/prefect/utilities/templating.py:240: note: Possible overload variants:
+ src/prefect/utilities/templating.py:240: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/utilities/templating.py:240: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/prefect/settings/profiles.py:255: error: Need type annotation for "raw_profiles"  [var-annotated]
+ src/prefect/blocks/core.py:762: error: Need type annotation for "nested_block_document_info"  [var-annotated]
+ src/prefect/server/api/validation.py:67: error: Need type annotation for "variables_schema"  [var-annotated]
+ src/prefect/server/api/validation.py:126: error: Need type annotation for "reference_data"  [var-annotated]
- src/prefect/records/memory.py:176: note:     def get(self, Never, /) -> None
+ src/prefect/records/memory.py:176: note:     def get(self, Never, None = ..., /) -> None
- src/prefect/records/memory.py:176: note:     def get(self, Never, Never, /) -> Never
+ src/prefect/cli/config.py:269: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/prefect/cli/config.py:269: note: Possible overload variants:
+ src/prefect/cli/config.py:269: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/cli/config.py:269: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/prefect/cli/deploy.py:578: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/prefect/cli/deploy.py:578: note: Possible overload variants:
+ src/prefect/cli/deploy.py:578: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/cli/deploy.py:578: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/prefect/cli/deploy.py:584: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/prefect/cli/deploy.py:584: note: Possible overload variants:
+ src/prefect/cli/deploy.py:584: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/cli/deploy.py:584: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/prefect/cli/deploy.py:897: error: Item "type" of "Any | type[NotSet] | list[Any]" has no attribute "__iter__" (not iterable)  [union-attr]

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/spidermiddlewares/referer.py:396: error: Need type annotation for "redirected_urls"  [var-annotated]
+ scrapy/core/http2/stream.py:175: error: Incompatible return value type (got "Any | Literal[0] | bool", expected "bool")  [return-value]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/wsgi.py:78: error: Argument 1 to "int" has incompatible type "Optional[Any]"; expected "Union[str, Buffer, SupportsInt, SupportsIndex, SupportsTrunc]"  [arg-type]
+ src/werkzeug/wsgi.py:281: error: Unused "type: ignore" comment  [unused-ignore]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/state/session_state.py: note: In member "get_id_from_key" of class "KeyIdMapper":
+ lib/streamlit/runtime/state/session_state.py:314:9: error: Returning Any from function declared to return "str"  [no-any-return]
+ lib/streamlit/web/server/routes.py: note: In member "handle_request" of class "HealthHandler":
+ lib/streamlit/web/server/routes.py:177:33: error: Need type annotation for "cookie_kwargs"  [var-annotated]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/commands/utils.py:43: note:          def get(self, str, /) -> _VT | None
+ steam/ext/commands/utils.py:43: note:          def get(self, str, None = ..., /) -> _VT | None
- steam/ext/commands/utils.py:43: note:          @overload
- steam/ext/commands/utils.py:43: note:          def get(self, str, _VT, /) -> _VT

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/datasets/_openml.py:412: error: No overload variant of "get" of "dict" matches argument types "str", "list[Never]"  [call-overload]
+ sklearn/datasets/_openml.py:412: note: Possible overload variants:
+ sklearn/datasets/_openml.py:412: note:     def get(self, Never, None = ..., /) -> None
+ sklearn/datasets/_openml.py:412: note:     def [_T] get(self, Never, _T, /) -> _T

speedrun.com_global_scoreboard_webapp (https://github.com/Avasam/speedrun.com_global_scoreboard_webapp)
- backend/services/user_updater_helpers.py:190: error: Incompatible types in assignment (expression has type "list[list[Run]]", variable has type "list[Run]")  [assignment]
+ backend/services/user_updater_helpers.py:190: error: Incompatible types in assignment (expression has type "list[list[Run]] | list[Run]", variable has type "list[Run]")  [assignment]
- backend/services/user_updater_helpers.py:196: error: Incompatible types in assignment (expression has type "list[list[Run]]", variable has type "list[Run]")  [assignment]
+ backend/services/user_updater_helpers.py:196: error: Incompatible types in assignment (expression has type "list[list[Run]] | list[Run]", variable has type "list[Run]")  [assignment]

ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:280: error: Definition of "get" in base class "dict" is incompatible with definition in base class "Mapping"  [misc]
+ ibis/expr/operations/udf.py:126: error: Argument 2 to "get" of "dict" has incompatible type "<typing special form>"; expected "type | None"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/synchronous/client_bulk.py:586: error: Need type annotation for "wce"  [var-annotated]
+ pymongo/asynchronous/client_bulk.py:588: error: Need type annotation for "wce"  [var-annotated]

poetry (https://github.com/python-poetry/poetry)
+ src/poetry/packages/locker.py:99: error: Need type annotation for "metadata"  [var-annotated]
+ src/poetry/packages/locker.py:270: error: Need type annotation for "project_content"  [var-annotated]
+ src/poetry/packages/locker.py:271: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/poetry/packages/locker.py:271: note: Possible overload variants:
+ src/poetry/packages/locker.py:271: note:     def get(self, Never, None = ..., /) -> None
+ src/poetry/packages/locker.py:271: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/poetry/packages/locker.py:351: error: Need type annotation for "source"  [var-annotated]
+ src/poetry/packages/locker.py:355: error: Argument 1 to "joinpath" of "PurePath" has incompatible type "Any | None"; expected "str | PathLike[str]"  [arg-type]
+ src/poetry/packages/locker.py:390: error: Argument 1 to "Path" has incompatible type "Any | None"; expected "str | PathLike[str]"  [arg-type]
+ src/poetry/packages/locker.py:407: error: Need type annotation for "extras"  [var-annotated]
+ src/poetry/utils/authenticator.py:230: error: Argument 2 to "send" of "Session" has incompatible type "**dict[str, Any | int]"; expected "bool | None"  [arg-type]
+ src/poetry/utils/authenticator.py:230: error: Argument 2 to "send" of "Session" has incompatible type "**dict[str, Any | int]"; expected "bool | str | None"  [arg-type]
+ src/poetry/utils/authenticator.py:230: error: Argument 2 to "send" of "Session" has incompatible type "**dict[str, Any | int]"; expected "MutableMapping[str, str] | None"  [arg-type]
+ src/poetry/utils/authenticator.py:230: error: Argument 2 to "send" of "Session" has incompatible type "**dict[str, Any | int]"; expected "str | tuple[str, str] | None"  [arg-type]
+ src/poetry/utils/authenticator.py:230: error: Argument 2 to "send" of "Session" has incompatible type "**dict[str, Any | int]"; expected "bool"  [arg-type]
+ src/poetry/factory.py:343: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ src/poetry/factory.py:343: note: Possible overload variants:
+ src/poetry/factory.py:343: note:     def get(self, Never, None = ..., /) -> None
+ src/poetry/factory.py:343: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/poetry/console/commands/version.py:72: error: Need type annotation for "project_content"  [var-annotated]
+ src/poetry/console/commands/version.py:75: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/poetry/console/commands/version.py:75: note: Possible overload variants:
+ src/poetry/console/commands/version.py:75: note:     def get(self, Never, None = ..., /) -> None
+ src/poetry/console/commands/version.py:75: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/poetry/console/commands/remove.py:65: error: Need type annotation for "project_content"  [var-annotated]
+ src/poetry/console/commands/remove.py:66: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/poetry/console/commands/remove.py:66: note: Possible overload variants:
+ src/poetry/console/commands/remove.py:66: note:     def get(self, Never, None = ..., /) -> None
+ src/poetry/console/commands/remove.py:66: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/poetry/console/commands/add.py:154: error: No overload variant of "get" of "dict" matches argument types "str", "Any"  [call-overload]
+ src/poetry/console/commands/add.py:154: note: Possible overload variants:
+ src/poetry/console/commands/add.py:154: note:     def get(self, Never, None = ..., /) -> None
+ src/poetry/console/commands/add.py:154: note:     def [_T] get(self, Never, _T, /) -> _T

pyppeteer (https://github.com/pyppeteer/pyppeteer)
+ pyppeteer/connection.py:117: error: Need type annotation for "params"  [var-annotated]
+ pyppeteer/connection.py:121: error: Argument 1 to "get" of "dict" has incompatible type "Any | None"; expected "str"  [arg-type]
+ pyppeteer/connection.py:123: error: Argument 1 to "_on_message" of "CDPSession" has incompatible type "Any | None"; expected "str"  [arg-type]
+ pyppeteer/connection.py:125: error: Argument 1 to "get" of "dict" has incompatible type "Any | None"; expected "str"  [arg-type]
+ pyppeteer/connection.py:128: error: Argument 1 to "__delitem__" of "dict" has incompatible type "Any | None"; expected "str"  [arg-type]
+ pyppeteer/helper.py:44: error: Need type annotation for "stackTrace"  [var-annotated]
+ pyppeteer/helper.py:46: error: Item "None" of "Any | None" has no attribute "__iter__" (not iterable)  [union-attr]
+ pyppeteer/page.py:212: error: Need type annotation for "entry"  [var-annotated]
+ pyppeteer/page.py:215: error: Need type annotation for "args"  [var-annotated]
+ pyppeteer/page.py:1369: error: Need type annotation for "marginOptions"  [var-annotated]
+ pyppeteer/network_manager.py:213: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ pyppeteer/network_manager.py:213: note: Possible overload variants:
+ pyppeteer/network_manager.py:213: note:     def get(self, Never, None = ..., /) -> None
+ pyppeteer/network_manager.py:213: note:     def [_T] get(self, Never, _T, /) -> _T
+ pyppeteer/network_manager.py:265: error: Need type annotation for "_resp"  [var-annotated]
+ pyppeteer/network_manager.py:269: error: Argument 5 to "Response" has incompatible type "Any | None"; expected "bool"  [arg-type]
+ pyppeteer/network_manager.py:270: error: Argument 6 to "Response" has incompatible type "Any | None"; expected "bool"  [arg-type]
+ pyppeteer/network_manager.py:271: error: Argument 7 to "Response" has incompatible type "Any | None"; expected "dict[Any, Any]"  [arg-type]
+ pyppeteer/network_manager.py:342: error: Need type annotation for "headers"  [var-annotated]
+ pyppeteer/network_manager.py:498: error: Argument 1 to "get" of "dict" has incompatible type "Any | int"; expected "str"  [arg-type]
+ pyppeteer/network_manager.py:707: error: Need type annotation for "_hash"  [var-annotated]
+ pyppeteer/network_manager.py:727: error: Unsupported target for indexed assignment ("dict[Any, Any] | Any | str | None")  [index]
+ pyppeteer/launcher.py:381: error: Need type annotation for "args"  [var-annotated]
+ pyppeteer/element_handle.py:285: error: Need type annotation for "model"  [var-annotated]
+ pyppeteer/element_handle.py:287: error: Argument 1 to "_fromProtocolQuad" of "ElementHandle" has incompatible type "Any | None"; expected "list[int]"  [arg-type]
+ pyppeteer/element_handle.py:288: error: Argument 1 to "_fromProtocolQuad" of "ElementHandle" has incompatible type "Any | None"; expected "list[int]"  [arg-type]
+ pyppeteer/element_handle.py:289: error: Argument 1 to "_fromProtocolQuad" of "ElementHandle" has incompatible type "Any | None"; expected "list[int]"  [arg-type]
+ pyppeteer/element_handle.py:290: error: Argument 1 to "_fromProtocolQuad" of "ElementHandle" has incompatible type "Any | None"; expected "list[int]"  [arg-type]
+ pyppeteer/coverage.py:260: error: Need type annotation for "header"  [var-annotated]

spark (https://github.com/apache/spark)
+ python/pyspark/logger/logger.py:60: error: Need type annotation for "log_entry"  [var-annotated]
+ python/pyspark/sql/session.py:322: error: Dict entry 0 has incompatible type "str": "Any | str | None"; expected "str": "str"  [dict-item]
+ python/pyspark/sql/session.py:323: error: Dict entry 1 has incompatible type "str": "Any | str | None"; expected "str": "str"  [dict-item]
+ python/pyspark/sql/session.py:574: error: Item "None" of "Any | str | None" has no attribute "startswith"  [union-attr]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/pytables.py:3909: error: Need type annotation for "info"  [var-annotated]
+ pandas/io/pytables.py:4690: error: Need type annotation for "info"  [var-annotated]
+ pandas/io/parsers/arrow_parser_wrapper.py:249: error: Need type annotation for "nulls"  [var-annotated]
+ pandas/core/generic.py:2074: error: Need type annotation for "attrs"  [var-annotated]
+ pandas/core/apply.py:1560: error: Dict entry 0 has incompatible type "str": "Any | None"; expected "str": "str | bool"  [dict-item]
+ pandas/core/apply.py:1560: error: Dict entry 1 has incompatible type "str": "Any | None"; expected "str": "str | bool"  [dict-item]

python-chess (https://github.com/niklasf/python-chess)
+ chess/engine.py:2211: error: Argument 2 to "get" of "dict" has incompatible type "int"; expected "bool"  [arg-type]
+ chess/engine.py:2481: error: Argument 2 to "get" of "dict" has incompatible type "bool"; expected "str | None"  [arg-type]

twine (https://github.com/pypa/twine)
+ twine/repository.py:200: error: Need type annotation for "packages"  [var-annotated]

isort (https://github.com/pycqa/isort)
+ isort/output.py:666: error: No overload variant of "pop" of "dict" matches argument types "str", "None"  [call-overload]
+ isort/output.py:666: note: Possible overload variants:
+ isort/output.py:666: note:     def pop(self, Never, /) -> Never
+ isort/output.py:666: note:     def pop(self, Never, Never, /) -> Never
+ isort/output.py:666: note:     def [_T] pop(self, Never, _T, /) -> _T

black (https://github.com/psf/black)
+ src/black/files.py:127:30: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ src/black/files.py:127:30: note: Possible overload variants:
+ src/black/files.py:127:30: note:     def get(self, Never, None = ..., /) -> None
+ src/black/files.py:127:30: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/black/files.py:148:24: error: Need type annotation for "project_metadata"  [var-annotated]

starlette (https://github.com/encode/starlette)
+ starlette/testclient.py:706: error: Need type annotation for "headers"  [var-annotated]
+ starlette/templating.py:44: error: Need type annotation for "request"  [var-annotated]
+ starlette/templating.py:45: error: Need type annotation for "extensions"  [var-annotated]

altair (https://github.com/vega/altair)
+ altair/utils/selection.py:49: error: Need type annotation for "points"  [var-annotated]
+ altair/utils/html.py:399: error: Item "str" of "Literal['standard', 'universal', 'inline', 'olli'] | Template" has no attribute "render"  [union-attr]
+ altair/utils/mimebundle.py:134: error: Need type annotation for "final_embed_options"  [var-annotated]
+ altair/utils/schemapi.py:1304: error: Need type annotation for "props"  [var-annotated]
+ altair/utils/_vegafusion_data.py:230: error: Argument 1 to "handle_row_limit_exceeded" has incompatible type "Any | None"; expected "int"  [arg-type]
+ altair/utils/_vegafusion_data.py:281: error: Argument 1 to "handle_row_limit_exceeded" has incompatible type "Any | None"; expected "int"  [arg-type]
+ altair/vegalite/v5/api.py:343: error: Need type annotation for "context"  [var-annotated]
+ altair/vegalite/v5/api.py:2636: error: Argument 1 to "AggregatedFieldDef" has incompatible type "**dict[str, str | Any | UndefinedType]"; expected "SchemaBase | Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] | UndefinedType"  [arg-type]
+ altair/vegalite/v5/api.py:2969: error: Argument 1 to "JoinAggregateFieldDef" has incompatible type "**dict[str, str | Any | UndefinedType]"; expected "SchemaBase | Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] | UndefinedType"  [arg-type]
+ altair/utils/_transformed_data.py:339: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ altair/utils/_transformed_data.py:339: note: Possible overload variants:
+ altair/utils/_transformed_data.py:339: note:     def get(self, Never, None = ..., /) -> None
+ altair/utils/_transformed_data.py:339: note:     def [_T] get(self, Never, _T, /) -> _T
+ tools/schemapi/schemapi.py:1302: error: Need type annotation for "props"  [var-annotated]
+ tools/vega_expr.py:461: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ tools/vega_expr.py:461: note: Possible overload variants:
+ tools/vega_expr.py:461: note:     def get(self, Never, None = ..., /) -> None
+ tools/vega_expr.py:461: note:     def [_T] get(self, Never, _T, /) -> _T

discord.py (https://github.com/Rapptz/discord.py)
- discord/activity.py:384: error: Incompatible types in assignment (expression has type "Any | dict[Any, Any]", variable has type "ActivityAssets")  [assignment]
+ discord/ext/commands/flags.py:180: error: Need type annotation for "annotations"  [var-annotated]

freqtrade (https://github.com/freqtrade/freqtrade)
+ freqtrade/freqai/torch/PyTorchMLPModel.py:41: error: Argument 2 to "get" of "dict" has incompatible type "float"; expected "int"  [arg-type]
+ freqtrade/plugins/pairlist/pairlist_helpers.py:45: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/plugins/pairlist/pairlist_helpers.py:45: note: Possible overload variants:
+ freqtrade/plugins/pairlist/pairlist_helpers.py:45: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/plugins/pairlist/pairlist_helpers.py:45: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/loggers/__init__.py:111: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/loggers/__init__.py:111: note: Possible overload variants:
+ freqtrade/loggers/__init__.py:111: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/loggers/__init__.py:111: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/load_config.py:93: error: Need type annotation for "files_loaded" (hint: "files_loaded: list[<type>] = ...")  [var-annotated]
+ freqtrade/configuration/directory_operations.py:24: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/configuration/directory_operations.py:24: note: Possible overload variants:
+ freqtrade/configuration/directory_operations.py:24: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/directory_operations.py:24: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/deprecated_settings.py:44: error: Need type annotation for "section1_config"  [var-annotated]
+ freqtrade/configuration/deprecated_settings.py:162: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/configuration/deprecated_settings.py:162: note: Possible overload variants:
+ freqtrade/configuration/deprecated_settings.py:162: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/deprecated_settings.py:162: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/rpc/fiat_convert.py:59: error: Need type annotation for "_coingecko_config"  [var-annotated]
+ freqtrade/configuration/configuration.py:119: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/configuration/configuration.py:119: note: Possible overload variants:
+ freqtrade/configuration/configuration.py:119: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/configuration.py:119: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/configuration.py:507: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/configuration.py:507: note: Possible overload variants:
+ freqtrade/configuration/configuration.py:507: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/configuration.py:507: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:106: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:106: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:106: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:106: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:118: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:118: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:118: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:118: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:123: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:123: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:123: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:123: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:167: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:167: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:167: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:167: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:192: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:192: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:192: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:192: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:198: error: Need type annotation for "ask_strategy"  [var-annotated]
+ freqtrade/configuration/config_validation.py:226: error: Need type annotation for "time_in_force"  [var-annotated]
+ freqtrade/configuration/config_validation.py:247: error: Need type annotation for "order_types"  [var-annotated]
+ freqtrade/configuration/config_validation.py:282: error: Need type annotation for "unfilledtimeout"  [var-annotated]
+ freqtrade/configuration/config_validation.py:331: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/configuration/config_validation.py:331: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:331: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:331: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:340: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/configuration/config_validation.py:340: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:340: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:340: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:344: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/configuration/config_validation.py:344: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:344: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:344: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:363: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/configuration/config_validation.py:363: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:363: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:363: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:365: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/configuration/config_validation.py:365: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:365: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:365: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:372: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/configuration/config_validation.py:372: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:372: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:372: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/configuration/config_validation.py:394: error: Need type annotation for "emc_conf"  [var-annotated]
+ freqtrade/configuration/config_validation.py:414: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/configuration/config_validation.py:414: note: Possible overload variants:
+ freqtrade/configuration/config_validation.py:414: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/configuration/config_validation.py:414: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/commands/list_commands.py:234: error: Need type annotation for "base_currencies"  [var-annotated]
+ freqtrade/commands/list_commands.py:235: error: Need type annotation for "quote_currencies"  [var-annotated]
+ freqtrade/strategy/hyper.py:84: error: No overload variant of "get" of "dict" matches argument types "str", "Any | float"  [call-overload]
+ freqtrade/strategy/hyper.py:84: note: Possible overload variants:
+ freqtrade/strategy/hyper.py:84: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/hyper.py:84: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/hyper.py:87: error: No overload variant of "get" of "dict" matches argument types "str", "Any | int"  [call-overload]
+ freqtrade/strategy/hyper.py:87: note: Possible overload variants:
+ freqtrade/strategy/hyper.py:87: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/hyper.py:87: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/hyper.py:90: error: Need type annotation for "trailing"  [var-annotated]
+ freqtrade/exchange/exchange.py:520: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/exchange/exchange.py:520: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:520: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:520: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:524: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/exchange/exchange.py:524: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:524: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:524: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:550: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/exchange/exchange.py:550: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:550: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:550: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:576: error: Need type annotation for "market"  [var-annotated]
+ freqtrade/exchange/exchange.py:808: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/exchange/exchange.py:808: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:808: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:808: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:894: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/exchange/exchange.py:894: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:894: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:894: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:902: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/exchange/exchange.py:902: note: Possible overload variants:
+ freqtrade/exchange/exchange.py:902: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/exchange.py:902: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/exchange.py:2008: error: Need type annotation for "conf_strategy"  [var-annotated]
+ freqtrade/exchange/exchange.py:2089: error: Need type annotation for "entry_pricing"  [var-annotated]
+ freqtrade/exchange/exchange.py:2090: error: Need type annotation for "exit_pricing"  [var-annotated]
+ freqtrade/exchange/okx.py:196: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/exchange/okx.py:196: note: Possible overload variants:
+ freqtrade/exchange/okx.py:196: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/okx.py:196: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/gate.py:123: error: Need type annotation for "pair_fees"  [var-annotated]
+ freqtrade/exchange/gate.py:148: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/exchange/gate.py:148: note: Possible overload variants:
+ freqtrade/exchange/gate.py:148: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/gate.py:148: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/check_exchange.py:28: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/exchange/check_exchange.py:28: note: Possible overload variants:
+ freqtrade/exchange/check_exchange.py:28: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/check_exchange.py:28: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/exchange/check_exchange.py:33: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/exchange/check_exchange.py:33: note: Possible overload variants:
+ freqtrade/exchange/check_exchange.py:33: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/exchange/check_exchange.py:33: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/data/entryexitanalysis.py:357: error: Need type annotation for "analysis_groups"  [var-annotated]
+ freqtrade/data/entryexitanalysis.py:360: error: Need type annotation for "indicator_list"  [var-annotated]
+ freqtrade/data/entryexitanalysis.py:365: error: Argument 1 to "Path" has incompatible type "Any | None"; expected "str | PathLike[str]"  [arg-type]
+ freqtrade/rpc/rpc_manager.py:94: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/rpc/rpc_manager.py:94: note: Possible overload variants:
+ freqtrade/rpc/rpc_manager.py:94: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/rpc/rpc_manager.py:94: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/data/dataprovider.py:69: error: No overload variant of "get" of "dict" matches argument types "str", "list[Never]"  [call-overload]
+ freqtrade/data/dataprovider.py:69: note: Possible overload variants:
+ freqtrade/data/dataprovider.py:69: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/data/dataprovider.py:69: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/data/dataprovider.py:335: error: Need type annotation for "freqai_config"  [var-annotated]
+ freqtrade/data/dataprovider.py:458: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/data/dataprovider.py:458: note: Possible overload variants:
+ freqtrade/data/dataprovider.py:458: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/data/dataprovider.py:458: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:176: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/strategy/interface.py:176: note: Possible overload variants:
+ freqtrade/strategy/interface.py:176: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:176: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:915: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/strategy/interface.py:915: note: Possible overload variants:
+ freqtrade/strategy/interface.py:915: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:915: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:1173: error: No overload variant of "get" of "dict" matches argument types "str", "int"  [call-overload]
+ freqtrade/strategy/interface.py:1173: note: Possible overload variants:
+ freqtrade/strategy/interface.py:1173: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:1173: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:1555: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/strategy/interface.py:1555: note: Possible overload variants:
+ freqtrade/strategy/interface.py:1555: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:1555: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:1557: error: No overload variant of "get" of "dict" matches argument types "str", "str"  [call-overload]
+ freqtrade/strategy/interface.py:1557: note: Possible overload variants:
+ freqtrade/strategy/interface.py:1557: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:1557: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/strategy/interface.py:1603: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/strategy/interface.py:1603: note: Possible overload variants:
+ freqtrade/strategy/interface.py:1603: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/strategy/interface.py:1603: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/rpc/external_message_consumer.py:66: error: Need type annotation for "_emc_config"  [var-annotated]
+ freqtrade/edge/edge_positioning.py:54: error: Need type annotation for "edge_config"  [var-annotated]
+ freqtrade/edge/edge_positioning.py:67: error: Incompatible types in assignment (expression has type "Any | None", variable has type "float")  [assignment]
+ freqtrade/edge/edge_positioning.py:103: error: Unsupported operand types for + ("int" and "None")  [operator]
+ freqtrade/edge/edge_positioning.py:103: note: Right operand is of type "Any | None"
+ freqtrade/freqai/data_kitchen.py:149: error: No overload variant of "get" of "dict" matches argument types "str", "float"  [call-overload]
+ freqtrade/freqai/data_kitchen.py:149: note: Possible overload variants:
+ freqtrade/freqai/data_kitchen.py:149: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/data_kitchen.py:149: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/data_kitchen.py:600: error: Item "str" of "Any | str" has no attribute "get"  [union-attr]
+ freqtrade/freqtradebot.py:137: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/freqtradebot.py:137: note: Possible overload variants:
+ freqtrade/freqtradebot.py:137: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqtradebot.py:137: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqtradebot.py:144: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/freqtradebot.py:144: note: Possible overload variants:
+ freqtrade/freqtradebot.py:144: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqtradebot.py:144: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqtradebot.py:702: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/freqtradebot.py:702: note: Possible overload variants:
+ freqtrade/freqtradebot.py:702: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqtradebot.py:702: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqtradebot.py:1606: error: No overload variant of "get" of "dict" matches argument types "str", "int"  [call-overload]
+ freqtrade/freqtradebot.py:1606: note: Possible overload variants:
+ freqtrade/freqtradebot.py:1606: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqtradebot.py:1606: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/optimize/backtesting.py:137: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/optimize/backtesting.py:137: note: Possible overload variants:
+ freqtrade/optimize/backtesting.py:137: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/optimize/backtesting.py:137: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/optimize/backtesting.py:205: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/optimize/backtesting.py:205: note: Possible overload variants:
+ freqtrade/optimize/backtesting.py:205: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/optimize/backtesting.py:205: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/data_drawer.py:70: error: Need type annotation for "freqai_info"  [var-annotated]
+ freqtrade/worker.py:57: error: Need type annotation for "internals_config"  [var-annotated]
+ freqtrade/worker.py:63: error: No overload variant of "get" of "dict" matches argument types "str", "bool"  [call-overload]
+ freqtrade/worker.py:63: note: Possible overload variants:
+ freqtrade/worker.py:63: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/worker.py:63: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/utils.py:170: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/freqai/utils.py:170: note: Possible overload variants:
+ freqtrade/freqai/utils.py:170: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/utils.py:170: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/optimize/analysis/recursive_helpers.py:90: error: Need type annotation for "strategy_list"  [var-annotated]
+ freqtrade/optimize/analysis/lookahead_helpers.py:225: error: Need type annotation for "strategy_list"  [var-annotated]
+ freqtrade/freqai/freqai_interface.py:63: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/freqai/freqai_interface.py:63: note: Possible overload variants:
+ freqtrade/freqai/freqai_interface.py:63: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/freqai_interface.py:63: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/freqai_interface.py:66: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ freqtrade/freqai/freqai_interface.py:66: note: Possible overload variants:
+ freqtrade/freqai/freqai_interface.py:66: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/freqai_interface.py:66: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/freqai_interface.py:93: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/freqai/freqai_interface.py:93: note: Possible overload variants:
+ freqtrade/freqai/freqai_interface.py:93: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/freqai_interface.py:93: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/plugins/pairlist/ProducerPairList.py:40: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ freqtrade/plugins/pairlist/ProducerPairList.py:40: note: Possible overload variants:
+ freqtrade/plugins/pairlist/ProducerPairList.py:40: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/plugins/pairlist/ProducerPairList.py:40: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/plugins/pairlist/MarketCapPairList.py:38: error: Need type annotation for "_categories"  [var-annotated]
+ freqtrade/plugins/pairlist/MarketCapPairList.py:42: error: Need type annotation for "_coingecko_config"  [var-annotated]
+ freqtrade/freqai/base_models/BaseRegressionModel.py:65: error: No overload variant of "get" of "dict" matches argument types "str", "float"  [call-overload]
+ freqtrade/freqai/base_models/BaseRegressionModel.py:65: note: Possible overload variants:
+ freqtrade/freqai/base_models/BaseRegressionModel.py:65: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/base_models/BaseRegressionModel.py:65: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/base_models/BaseClassifierModel.py:64: error: No overload variant of "get" of "dict" matches argument types "str", "float"  [call-overload]
+ freqtrade/freqai/base_models/BaseClassifierModel.py:64: note: Possible overload variants:
+ freqtrade/freqai/base_models/BaseClassifierModel.py:64: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/base_models/BaseClassifierModel.py:64: note:     def [_T] get(self, Never, _T, /) -> _T
+ freqtrade/freqai/RL/BaseReinforcementLearningModel.py:133: error: No overload variant of "get" of "dict" matches argument types "str", "float"  [call-overload]
+ freqtrade/freqai/RL/BaseReinforcementLearningModel.py:133: note: Possible overload variants:
+ freqtrade/freqai/RL/BaseReinforcementLearningModel.py:133: note:     def get(self, Never, None = ..., /) -> None
+ freqtrade/freqai/RL/BaseReinforcementLearningModel.py:133: note:     def [_T] get(self, Never, _T, /) -> _T

jax (https://github.com/google/jax)
+ jax/_src/interpreters/partial_eval.py:2500: error: Argument 2 to "get" of "dict" has incompatible type "int | Tracer | Var | DBIdx | InDBIdx | OutDBIdx"; expected "BoundedAxisSize"  [arg-type]
+ jax/_src/export/_export.py:660: error: Argument 2 to "get" of "dict" has incompatible type "list[Never]"; expected "bool"  [arg-type]

operator (https://github.com/canonical/operator)
+ ops/charm.py:1578: error: Need type annotation for "websites"  [var-annotated]
+ ops/charm.py:1584: error: Need type annotation for "sources"  [var-annotated]
+ ops/charm.py:1590: error: Need type annotation for "issues"  [var-annotated]
+ ops/charm.py:1598: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ ops/charm.py:1598: note: Possible overload variants:
+ ops/charm.py:1598: note:     def get(self, Never, None = ..., /) -> None
+ ops/charm.py:1598: note:     def [_T] get(self, Never, _T, /) -> _T
+ ops/charm.py:1865: error: Need type annotation for "parameters"  [var-annotated]
+ ops/charm.py:1866: error: Need type annotation for "required"  [var-annotated]
- ops/_private/harness.py:1193: error: Argument 2 to "get" of "dict" has incompatible type "None"; expected "Mapping[str, str]"  [arg-type]
+ ops/_private/harness.py:1193: error: Incompatible return value type (got "dict[str, str] | None", expected "Mapping[str, str]")  [return-value]

xarray (https://github.com/pydata/xarray)
+ xarray/core/dataset.py: note: In function "_get_chunk":
+ xarray/core/dataset.py:246: error: Need type annotation for "preferred_chunks"  [var-annotated]
+ xarray/core/dataset.py:258: error: Argument 1 to "normalize_chunks" of "ChunkManagerEntrypoint" has incompatible type "tuple[Any | int, ...]"; expected "tuple[tuple[int, ...], ...] | tuple[tuple[int, ...], ...]"  [arg-type]
+ xarray/core/dataset.py:258: error: Argument "previous_chunks" to "normalize_chunks" of "ChunkManagerEntrypoint" has incompatible type "tuple[Any | int, ...]"; expected "tuple[tuple[int, ...], ...] | None"  [arg-type]
+ xarray/core/dataset.py: note: At top level:
+ xarray/backends/common.py: note: In function "_find_absolute_paths":
+ xarray/backends/common.py:155: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ xarray/backends/common.py:155: note: Possible overload variants:
+ xarray/backends/common.py:155: note:     def get(self, Never, None = ..., /) -> None
+ xarray/backends/common.py:155: note:     def [_T] get(self, Never, _T, /) -> _T

colour (https://github.com/colour-science/colour)
+ colour/utilities/network.py:1430: error: Item "None" of "Any | Port | None" has no attribute "connect"  [union-attr]
+ colour/utilities/network.py:1430: error: Argument 1 to "connect" of "Port" has incompatible type "Port | None"; expected "Port"  [arg-type]
+ colour/utilities/network.py:1475: error: Item "None" of "Any | Port | None" has no attribute "disconnect"  [union-attr]
+ colour/utilities/network.py:1475: error: Argument 1 to "disconnect" of "Port" has incompatible type "Port | None"; expected "Port"  [arg-type]
+ colour/io/luts/lut.py:1116: error: Need type annotation for "interpolator_kwargs"  [var-annotated]
+ colour/io/luts/lut.py:1118: error: Need type annotation for "extrapolator_kwargs"  [var-annotated]
+ colour/io/luts/lut.py:1545: error: Need type annotation for "interpolator_kwargs"  [var-annotated]
+ colour/io/luts/lut.py:1547: error: Need type annotation for "extrapolator_kwargs"  [var-annotated]
+ colour/io/luts/lut.py:2093: error: Need type annotation for "interpolator_kwargs"  [var-annotated]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/io/compat.py:510: error: Argument 1 to "tuple" has incompatible type "Any | None"; expected "Iterable[Any]"  [arg-type]
+ mitmproxy/proxy/events.py:97: error: Invalid index type "Any | None" for "dict[Command, type[CommandCompleted]]"; expected type "Command"  [index]

setuptools (https://github.com/pypa/setuptools)
+ setuptools/config/_apply_pyprojecttoml.py:68: error: Need type annotation for "project_table"  [var-annotated]
+ setuptools/config/_apply_pyprojecttoml.py:85: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ setuptools/config/_apply_pyprojecttoml.py:85: note: Possible overload variants:
+ setuptools/config/_apply_pyprojecttoml.py:85: note:     def get(self, Never, None = ..., /) -> None
+ setuptools/config/_apply_pyprojecttoml.py:85: note:     def [_T] get(self, Never, _T, /) -> _T
+ setuptools/config/_apply_pyprojecttoml.py:261: error: Need type annotation for "tool_table"  [var-annotated]
+ setuptools/config/_apply_pyprojecttoml.py:262: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ setuptools/config/_apply_pyprojecttoml.py:262: note: Possible overload variants:
+ setuptools/config/_apply_pyprojecttoml.py:262: note:     def get(self, Never, None = ..., /) -> None
+ setuptools/config/_apply_pyprojecttoml.py:262: note:     def [_T] get(self, Never, _T, /) -> _T
+ setuptools/config/_apply_pyprojecttoml.py:266: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ setuptools/config/_apply_pyprojecttoml.py:266: note: Possible overload variants:
+ setuptools/config/_apply_pyprojecttoml.py:266: note:     def get(self, Never, None = ..., /) -> None
+ setuptools/config/_apply_pyprojecttoml.py:266: note:     def [_T] get(self, Never, _T, /) -> _T
+ setuptools/config/pyprojecttoml.py:109: error: Need type annotation for "project_table"  [var-annotated]
+ setuptools/config/pyprojecttoml.py:110: error: Need type annotation for "tool_table"  [var-annotated]
+ setuptools/config/pyprojecttoml.py:111: error: Need type annotation for "setuptools_table"  [var-annotated]
+ setuptools/config/pyprojecttoml.py:182: error: Need type annotation for "project_cfg"  [var-annotated]
+ setuptools/config/pyprojecttoml.py:183: error: Need type annotation for "dynamic"  [var-annotated]
+ setuptools/config/pyprojecttoml.py:184: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ setuptools/config/pyprojecttoml.py:184: note: Possible overload variants:
+ setuptools/config/pyprojecttoml.py:184: note:     def get(self, Never, None = ..., /) -> None
+ setuptools/config/pyprojecttoml.py:184: note:     def [_T] get(self, Never, _T, /) -> _T
+ setuptools/command/build_clib.py:54: error: Need type annotation for "global_deps"  [var-annotated]
+ setuptools/command/build_clib.py:67: error: Need type annotation for "extra_deps"  [var-annotated]

spack (https://github.com/spack/spack)
+ lib/spack/spack/util/environment.py:714: error: Need type annotation for "exclude"  [var-annotated]
+ lib/spack/spack/util/environment.py:715: error: Need type annotation for "include"  [var-annotated]
+ lib/spack/spack/mirrors/mirror.py:277: error: Need type annotation for "value"  [var-annotated]
+ lib/spack/spack/mirrors/layout.py:128: error: Need type annotation for "versions"  [var-annotated]
+ lib/spack/spack/fetch_strategy.py:242: error: Need type annotation for "mirrors"  [var-annotated]
+ lib/spack/spack/detection/test.py:130: error: Need type annotation for "tests_by_path"  [var-annotated]
+ lib/spack/spack/installer.py:2313: error: Need type annotation for "unmodified_env"  [var-annotated]
+ lib/spack/spack/build_environment.py:1112: error: Need type annotation for "external_env"  [var-annotated]

pyjwt (https://github.com/jpadilla/pyjwt)
+ jwt/api_jwk.py:120: error: Need type annotation for "keys"  [var-annotated]

paasta (https://github.com/yelp/paasta)
+ paasta_tools/utils.py:2650: error: No overload variant of "get" of "dict" matches argument types "str", "Dict[Never, Never]"  [call-overload]
+ paasta_tools/utils.py:2650: note: Possible overload variants:
+ paasta_tools/utils.py:2650: note:     def get(self, Never, None = ..., /) -> None
+ paasta_tools/utils.py:2650: note:     def [_T] get(self, Never, _T, /) -> _T
+ paasta_tools/utils.py:4254: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ paasta_tools/utils.py:4254: note: Possible overload variants:
+ paasta_tools/utils.py:4254: note:     def get(self, Never, None = ..., /) -> None
+ paasta_tools/utils.py:4254: note:     def [_T] get(self, Never, _T, /) -> _T
+ paasta_tools/generate_authenticating_services.py:47: error: No overload variant of "get" of "dict" matches argument types "str", "List[Never]"  [call-overload]
+ paasta_tools/generate_authenticating_services.py:47: note: Possible overload variants:
+ paasta_tools/generate_authenticating_services.py:47: note:     def get(self, Never, None = ..., /) -> None
+ paasta_tools/generate_authenticating_services.py:47: note:     def [_T] get(self, Never, _T, /) -> _T
+ paasta_tools/kubernetes_tools.py:1329: error: Need type annotation for "config"  [var-annotated]
+ paasta_tools/kubernetes_tools.py:2212: error: Need type annotation for "constraints"  [var-annotated]

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/specs/openapi/converter.py: note: In function "rewrite_properties":
+ src/schemathesis/specs/openapi/converter.py:58: error: Need type annotation for "required"  [var-annotated]
+ src/schemathesis/specs/openapi/negative/mutations.py: note: In function "remove_required_property":
+ src/schemathesis/specs/openapi/negative/mutations.py:190: error: Need type annotation for "properties"  [var-annotated]
+ src/schemathesis/specs/openapi/negative/mutations.py: note: In function "change_items":
+ src/schemathesis/specs/openapi/negative/mutations.py:326: error: Need type annotation for "items"  [var-annotated]
+ src/schemathesis/_xml.py: note: In function "_get_xml_tag":
+ src/schemathesis/_xml.py:55: error: No overload variant of "get" of "dict" matches argument type "str"  [call-overload]
+ src/schemathesis/_xml.py:55: note: Possible overload variants:
+ src/schemathesis/_xml.py:55: note:     def get(self, Never, None = ..., /) -> None
+ src/schemathesis/_xml.py:55: note:     def [_T] get(self, Never, _T, /) -> _T
+ src/schemathesis/_xml.py: note: In function "_write_object":
+ src/schemathesis/_xml.py:99: error: Need type annotation for "options"  [var-annotated]
+ src/schemathesis/_xml.py:108: error: Need type annotation for "properties"  [var-annotated]
+ src/schemathesis/_xml.py:110: error: Need type annotation for "property_schema"  [var-annotated]
+ src/schemathesis/_xml.py:111: error: Need type annotation for "child_options"  [var-annotated]
+ src/schemathesis/_xml.py: note: In function "_write_array":
+ src/schemathesis/_xml.py:133: error: Need type annotation for "options"  [var-annotated]
+ src/schemathesis/_xml.py: note: In function "_write_primitive":
+ src/schemathesis/_xml.py:165: error: Need type annotation for "xml_options"  [var-annotated]
+ src/schemathesis/specs/openapi/security.py: note: In member "get_security_requirements" of class "BaseSecurityPro

... (truncated 716 lines) ...

@tungol tungol closed this Dec 11, 2024
@tungol
Copy link
Contributor Author

tungol commented Dec 11, 2024

This looked very similar to #13222 in my local tests, so it's interesting to see the primer diff is so different.

@tungol tungol deleted the dict-alternate2 branch December 11, 2024 09:55
@tungol
Copy link
Contributor Author

tungol commented Dec 11, 2024

For the record: the main difference with this version (and the thing I wasn't testing for) is when the default value is an empty container type.

d_any: dict[str, Any] = {}
d_lstring: dict["str", list[str]] = {}

v1 = d_lstring.get("key", [])
reveal_type(v1)  # list[str]

# Currently this is just Any, but this change preserves the list, but doesn't know
# what to do with it.
v2 = d_any.get("key", [])  # error: Need type annotation for "v2"  [var-annotated]
reveal_type(v2)  # Any | list[Any]

# and it gets worse when it's nested
reveal_type(d_any.get("key", {}))  # Any | dict[Never, Never]

v3 = d_any.get("key", {})  # Need type annotation for "v3"  [var-annotated]
reveal_type(v3)  # Any | dict[Any, Any]

d_any.get("key1", {}).get("key2", {})  # No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]

It kind of seems reasonable to me to think that mypy could suppress [var-annotated] if it's in a union with Any. Getting dict[Any, Any] instead of dict[Never, Never] in this context seems like a big lift, and who knows what else that would affect.

Side note, the reproduction for the pyinstrument error oddly depends on Unpack being assigned to an alias before being used. When Unpack is used directly, the error occurs without this change.

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.

1 participant