Issue
In python code I often see the use of @property.
If I understand correctly, with the property function a getter setter and deleter can be defined.
Why would one use @property if the setter and deleter are not defined (@x.setter, @x.deleter)? Isn't this the same as not using @property at all?
Solution
It creates an API that does not allow a value to be set. This is similar in other languages to a constant.
Answered By - bradley.ayers
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.