class MyIteration:
def __iter__(self):
pass
inter_obj = MyIteration()
from _collections_abc import Iterable
result = isinstance(inter_obj,Iterable)
print(result)
查看一个类是否可迭代
最新推荐文章于 2024-07-06 16:25:50 发布
class MyIteration:
def __iter__(self):
pass
inter_obj = MyIteration()
from _collections_abc import Iterable
result = isinstance(inter_obj,Iterable)
print(result)