Message 403555 - Python tracker

Message403555

Author GBeauregard
Recipients GBeauregard, eric.smith
Date 2021-10-09.21:48:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633816126.76.0.318331233753.issue45384@roundup.psfhosted.org>
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: <1633816126.76.0.318331233753.issue45384@roundup.psfhosted.org>
2021-10-09 21:48:46GBeauregardlinkissue45384 messages
2021-10-09 21:48:46GBeauregardcreate