class property(fget=None, fset=None, fdel=None, doc=None) |
Returns a property attribute. |
fget | |
fset | |
fdel | |
doc |
REMARKS |
* No prefix required - Core * fget is a function for getting an attribute value. fset is a function for setting an attribute value. fdel is a function for deleting an attribute value. And doc creates a docstring for the attribute. * You can use the DIR function to check if a file or directory exists. |
class C:
def __init__(self):
self._x = None
def getx(self):
return self._x
def setx(self, value):
self._x = value
def delx(self):
del self._x
x = property(getx, setx, delx, "I'm the 'x' property.")
© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited Top