FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support a small amount of generic converters for attrs by A5rocks · Pull Request #22206 · python/mypy · GitHub

Repository navigation

Support a small amount of generic converters for attrs - #22206

Open
A5rocks wants to merge 1 commit into
python:masterfrom
A5rocks:attrs-generic-converters
Open

A5rocks wants to merge 1 commit into
python:masterfrom
A5rocks:attrs-generic-converters

Conversation

A5rocks commented Oct 14, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

See #8625.

To be honest I don't see why we can't recurse on the converter return type along with the attribute type, and then set all the typevars we see based on the relevant part of the attribute type. I didn't do that since I don't know the right visitor to do so, but presumably I'm missing something that makes this harder?

A5rocks changed the title Support a small amount of #8625 Support a small amount of generic converters for attrs Oct 14, 2026

Copy link
Copy Markdown
Contributor

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

core (https://github.com/home-assistant/core)
+ homeassistant/helpers/device_registry.py:1042: error: Unused "type: ignore" comment  [unused-ignore]
+ homeassistant/helpers/device_registry.py:2187: error: Unused "type: ignore" comment  [unused-ignore]
+ homeassistant/helpers/device_registry.py:4429: error: Unused "type: ignore" comment  [unused-ignore]

scipy-stubs (https://github.com/scipy/scipy-stubs)
- tests/misc/test_submodules_empty.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

A5rocks commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@JukkaL what do you think of this approach? (TBH I don't know which operations are safe or not)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL