Skip to content

Add alias support to field() in attrs plugin#16610

Merged
sobolevn merged 1 commit intomasterfrom
issue-16586
Dec 7, 2023
Merged

Add alias support to field() in attrs plugin#16610
sobolevn merged 1 commit intomasterfrom
issue-16586

Conversation

@sobolevn
Copy link
Copy Markdown
Member

@sobolevn sobolevn commented Dec 4, 2023

Closes #16586
CC @ikonst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 4, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Comment thread mypy/plugins/attrs.py
name = unmangle(lhs.name)
return Attribute(
name, ctx.cls.info, attr_has_default, init, kw_only, converter_info, stmt, init_type
name, alias, ctx.cls.info, attr_has_default, init, kw_only, converter_info, stmt, init_type
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One day we'll make it kw-only :)

@sobolevn sobolevn merged commit 88bf6f2 into master Dec 7, 2023
@sobolevn sobolevn deleted the issue-16586 branch December 7, 2023 13:37
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 plugin ignores field alias

2 participants