Import abstract base classes from collections.abc#867
Merged
davidism merged 1 commit intopallets:masterfrom Aug 7, 2018
The-Compiler:collections
Merged
Import abstract base classes from collections.abc#867davidism merged 1 commit intopallets:masterfrom The-Compiler:collections
davidism merged 1 commit intopallets:masterfrom
The-Compiler:collections
Conversation
The-Compiler
commented
Jun 27, 2018
| 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.
Contributor
Author
|
The Travis failure is unrelated, it happens because Python 3.3 got dropped in |
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this pull request
Jun 27, 2018
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Python 3.7, importing ABCs directly from the
collectionsmodule shows awarning (and in Python 3.8 it will stop working) - see
python/cpython@c66f9f8
This fixes various DeprecationWarnings such as those: