Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
プロパティに関するサンプル
class prop:
__x=100
def getX(self):
return self.__x
def setX(self,value):
value=value+1
self.__x=value
x=property(getX,setX)
p = prop()
p.x=500
print(p.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment