Code example:
from typing import List
class MyList(List[int]):
def total(self) -> int:
return sum(i for i in self)
a = MyList([1,2,3])
print(f'{a.total()=:}')
When I run it, it works
a.total()=6
But when I use pylint, I get the following error
...
toy.py:5:30: E1133: Non-iterable value self is used in an iterating context (not-an-iterable)
...
There are other pylint errors, but they're understandable. For the not-an-iterable problem, I don't quite understand it, am I subclassing List[int], correctly?
I'm using Python-3.8, pylint==2.6.0