-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
False negative when accessing annotated class attributes #13103
Comments
Some hints:
|
This might be related: class X:
__slots__ = ('x',)
x: int = 1
# Traceback (most recent call last):
# File "...", line ..., in <module>
# class X:
# ValueError: 'x' in __slots__ conflicts with class variable
reveal_type(X.x) # int
reveal_type(X().x) # int Mypy gives no errors, pylint complains |
Hello :) |
My first go at contributing, let me know if you had something else in mind @JukkaL |
Any updates on this? |
Fixed #13103 Adds a check to class attribute access to ensure it isn't a defined slot.
Consider this example:
I expect to get
member_descriptor
and someCallable
, but instead i see two wrong reveals and one error.I can use this bug to write unsafe code:
My Environment
mypy 0.961 (compiled: no)
CPython 3.10.4
The text was updated successfully, but these errors were encountered: