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

Investigate behavior changes from #1606 #1684

Closed
jacobtylerwalls opened this issue Jul 5, 2022 · 1 comment · Fixed by #1686
Closed

Investigate behavior changes from #1606 #1684

jacobtylerwalls opened this issue Jul 5, 2022 · 1 comment · Fixed by #1686
Assignees
Milestone

Comments

@jacobtylerwalls
Copy link
Member

Placeholder issue for investigating behavior changes reported in pylint primer after #1606: pylint-dev/pylint#7118 (comment)

I know @DanielNoord is already aware, but just raising visibility to make sure we don't release 2.12 until we have a chance to debug/revert.

@jacobtylerwalls jacobtylerwalls added this to the 2.12.0 milestone Jul 5, 2022
@DanielNoord DanielNoord self-assigned this Jul 5, 2022
@DanielNoord
Copy link
Collaborator

It's a bit difficult to represent what I did, but here goes.

All messages from black are actually fixes 😄 🎉

We no longer emit messages about defining attributes outside of __init__. This is actually an improvement.
Take:
https://github.com/psf/black/blob/b859a377c0bef3793fcceb0efd0086862f6a9365/src/blib2to3/pgen2/conv.py#L68
This shouldn't raise as that attribute is set in the parent class here:
https://github.com/psf/black/blob/b859a377c0bef3793fcceb0efd0086862f6a9365/src/blib2to3/pgen2/grammar.py#L86

This is not related to __new__ but rather to the change in getattr, which now correctly looks up values in parent classes before we exit out of the function.

For Django the one about invalid-name isn't bad as well I think. I think we now correctly infer that this is not the first assignment to Meta and therefore the name issue shouldn't be raised here.

The other issues are related to the lookup of instance attributes. I have a fix for this which I'll push shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants