问题描述
使用 from collections import Iterable 时出现了如下警告:
问题分析
这个异常报错是导入collections的原因,上面说python3.8版本不在支持collections,建议使用collections.abc
解决方法
# from collections import Iterable
from collections.abc import Iterable
print(isinstance('abc', Iterable))
把collections 替换为 collections.abc 就不会有警告了~