-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import abstract base classes from collections.abc #867
Conversation
from collections import Mapping | ||
Mapping.register(Context) | ||
except ImportError: | ||
pass |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
MutableMapping.register(LRUCache) | ||
except ImportError: | ||
pass | ||
abc.MutableMapping.register(LRUCache) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
The Travis failure is unrelated, it happens because Python 3.3 got dropped in |
In Python 3.7, importing ABCs directly from the `collections` module shows a warning (and in Python 3.8 it will stop working) - see python/cpython@c66f9f8 This fixes various DeprecationWarnings such as those: ``` .../jinja2/utils.py:485: 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 MutableMapping .../jinja2/runtime.py:318: 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 Mapping ```
Looking at the changelog: this fix doesn't seem to be released yet, right? |
In Python 3.7, importing ABCs directly from the
collections
module shows awarning (and in Python 3.8 it will stop working) - see
python/cpython@c66f9f8
This fixes various DeprecationWarnings such as those: