Skip to content
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

collections.abc isn't handled by install_aliases #525

Open
bhrutledge opened this issue Oct 31, 2019 · 1 comment
Open

collections.abc isn't handled by install_aliases #525

bhrutledge opened this issue Oct 31, 2019 · 1 comment

Comments

@bhrutledge
Copy link
Contributor

I want to do isinstance(obj, Iterable).

In Python 2: from collections import Iterable

In Python 3: from collections.abc import Iterable

But, collections.abc isn't part of future.standard_library.install_aliases. Could it be?

Not sure it's helpful, but there's an open PR to add it to six.moves: benjaminp/six#241

@bhrutledge bhrutledge changed the title collections.abc handled by install_aliases collections.abc isn't handled by install_aliases Oct 31, 2019
@bhrutledge
Copy link
Contributor Author

Here's another implementation:

https://github.com/jaraco/jaraco.compat/blob/master/py33compat/collections/abc.py

After pip install jaraco.compat:

from py33compat.collections.abc import Iterable

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

No branches or pull requests

1 participant