Rick Teachey <[email protected]> added the comment:
> passing keyword arguments to metaclass will be much more rare for dataclasses
> than passing a ready namespace
The impetus of my running into these issues was assuming that things like
`Generic[MyTypeVar]` would "just work" with `make_dataclass`, which seemed like
a valid assumption since the class creation approach made heavy use of by
`dataclasses` implies this:
@dataclass
class MyDclass(Generic[MyTypeVar]):
var: MyTypeVar
The fact that I cannot do this, then, without error is surprising:
MyDclass = make_dataclass("MyDclass", (("var", MyTypeVar),),
bases=(Generic[MyTypeVar],))
I'm not stating it HAS to be fixed. Maybe it doesn't have to. But to me, the
above seems like the reason to do it if it's going to be done.
----------
_______________________________________
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