Visitar URL original
Fix generic inheritance for attrs init methods by natemcmaster · Pull Request #9383 · python/mypy · GitHub
The Wayback Machine - https://web.archive.org/web/20221225155415/https://github.com/python/mypy/pull/9383
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

Fix generic inheritance for attrs init methods #9383

Merged
merged 3 commits into from Nov 28, 2020

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Aug 30, 2020

Description

Fixes #5744

Updates the attrs plugin. Instead of directly copying attribute type along the MRO, this first resolves typevar in the context of the subtype.

Test Plan

Added 4 new test cases to cover various generic inheritance scenarios.

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Aug 31, 2020 •

It seems CI is currently broken on this project. The errors in windows builds appear to be a problem with the C++ toolchain, and on Travis, something is broken with setuptools. Not sure how to resolve those errors as they appear unrelated to my proposed changes.

@gvanrossum
Copy link
Member

gvanrossum commented Aug 31, 2020

@JelleZijlstra
Copy link
Member

JelleZijlstra commented Sep 1, 2020

Looks like pypa/setuptools#2350 (or similar), I'll try to submit a PR using the env var workaround.

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Sep 3, 2020

CI is passing now on this PR. :)

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Sep 30, 2020

Friendly bump for review :)

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Nov 13, 2020

Hello there, checking in again. I merged from master and pushed to my branch to ensure this PR is still merge-conflict free and passing tests. Any chance I can get a review? Thanks!

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Nov 28, 2020

Thank you again! :-)

@natemcmaster natemcmaster deleted the attr-generic branch Nov 28, 2020
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.

[Attrs] Invalid typing of init arguments in subclasses of generics
4 participants