使用 from collections import Iterable 时
会有如下警告:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it willstop working
翻译:弃用警告:从collections中导入ABCs已被弃用,并在python3.8中将停止工作,可使用collections.abc代替它进行使用
# from collections import Iterable
from collections.abc import Iterable
print(isinstance('abc', Iterable))
把collections 替换为 collections.abc 就不会有警告了~