Z:B.
Code: Alles auswählen
@property
getter_funktion():
.
.
.
Code: Alles auswählen
@property
getter_funktion():
.
.
.
Code: Alles auswählen
class P:
def __init__(self,x):
self.__x = x
def getX(self):
return self.__x
def setX(self, x):
self.__x = x
o = property(getX)
print(P(2).o)
Code: Alles auswählen
class P:
def __init__(self,x):
self.__x = x
def getX(self):
return self.__x
def setX(self, x):
self.__x = x
o = getX
print(P(2).o)