3 ms·
I'd really love if that could checked statically. Performance is bad, I mean, all params are deep-copied because I assume frozen then "inplace" is not intended
by diegojromero 5y ago
I'd really love if that could checked statically.
Performance is bad, I mean, all params are deep-copied because I assume frozen then "inplace" is not intended as they could be objects used by other parts of code.
- nickysielicki 5y agoI started googling around and I found the following: https://www.python.org/dev/peps/pep-0591/ https://www.python.org/dev/peps/pep-0591/ It looks like mypy can actually understand the hint: https://mypy.readthedocs.io/en/stable/final_attrs.html https://mypy.readthedocs.io/en/stable/final_attrs.html It sucks that this would require such a substantial effort throughout a codebase, though. I guess that’s just the inherent cost of typed python.
- diegojromero 5y agoInteresting, maybe adding a decorator @freeze_final could be a good idea? I'll take a look at it later. Thank you for your input!