You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classFoo:
__ACLASSATTR=0def__init__(n: int):
self.__n=n@propertydefn(self):
"""The n getter."""returnself.__n@n.setterdefn(self, new_n: int):
"""The n setter befor @classmethod creates a warning."""self.__n=new_n@classmethoddefa_classattr(cls):
returncls.__ACLASSATTR
Behavior
What expected (to my mind)
no warning
Current result
Foo.n should be after Foo.a_classattr
Discussion
Because of the false positive result of mypy (see python/mypy#1465) the two warnings make the problem unfeasible.
But I think it is a great idea to keep getter and setter near to each other for the same attribute.
So let consider you have to keep setter just after the getter
Versions
Python:3.9.5
flake8:3.9.0
flake8-class-attributes-order:0.1.2
Thank you for your work!
The text was updated successfully, but these errors were encountered:
False positive description
Behavior
What expected (to my mind)
no warning
Current result
Foo.n should be after Foo.a_classattr
Discussion
Because of the false positive result of mypy (see python/mypy#1465) the two warnings make the problem unfeasible.
But I think it is a great idea to keep getter and setter near to each other for the same attribute.
So let consider you have to keep setter just after the getter
Versions
3.9.5
3.9.0
0.1.2
Thank you for your work!
The text was updated successfully, but these errors were encountered: