cjdrake / pyeda

Python EDA
BSD 2-Clause "Simplified" License
301 stars 55 forks source link

Python 3.10 compatibility - Use of deprecated alias to Collections.abc.Sequence #171

Closed delta1513 closed 1 year ago

delta1513 commented 1 year ago

Just stumbled upon this project and decided to take it for a little spin when I found that I was getting this error when trying out the truth tables tutorial:

>>> X = exprvars('x', 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mark/.local/lib/python3.10/site-packages/pyeda/boolalg/bfarray.py", line 201, in exprvars
    return _vars(Expression, name, *dims)
  File "/home/mark/.local/lib/python3.10/site-packages/pyeda/boolalg/bfarray.py", line 976, in _vars
    return farray(objs, shape, ftype)
  File "/home/mark/.local/lib/python3.10/site-packages/pyeda/boolalg/bfarray.py", line 430, in __init__
    self._items, autoshape, autoftype = _itemize(objs)
  File "/home/mark/.local/lib/python3.10/site-packages/pyeda/boolalg/bfarray.py", line 1032, in _itemize
    if not isinstance(objs, collections.Sequence):
AttributeError: module 'collections' has no attribute 'Sequence'

Looks like an easy fix, might even make a fork and PR myself but going from Python 3.9 to 3.10, the aliases to Collections.abc. have been removed from Collections. as shown here and in the docs.

Feel free to assign me to this issue and I'll have a PR made soon.

delta1513 commented 1 year ago

I just realised that this was already in a PR ( #167 ) so it looks like it was the fact that the PyPi package was not updated (?)

I'll build manually and close this issue if it works.