Total Complexity | 6 |
Total Lines | 13 |
Duplicated Lines | 0 % |
1 | # -*- coding: utf-8 -*- |
||
17 | @with_metaclass(ABCMeta) |
||
18 | class NonStringIterable(object): |
||
19 | @abstractmethod |
||
20 | def __iter__(self): |
||
21 | while False: |
||
22 | yield None |
||
23 | |||
24 | @classmethod |
||
25 | def __subclasshook__(cls, C): |
||
26 | if cls is NonStringIterable: |
||
27 | if any("__iter__" in B.__dict__ for B in C.__mro__): |
||
28 | return True |
||
29 | return NotImplemented |
||
30 |