This generates an error false positive which is reported on the wrong line so there are likely two bugs:
from typing import Union, Tuple
class C:
def __getattr__(self, name):
pass
class D:
def f(self) -> C: # "C" has no attribute "__iter__" (not iterable)
return C()
def g(self) -> None:
a, b = self.f() # This is where the error originates from
C should be treated as iterable, since it defines __getattr__.
This generates an error
false positivewhich is reported on the wrong lineso there are likely two bugs:Cshould be treated as iterable, since it defines__getattr__.