在引用迭代器和迭代对象时
from collections import Iterable
from collections import Iterator
出现以下错误:
: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Iterable
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Iterator
修改为如下代码,即可消除错误:
from collections.abc import Iterable
from collections.abc import Iterator