robertlugg / easygui

easygui for Python
http://easygui.readthedocs.org/en/master/
BSD 3-Clause "New" or "Revised" License
458 stars 115 forks source link

Update choice_box.py #187

Closed hrpzcf closed 2 years ago

hrpzcf commented 2 years ago

Change the import method of 'Sequence'. The incompatibility with Python 3.10 may have been fixed.

zadacka commented 2 years ago

So, it looks like Sequence moved from Collections to Collections.abc in Py 3.3 but was still made available through Collections until v3.9 inclusive as a compatibility measure: https://docs.python.org/3.9/library/collections.html

Importing from the correct location will be necessary for Py3.10 - this looks good to me.

hrpzcf commented 2 years ago

So, it looks like Sequence moved from Collections to Collections.abc in Py 3.3 but was still made available through Collections until v3.9 inclusive as a compatibility measure: https://docs.python.org/3.9/library/collections.html

Importing from the correct location will be necessary for Py3.10 - this looks good to me.

I need to say sorry to you, I did not consider python2 when I changed the code, so I only verified ‘sys.version_info.minor’ without verifying ‘major’. This is a serious mistake, and it will make easygui not work properly on python2, Maybe should change 'if sys.version_info.minor <10' to'sys.version_info <(3, 10, 0)'.

zadacka commented 2 years ago

Python 2 never went over minor version 10, so this should be okay, won't it?

That said, using the minor and major version does sound preferable - could you submit a PR for the sys.version_info approach please?