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

move to collections.abc sooner #204

Open
tomhea opened this issue Jun 7, 2022 · 3 comments
Open

move to collections.abc sooner #204

tomhea opened this issue Jun 7, 2022 · 3 comments

Comments

@tomhea
Copy link
Contributor

tomhea commented Jun 7, 2022

Hi!

Just noticed that the deprecation warning of importing from 'collections' instead of from 'collections.abc' (the reason for version 0.98.3) seems to be sooner than python 3.10, according to the message I just got using python 3.8.8 (anaconda):

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working

It collides with the what's written in the code, only switching the import at python 3.10, not 3.9

Moreover, in version python 3.8 it still issues a warning when importing from collections.

I suggest importing from collections.abc in default, and importing from collections if sys.version_info < (3, 3) (which is the version collections.abc was first introduced).

My worries are that in python 3.9 the module might not work, and that users from previous versions might see a warning each time they use this module.

@zadacka
Copy link
Collaborator

zadacka commented Jun 8, 2022

That is a good point.

The reason why we switched at v3.10 was that subsequent versions of Python had completely moved the import and did not provide a back-portable alias. However, as you have pointed out, the intermediate versions (3.3->3.9) will emit deprecation warnings which is noisy and easily avoidable.

Thanks for raising this - I'll aim to switch the import location from an earlier version and this will stop the noise.

@tomhea
Copy link
Contributor Author

tomhea commented Aug 2, 2022

@zadacka Hi! it still bothers me so I pull-requested (#205) the patched version :)

@zadacka
Copy link
Collaborator

zadacka commented Aug 3, 2022 via email

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

2 participants