Eric V. Smith <e...@trueblade.com> added the comment:

dataclasses is no doubt too lenient. But it's just trying to accept valid 
strings that look like ClassVar. Way back when this was initially implemented, 
we decided that calling get_type_hints would be too expensive for every 
dataclass, and would also neccesitate importing typing, which we didn't want to 
require.

I think someone needs to do an analysis of how expensive it would be for 
dataclasses to import typing and to call get_type_hints. Perhaps we'd make a 
different decision today.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46553>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to