schematics/schematics

ListType is "Non-iterable" in pylint

zachliu opened this issue · 1 comments

class Account(Model):
    name = StringType(required=True)

class MyConfig(Model):
    accounts = ListType(ModelType(Account), required=True)

myconfig = MyConfig({'accounts': [{'name': 'a1'}, {'name': 'a2'}, {'name': 'a3'}]})

for item in myconfig.accounts:
    # do stuff

pylint says this about the for loop:
Non-iterable value myconfig.accounts is used in an iterating context (not-an-iterable)

Bump