➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author GBeauregard
Recipients GBeauregard, eric.smith
Date 2021-10-09.21:48:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
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.
History
Date User Action Args
2021-10-09 21:48:46GBeauregardsetrecipients: + GBeauregard, eric.smith
2021-10-09 21:48:46GBeauregardsetmessageid: <[email protected]>
2021-10-09 21:48:46GBeauregardlinkissue45384 messages
2021-10-09 21:48:46GBeauregardcreate