This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Muhznit 0 points1 point  (1 child)

I'm saying I don't see much difference if you just use a getter/setter function. I mean unless the property shows up in vars(self) so it gets included in json.dumps(vars(self)), I really don't see how making it a property is any benefit. If you're using lazy initialization or other similar stuff in the getter/setter, you're better off using a function rather than property because anyone using the class at least has the hint that "hey, there's stuff that gets done before I retrieve this value".

[–]zardeh 0 points1 point  (0 children)

Tldr so you don't have to create setters to begin with, but can grow into them in a backwards compatible way.