I have a question regarding dataclasses and `froze...
# development
I have a question regarding dataclasses and
. In https://www.pantsbuild.org/docs/style-guide#prefer-dataclasses there’s described how to mutate input parameters during init, but no mention of
? https://docs.python.org/3/library/dataclasses.html?highlight=initvar#init-only-variables Uhm.. reading up on it again, is it to circumvent the limitation described in there regarding frozen instances.. ?
There is a tiny performance penalty when using `frozen=True`: 
 cannot use simple assignment to initialize fields, and must use 
I'm afk, but if there's a better way to do things than frozen_after_init, we'd love that! Standardized code is much better than custom utils
👌 1
Yeah, that’s it. They have poor support for validating input up-front.. so for frozen instances, that becomes a no-go. In another project I wrote a metaclass to use with dataclasses, that coerced input data to the correct types automatically (when possible, err otherwise), I guess that could work here too. But then again, that wouldn’t be standardized code either.. 😛 (however, it would make for fewer custom inits)