pbugnion / gmaps

Google maps for Jupyter notebooks
https://jupyter-gmaps.readthedocs.io/en/stable/
Other
760 stars 146 forks source link

Import collections.abc if missing from base class #353

Closed whudson closed 1 year ago

whudson commented 2 years ago

This PR addresses https://github.com/pbugnion/gmaps/issues/352.

Try to access the abstract base classes on the collections object, and if we cannot they need to be accessed from collections.abc.

timcoote commented 2 years ago

A thought on this: since python 3.3, the canonical way to get at the classes Iterable and Sequence has been via collections.abc. From the pypi page, I think that the first Python3 supported version for gmaps is 3.5. So would it make sense to make the code more idomatic, rather than aliasing collections.abc as collections to reduce future confusion?

If earlier versions of Python 3 are intended to be supported, then should there be a test to warn about unnecessary code for later versions?