Home | Trees | Indices | Help |
|
---|
|
property(fget=None, fset=None, fdel=None, doc=None) -> property attribute fget is a function to be used for getting an attribute value, and likewise fset is a function for setting, and fdel a function for del'ing, an attribute. Typical use is to define a managed attribute x: class C(object): 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.") Decorators make defining new properties or modifying existing ones easy: class C(object): @property def x(self): "I am the 'x' property." return self._x @x.setter def x(self, value): self._x = value @x.deleter def x(self): del self._x
|
|||
|
|||
value |
|
||
|
|||
property attribute |
|
||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
fdel | |||
fget | |||
fset | |||
Inherited from |
|
x.__getattribute__('name') <==> x.name
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Nov 4 00:57:43 2019 | http://epydoc.sourceforge.net |