-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add @final
to slice
/memoryview
/range
#6289
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
Conversation
None of these classes can be subclassed at runtime.
Looks like you found a mypy bug: ast.pyi defines its own class called slice, but somehow it's checking |
This comment has been minimized.
This comment has been minimized.
😣 |
Hmm, the other weird thing is that the mypy tests pass, it's only when running the mypy build in the stubtest invocation does it fail... |
hmm hmm hmm, locally:
|
Spent some more time digging through mypy code, it's pretty thorny. Here's a one character fix:
There's really a lot going on here: 1) collision with a name in builtins, 2) builtins depending on ast, 3) ast doing |
Amazing, thanks for looking into it! I'll see if I can edit my patch tomorrow. |
Thanks for investigating @hauntsaninja! Not sure if it will make a difference, but it looks like we can also remove |
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Huzzah! |
None of these classes can be subclassed at runtime.