4 ms·
I used @property a lot when I started with Python. I thought it was idiomatic and 'Pythonic', and I liked the idea of read-only properties, and I name private a
by nealabq 5y ago
I used @property a lot when I started with Python. I thought it was idiomatic and 'Pythonic', and I liked the idea of read-only properties, and I name private attrs with a leading underscore, but sometimes I wanted to expose the attr read-only without the underscore.
I rarely use @property now. It doesn't help clarity and isn't used in codebases I'm familiar with. Maybe overuse is a symptom of under-exposure and inexperience. Or maybe it's just personal tastes.
- sockpuppet69 5y ago