Skip to content

Allow errors for unsound Self definitions on non-final classes#2221

Open
davidhalter wants to merge 1 commit intopython:mainfrom
davidhalter:allow-unsound-error-self-classvar
Open

Allow errors for unsound Self definitions on non-final classes#2221
davidhalter wants to merge 1 commit intopython:mainfrom
davidhalter:allow-unsound-error-self-classvar

Conversation

@davidhalter
Copy link
Contributor

This comes after #2148 which wants to make this a mandatory error.

But for now it should be totally fine to allow type checkers to error here, since it can clearly be shown to be unsound, see also:

https://discuss.python.org/t/disallow-access-to-class-variables-with-self/105434

I'm happy to revisit the original pull request, but for now I hope this should suffice. I will rerun the automated tests if and once no changes are required.

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.

1 participant