2 ms·
I looked up the docs as to what frozen does: > whether or not models are faux-immutable, i.e. whether __setattr__ is allowed (default: True) Seems everything
by richrichie 2y ago
I looked up the docs as to what frozen does:
> whether or not models are faux-immutable, i.e. whether __setattr__ is allowed (default: True)
Seems everything is “faux” in Python world when it comes to typing ;)
- stavros 2y agoUnfortunately I can't downvote, but this comment is just flamebait.
- richrichie 2y agoAh, sensitive type you are! Read my reply above.
- Spivak 2y agoPython very much lives up to its goal of being a language for consenting adults. It's part of the culture that you don't write code that tries to forbid users of your code from doing "wrong" things and such efforts are mostly futile anyway. You can reach right into a Python object's internal data and modify it directly, taking away __setattr__ is just a suggestion. It's the same as in C where you can modify const variables if you're determined enough.
- richrichie 2y agoI love Python and use it extensively. I just find the extensive typing rituals a bit funny. If one needs this much bandaid (essentially for code editors), then Python is not a good choice for the task.