Skip to content

allow Any type in Mapping.get#15379

Draft
randolf-scholz wants to merge 1 commit intopython:mainfrom
randolf-scholz:mapping_get_any
Draft

allow Any type in Mapping.get#15379
randolf-scholz wants to merge 1 commit intopython:mainfrom
randolf-scholz:mapping_get_any

Conversation

@randolf-scholz
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

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

starlette (https://github.com/encode/starlette)
- tests/test_datastructures.py:171: note:     def get(self, str, /) -> str | None
+ tests/test_datastructures.py:171: note:     def get(self, Any, /) -> str | None
- tests/test_datastructures.py:171: note:     def get(self, str, str, /) -> str
+ tests/test_datastructures.py:171: note:     def get(self, Any, str, /) -> str
- tests/test_datastructures.py:171: note:     def [_T] get(self, str, _T, /) -> str | _T
+ tests/test_datastructures.py:171: note:     def [_T] get(self, Any, _T, /) -> str | _T
- tests/test_datastructures.py:287: note:     def get(self, str, /) -> str | None
+ tests/test_datastructures.py:287: note:     def get(self, Any, /) -> str | None
- tests/test_datastructures.py:287: note:     def get(self, str, str, /) -> str
+ tests/test_datastructures.py:287: note:     def get(self, Any, str, /) -> str
- tests/test_datastructures.py:287: note:     def [_T] get(self, str, _T, /) -> str | _T
+ tests/test_datastructures.py:287: note:     def [_T] get(self, Any, _T, /) -> str | _T
- tests/test_datastructures.py:371: note:     def get(self, str, /) -> UploadFile | str | None
+ tests/test_datastructures.py:371: note:     def get(self, Any, /) -> UploadFile | str | None
- tests/test_datastructures.py:371: note:     def get(self, str, UploadFile | str, /) -> UploadFile | str
+ tests/test_datastructures.py:371: note:     def get(self, Any, UploadFile | str, /) -> UploadFile | str
- tests/test_datastructures.py:371: note:     def [_T] get(self, str, _T, /) -> UploadFile | str | _T
+ tests/test_datastructures.py:371: note:     def [_T] get(self, Any, _T, /) -> UploadFile | str | _T

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/_internal/_utils.py:204: error: Unused "type: ignore" comment  [unused-ignore]

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, Any, /) -> _VT | None
- steam/ext/commands/utils.py:43: note:          def get(self, str, _VT, /) -> _VT
+ steam/ext/commands/utils.py:43: note:          def get(self, Any, _VT, /) -> _VT
- steam/ext/commands/utils.py:43: note:          def [_T] get(self, str, _T, /) -> _VT | _T
+ steam/ext/commands/utils.py:43: note:          def [_T] get(self, Any, _T, /) -> _VT | _T
+ steam/package.py:215: error: Unused "type: ignore" comment  [unused-ignore]
+ steam/package.py:216: error: Unused "type: ignore" comment  [unused-ignore]

operator (https://github.com/canonical/operator)
- ops/model.py:1016: note:          def get(self, str, /) -> Binding | None
+ ops/model.py:1016: note:          def get(self, Any, /) -> Binding | None
- ops/model.py:1016: note:          def get(self, str, Binding, /) -> Binding
+ ops/model.py:1016: note:          def get(self, Any, Binding, /) -> Binding
- ops/model.py:1016: note:          def [_T] get(self, str, _T, /) -> Binding | _T
+ ops/model.py:1016: note:          def [_T] get(self, Any, _T, /) -> Binding | _T

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web_app.py:188: error: Unused "type: ignore" comment  [unused-ignore]

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