Eric V. Smith <[email protected]> added the comment:
You can also cause this same error without dataclasses:
from typing import TypeVar, Generic
from types import new_class
MyTypeVar = TypeVar("MyTypeVar")
MyParent = new_class("MyParent", (Generic[MyTypeVar],), {})
c = type('MyChild', (MyParent[int],), {}) # error in 3.8
I assume you get the same error in 3.7, but I can't compile it just now.
The above code works in 3.6. And the code in dataclass_metaclass_issue.py works
in 3.6, using the backported dataclasses.py from PyPI.
So it seems this is a typing problem, not a dataclasses problem.
+Ivan, in case he has some insights.
----------
nosy: +levkivskyi
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33188>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com