Open lucasew opened 2 years ago
Duplicate of #87, which has better compatibility.
typing.Iterable
is just a generic fork of collections.abc.Iterable
, and was deprecated in 3.9.
This one should work for newer Python versions, while not breaking compatibility with older ones:
try:
from collections.abc import Iterable
except ImportError: # py < 3.3
from collections import Iterable
My worry is that this breaks backward compatibility because the
typing
module was added on Python 3.5 [1], so it would only work on Python 3.5 and above.We realized this because the nixpkgs CI [2] fails to package this library to be used by other dependents. It's not that a huge problem because basically all of the stuff depends on the version based on Python 3.9, that works fine [3].
[1] https://docs.python.org/3/library/typing.html
[2] https://hydra.nixos.org/job/nixpkgs/trunk/python310Packages.fn.x86_64-linux
[3] https://hydra.nixos.org/job/nixpkgs/trunk/python39Packages.fn.x86_64-linux
Closes https://github.com/kachayev/fn.py/issues/91 https://github.com/kachayev/fn.py/issues/86