Gregory Beauregard <g...@greg.red> added the comment:

When I originally submitted the issue I hadn't finished going through all of 
the dataclasses code and it hadn't even occurred to me that it could be valid 
to use ClassVar with field(). I (wrongly) assumed this would always raise and 
that field() is only valid for things intended to be instance vars.

I do find this behavior a little surprising, but on reflection I don't think 
it's explicitly wrong as long we raise for default_factory like it currently 
does. I think it's then appropriate to just do the exact same behavior for 
Final as ClassVar.

I'm going to start working on a PR, thanks for your feedback.

----------

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

Reply via email to