-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Regression with not-callable #3595
Comments
This reverts commit bbe55fa. Due to pylint-dev/pylint#3595
Experiencing the same issue on the Home Assistant project:
|
I hit this as well, issue only occurs when the method is named |
Same issue with generator in class method class PaginatedResponse(Response):
"""A paginated response returned by the API"""
@property
def results(self):
return self.data['results']
@property
def total(self):
return self.data['paging']['total']
@property
def limit(self):
return self.data['paging']['limit']
@property
def offset(self) -> int:
return self.data['paging']['offset']
def has_next(self) -> bool:
return self.offset + self.limit < self.total
def has_prev(self) -> bool:
return self.offset > 0
def next(self):
offset = min(self.offset + self.limit, self.total)
return self._request_with_params(offset=offset)
def prev(self):
offset = max(0, self.offset - self.limit)
return self._request_with_params(offset=offset)
def _request_with_params(self, **params):
url = urlparse(self.url)
query = parse_qs(url.query)
query.update(params)
return self._client.get(url.path, params=query)
def __iter__(self):
return iter(self.results)
def auto_paging_iter(self):
req = self
for result in req:
yield result
while req.has_next():
req = req.next() # noqa Wait for https://github.com/PyCQA/pylint/issues/3595
for result in req:
yield result |
same issue for me, here a reduced test case import typing
class A:
def next(self):
pass
def wait(self):
self.next() no error if module 'typing' is not imported, or if the |
I can repro on master It looks like this issue is only triggered in pylint: Inference and astroid works here: import astroid
ret = astroid.extract_node("""
import typing
class A:
def next(self):
return 1
def wait(self):
self.next() #@
""")
inferred = ret.func.inferred()
print("inferred", inferred)
print("callable", inferred[0].callable())
print("Instance", isinstance(inferred[0], astroid.Instance))
But when calling your example with pylint. On line
strange |
Steps to reproduce
Current behavior
Expected behavior
I don't see why those lines are not-callable.
self._player.next()
is defined as a regular method.pylint --version output
The text was updated successfully, but these errors were encountered: