Skip to content

Use collections.abc where applicable#15

Open
musicinmybrain wants to merge 1 commit into
prechelt:masterfrom
musicinmybrain:collections-abc
Open

Use collections.abc where applicable#15
musicinmybrain wants to merge 1 commit into
prechelt:masterfrom
musicinmybrain:collections-abc

Conversation

@musicinmybrain

Copy link
Copy Markdown
Contributor

Beginning with Python 3.3 (the earliest currently-supported version)
Sequence, Mapping, MutableMapping, and the other abstract base classes
for containers appear in in collections.abc. Beginning with Python 3.10,
they are removed from collections.

Using the collections.abc import where applicable provides
forward-compatibility with Python 3.10+ without breaking Python 3.3+.

(Some additional changes are still needed for Python 3.7–3.10 compatibility.)

Beginning with Python 3.3 (the earliest currently-supported version)
Sequence, Mapping, MutableMapping, and the other abstract base classes
for containers appear in in collections.abc. Beginning with Python 3.10,
they are removed from collections.

Using the collections.abc import where applicable provides
forward-compatibility with Python 3.10+ without breaking Python 3.3+.
@musicinmybrain

Copy link
Copy Markdown
Contributor Author

The last issue I see for enabling Python 3.7–3.10 support is that GenericMeta and CallableMeta have been removed from typing in the standard library. I’m not sure at a glance what the correct workaround is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant