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
Are you reporting a bug, or opening a feature request? Bug
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
class Works:
def __init__(self):
self._a = 0
@property
def a(self):
return self._a
@a.setter
def a(self, value):
self._a = value
class Doesnt:
def __init__(self):
self._a = 0
@property
def a(self):
return self._a
def another_method(self):
print("This is unimportant")
@a.setter
def a(self, value):
self._a = value
What is the actual behavior/output?
test-mypy.py:25: error: Name 'a' already defined on line 18
test-mypy.py:25: error: "Callable[[Any], Any]" has no attribute "setter"
What is the behavior/output you expect?
That parts of a property definition do not have to follow each other directly to be recognized as such.
What are the versions of mypy and Python you are using?
Python: 3.6.5
Mypy: 0.720
Do you see the same issue after installing mypy from Git master? Yes
What are the mypy flags you are using? (For example --strict-optional) None
The text was updated successfully, but these errors were encountered:
Bug
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
That parts of a property definition do not have to follow each other directly to be recognized as such.
Python: 3.6.5
Mypy: 0.720
Yes
None
The text was updated successfully, but these errors were encountered: