pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

non-iterator-returned is not smart enough #679

Closed pylint-bot closed 8 years ago

pylint-bot commented 9 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore)


There are some cases which are omitted by the non-iterator-returned checker, which handles only Instances.

For instance, the following needs to be caught:

#!python

class B:
   pass

class Foo:
   def __iter__(self):
        return B

for i in Foo(): pass

pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


non-iterator-returned can detect classes with iterator-metaclasses.

Closes issue #679.