-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
brain_attrs: Support annotation-only members #2515
brain_attrs: Support annotation-only members #2515
Conversation
Similar to dataclasses, the following class which uses instance variable annotations is valid: ```py @attrs.define class AttrsCls: x: int AttrsCls(1).x ``` However, before this commit astroid failed to transform the class attribute into an instance attribute and this led to `no-member` errors in pylint. Only the new `attrs` API supports this form out-of-the-box, so just address the common case. Closes pylint-dev#2514
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## maintenance/3.3.x #2515 +/- ##
====================================================
Coverage ? 92.99%
====================================================
Files ? 93
Lines ? 11043
Branches ? 0
====================================================
Hits ? 10269
Misses ? 774
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thank you. Daniel Will you merge it? I don’t have the permissions.
…On Sun, Aug 25, 2024 at 4:24 PM Daniël van Noord ***@***.***> wrote:
***@***.**** approved this pull request.
—
Reply to this email directly, view it on GitHub
<#2515 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADRDKR3K33P5M5L2JZDK6LZTI4O7AVCNFSM6AAAAABM7KMIBGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENJZGM3DOMRYHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
5eae215
into
pylint-dev:maintenance/3.3.x
Thank you @Hnasar, clean PR ! |
@Hnasar for your next contribution, could you always target |
Never mind, this will be taken care of in our usual release process. |
Similar to dataclasses, the following class which uses instance variable annotations is valid:
However, before this commit astroid failed to transform the class attribute into an instance attribute and this led to
no-member
errors in pylint.Only the new
attrs
API supports this form out-of-the-box, so just address the common case.Type of Changes
Closes #2514