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 forward references and generic inheritance in attrs classes #12772

Merged
merged 14 commits into from
May 13, 2022

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 12, 2022

Move the attrs plugin to a later pass, so that we won't have placeholders. Fix
various issues related to forward references and generic inheritance, including
some crashes.

This is follow-up to #12762 and related to #12656 and #12633.

@github-actions

This comment has been minimized.

@JukkaL
Copy link
Collaborator Author

JukkaL commented May 12, 2022

The new errors from home-assistant look a bit suspicious. Maybe unsupported converters now generate too many errors.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

return True

for super_info in ctx.cls.info.mro[1:-1]:
if 'attrs_tag' in super_info.metadata and 'attrs' not in super_info.metadata:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe at some point we should switch to using constants (e.g. to avoid typos).

@JukkaL JukkaL merged commit 50a653e into master May 13, 2022
@JukkaL JukkaL deleted the fix-attrs-plugin branch May 13, 2022 13:49
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.

2 participants