0

I keep getting warnings from pylint while trying to iterate over an attribute in a class that uses the attrs package.

from typing import List
from attrs import define, Factory

@define
class MyClass:
  my_list: List[str] = Factory(list)

  def my_method(self):
    for i in self.my_list:
      continue

I expect no problems but get Non-iterable value is using in an iterating context from pylint.

Found some older threads mentioning poor compatibility of pylint with attrs but I though it would be better now.

Is there anything I can do different instead of ignore this warnings?

0

Browse other questions tagged or ask your own question.