What's the pythonic way to use getters and setters?
Posted
by Jorge
on Stack Overflow
See other posts from Stack Overflow
or by Jorge
Published on 2010-04-13T04:38:23Z
Indexed on
2010/04/13
4:43 UTC
Read the original article
Hit count: 499
I'm doing it like:
def set_property(property,value):
def get_property(property):
or
object.property = value
value = object.property
I'm new to Python, so i'm still exploring the syntax, and i'd like some advice on doing this.
© Stack Overflow or respective owner