Skip to content

Fix generic inheritance for attrs init methods #9383

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

Merged
merged 3 commits into from
Nov 28, 2020

Conversation

natemcmaster
Copy link
Contributor

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

Maybe this message on python-dev provides a clue?

https://mail.python.org/archives/list/[email protected]/message/TJE5XWLKRC3EQUXKSHCJNA25H3WGVP5B/

@JelleZijlstra
Copy link
Member

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

@natemcmaster
Copy link
Contributor Author

CI is passing now on this PR. :)

@natemcmaster
Copy link
Contributor Author

Friendly bump for review :)

@natemcmaster
Copy link
Contributor Author

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

Thank you again! :-)

@natemcmaster natemcmaster deleted the attr-generic branch November 28, 2020 02:11
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