Skip to content

Conversation

@mdumandag
Copy link
Contributor

Abstract classes Sequence and Iterable are meant to be imported
from collections.abc instead of collections starting from
Python 3.3. Since the minimum supported Python version for the
client is 3.4, we can safely try to import it from the new location
and fallback to the old location if the import fails. It will only
fail for Python 2.7 in which it is fine to import those abstract
classes from collections.

Closes #384

Abstract classes Sequence and Iterable are meant to be imported
from `collections.abc` instead of `collections` starting from
Python 3.3. Since the minimum supported Python version for the
client is 3.4, we can safely try to import it from the new location
and fallback to the old location if the import fails. It will only
fail for the Python 2.7 in which it is fine to import those abstact
classes from `collections`.
@mdumandag mdumandag added this to the 4.1 milestone Mar 23, 2021
@mdumandag mdumandag self-assigned this Mar 23, 2021
Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reproduce the warning in the issue? I could not do it.

@mdumandag
Copy link
Contributor Author

Strangely, I also cannot reproduce the warning (tested on python 3.6, 3.7, and 3.9) and our nightly python 3.9 test runner works just fine but I see that it is merged in python/cpython@ef092fe

Anyways, let's use this version just to be sure

@mdumandag mdumandag merged commit e32f341 into hazelcast:master Mar 24, 2021
@mdumandag mdumandag deleted the use-correct-abcs branch March 24, 2021 15:02
tlusk pushed a commit to carbonblack/hazelcast-python-client that referenced this pull request Apr 15, 2021
Abstract classes Sequence and Iterable are meant to be imported
from `collections.abc` instead of `collections` starting from
Python 3.3. Since the minimum supported Python version for the
client is 3.4, we can safely try to import it from the new location
and fallback to the old location if the import fails. It will only
fail for the Python 2.7 in which it is fine to import those abstact
classes from `collections`.
@degerhz degerhz changed the title Do not use deprecated abstract classes from collections Do not use deprecated abstract classes from collections [API-388] Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation warning: util.py:4

2 participants