easygui icon indicating copy to clipboard operation
easygui copied to clipboard

move to collections.abc sooner

Open tomhea opened this issue 3 years ago • 3 comments

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.

tomhea avatar Jun 07 '22 19:06 tomhea

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.

zadacka avatar Jun 08 '22 06:06 zadacka

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

tomhea avatar Aug 02 '22 22:08 tomhea

Thank you - yep, given that the new import is already available we might as well change it to use the newer one.

On Tue, 2 Aug 2022 at 23:31, tomhea @.***> wrote:

@zadacka https://github.com/zadacka Hi! it still bothers me so I pull-requested (#205 https://github.com/robertlugg/easygui/pull/205) the patched version :)

— Reply to this email directly, view it on GitHub https://github.com/robertlugg/easygui/issues/204#issuecomment-1203276885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2XZIODZNVBOOYL7XVA7TTVXGOULANCNFSM5YEBRJRQ . You are receiving this because you were mentioned.Message ID: @.***>

zadacka avatar Aug 03 '22 06:08 zadacka