|
property ::
Class property
|
|
Class property
object --+
|
property
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.")
|
|
|
|
value
|
| __get__(descr,
obj,
type=...) |
|
|
|
|
|
property attribute
|
__init__(fget=None,
fset=None,
fdel=None,
doc=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
a new object with type S, a subtype of T
|
|
|
|
| __set__(descr,
obj,
value) |
|
|
|
Inherited from object:
__delattr__,
__hash__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
|
fdel
|
|
|
fget
|
|
|
fset
|
|
Inherited from object:
__class__
|
|
x.__getattribute__('name') <==> x.name
- Overrides:
object.__getattribute__
|
__init__(fget=None,
fset=None,
fdel=None,
doc=None)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Returns:
property attribute
- Overrides:
object.__init__
|
- Returns: a new object with type S, a subtype of T
- Overrides:
object.__new__
|