Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.9: TypeError: Multiple inheritance with NamedTuple is not supported #2

Closed
AndrewJSchoen opened this issue Dec 14, 2020 · 2 comments

Comments

@AndrewJSchoen
Copy link

Cool project!

I tried to load something from the package in Python 3.9

from redux import create_feature_module

but received the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/redux/__init__.py", line 6, in <module>
    from .store import create_store
  File "/usr/local/lib/python3.9/site-packages/redux/store.py", line 21, in <module>
    from .action import create_action
  File "/usr/local/lib/python3.9/site-packages/redux/action.py", line 10, in <module>
    from .types import Action, PayloadType
  File "/usr/local/lib/python3.9/site-packages/redux/types.py", line 25, in <module>
    class Action(NamedTuple, Generic[PayloadType]):
  File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 1820, in _namedtuple_mro_entries
    raise TypeError("Multiple inheritance with NamedTuple is not supported")
TypeError: Multiple inheritance with NamedTuple is not supported

Maybe some limits on multiple inheritance were added in 3.9?

@CarstenLeue
Copy link
Contributor

Thanks for the report, I'll double check

@Carsten-Leue
Copy link
Owner

Supposed to be fixed in the latest version. The combination of named tuple and generic is no longer possible in python 3.9
I have removed the typevar. Is there a better solution?

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

No branches or pull requests

3 participants