Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

iterable_context_py3.py 421B

123456789101112131415161718
  1. """
  2. Checks that iterable metaclasses are recognized by pylint.
  3. """
  4. # pylint: disable=missing-docstring,too-few-public-methods,no-init,no-self-use,unused-argument,bad-mcs-method-argument
  5. # metaclasses as iterables
  6. class Meta(type):
  7. def __iter__(self):
  8. return iter((1, 2, 3))
  9. class SomeClass(metaclass=Meta):
  10. pass
  11. for i in SomeClass:
  12. print(i)
  13. for i in SomeClass(): # [not-an-iterable]
  14. print(i)