When using docplext.cp with warnings enabled, I get this warning:
venv/lib/python3.7/site-packages/docplex/cp/utils.py:30: 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 deque, Iterable # Python < 3.7
Reproduction (note "-Wd" in the command-line to enable warnings):
> python -Wd
Python 3.7.4 (default, Jul 15 2019, 15:55:25)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from docplex.cp.expression import integer_var
It seems that there is deliberate code to handle this, but it isn't working as intended.
This code in docplex/cp/utils.py (around line 30):
try:
from collections.abc import deque, Iterable # Python >= 3.7
except:
from collections import deque, Iterable # Python < 3.7
Should be changed to:
from collections import deque
try:
from collections.abc import Iterable # Python >= 3.7
except:
from collections import Iterable # Python < 3.7
Thanks,
Tomer
------------------------------
Tomer Vromen
------------------------------
#DecisionOptimization