Message314708
| Author | eric.smith |
|---|---|
| Recipients | Ricyteach, eric.smith, levkivskyi |
| Date | 2018-03-30.19:52:17 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1522439537.62.0.467229070634.issue33188@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-03-30 19:52:17 | eric.smith | set | recipients: + eric.smith, levkivskyi, Ricyteach |
| 2018-03-30 19:52:17 | eric.smith | set | messageid: <1522439537.62.0.467229070634.issue33188@psf.upfronthosting.co.za> |
| 2018-03-30 19:52:17 | eric.smith | link | issue33188 messages |
| 2018-03-30 19:52:17 | eric.smith | create | |