Why would anyone use @property if no setter or deleter is specified?

In python code, I often see the use of @property.

If I understand correctly, using the properties function, you can determine the device and the getter-getter.

Why use @property if the settings and deaeter are not defined (@ x.setter, @ x.deleter)? Isn't that the same as not using @property at all?

+5
source share
1 answer

It creates an API that does not allow a value to be set. This is similar to other languages ​​for constant.

+7
source

All Articles