Skip to content

Fix Python 3.10+ compatibility: use collections.abc.Iterable#47

Open
Mr-Neutr0n wants to merge 1 commit intoeyurtsev:masterfrom
Mr-Neutr0n:fix/collections-iterable-deprecation
Open

Fix Python 3.10+ compatibility: use collections.abc.Iterable#47
Mr-Neutr0n wants to merge 1 commit intoeyurtsev:masterfrom
Mr-Neutr0n:fix/collections-iterable-deprecation

Conversation

@Mr-Neutr0n
Copy link

Summary

  • Replace deprecated collections.Iterable with collections.abc.Iterable in containers.py

Changes

  • Changed import collections to import collections.abc
  • Changed isinstance(gate_lw, collections.Iterable) to isinstance(gate_lw, collections.abc.Iterable)

Background

collections.Iterable (and other ABCs) were deprecated in Python 3.3 and removed in Python 3.10. They should be imported from collections.abc instead.

This is a follow-up to the fix in #44 which addressed collections.MutableMapping. The collections.Iterable usage was missed.

Test plan

  • Verified the fix maintains the same behavior
  • The functionality (checking if gate_lw is iterable) is preserved

Related to #44

🤖 Generated with Claude Code

Replace deprecated collections.Iterable with collections.abc.Iterable
in containers.py.

collections.Iterable was deprecated in Python 3.3 and removed in
Python 3.10.

Related to eyurtsev#44

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mr-Neutr0n
Copy link
Author

just checking in on this — Python 3.10 moved Iterable from collections to collections.abc. this fixes the resulting ImportError

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

Successfully merging this pull request may close these issues.

1 participant