Attempt to fix issue #43
This PR successfully silences the error so autoclass works with Python 3.9. I have not investigated the code in depth to be cable to guarantee it as a full solution.
Thanks a lot @erocarrera ! Sorry for not spotting your PR sooner.
As commented above, it seems that you modified a try/except branch that was dedicated to a special case of python 2... So the issue is rather to understand why the code on python 3.8+ enters this branch at all, in other words to understand why
cls.__bases__ = new_bases
fails in the first place.
(replying to https://github.com/smarie/python-autoclass/pull/44#discussion_r697876595 )
Perfect @erocarrera thanks for the feedback ! Indeed moving to pyfields when possible is probably a better choice. I did not yet found time to fix this autoclass issue, sorry :( we'll see if many users are interested or if they all move away to pyfields, attrs, dataclasses and the like