55、'property',  获取对象的所有属性

class property(object)
| 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
|
| Methods defined here:
|
| __delete__(self, instance, /)
| Delete an attribute of instance.
|
| __get__(self, instance, owner, /)
| Return an attribute of instance, which is of type owner.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| __set__(self, instance, value, /)
| Set an attribute of instance to value.
|
| deleter(...)
| Descriptor to change the deleter on a property.
|
| getter(...)
| Descriptor to change the getter on a property.
|
| setter(...)
| Descriptor to change the setter on a property.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __isabstractmethod__
|
| fdel
|
| fget
|
| fset

  

python __builtins__ property类 (55)的更多相关文章

  1. python __builtins__ staticmethod类 (64)

    64.'staticmethod', 返回静态方法 class staticmethod(object) | staticmethod(function) -> method | | Conve ...

  2. python __builtins__ memoryview类 (46)

    46.'memoryview',  返回给定参数的内存查看对象(Momory view).所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问. cla ...

  3. python __builtins__ help类 (32)

    32.'help', 接收对象作为参数,更详细地返回该对象的所有属性和方法 class _Helper(builtins.object) | Define the builtin 'help'. | ...

  4. python __builtins__ float类 (25)

    25.'float', 用于将整数和字符串转换成浮点数. class float(object) | float(x) -> floating point number | | Convert ...

  5. python __builtins__ classmethod类 (11)

    11.'classmethod', 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等. class cla ...

  6. python __builtins__ bool类 (6)

    6.'bool',  函数用于将给定参数转换为布尔类型,如果没有参数,返回 False. class bool(int) # 继承于int类型 | bool(x) -> bool # 创建boo ...

  7. python __builtins__ zip类 (71)

    71.'zip' , 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表.如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作 ...

  8. python __builtins__ type类 (69)

    69.'type', 返回对象类型 class type(object) | type(object_or_name, bases, dict) | type(object) -> the ob ...

  9. python __builtins__ tuple类 (68)

    68.'tuple', 转换为元组类型 class tuple(object) | tuple() -> empty tuple | tuple(iterable) -> tuple in ...

随机推荐

  1. Android开发之入口Activity

    Android开发之入口Activity Adnroid App是怎样确定入口Activity的? 难道就由于class的类名叫MainActivity,布局文件叫activity_main.xml? ...

  2. 解决ionic 上拉加载组件 ion-infinite-scroll自动调用多次的问题或禁止第一次加载

    ionic 中一个上拉刷新的组件 ion-infinite-scroll,如果页面未填充满页面高度,会自动检测并无限调用多次加载更多的函数: 当然,主要会导致首次调用的时候,会执行几次加载更多的函数: ...

  3. numpy - 数组索引

    numpy 数组索引 一.单个元素索引 一维数组索引 >>> x = np.arange(10) >>> x[2] 2 >>> x[-2] 8 二 ...

  4. ViewPagerIndicator

    https://github.com/eltld/ViewPagerIndicator

  5. MySQL中给自定义的字段查询结果添加排名的方法

    我正在用 MySQL 客户端的时候,突然想到如果可以给查询结果添加排名该多好啊,然后就找到了一个简单的解决办法. 下面是一个示例表的数据:  然后我们要根据 Roll_No 字段进行排序并给出排名,我 ...

  6. android studio 非法字符: '\ufeff' 解决方式

    今天发现一个问题,就是从其它地方拷贝的代码到AS项目里面,木有语法 错误,可是就是执行不起来,老是报错"非法字符: '\ufeff' ",郁闷非常久.木有看到这个字符.最后查询了这 ...

  7. 转载:用python爬虫抓站的一些技巧总结

    原文链接:http://www.pythonclub.org/python-network-application/observer-spider 原文的名称虽然用了<用python爬虫抓站的一 ...

  8. appium 查错

    很高兴最近论坛用appium的人多了不少,但也有不少由于不了解appium导致出现错误后不知道从何下手.这里根据我的个人经验给出一个简单的查错指南,不保证能解决所有错误,但至少让你知道你应该朝哪个方向 ...

  9. Swift中字符串转化为Class的方法

    Swift中字符串转化为Class的方法 在开发中有时候会根据字符串进行对应类的转化,这样我们就可以动态根据服务器返回的字段,动态的加载类,比如优酷,微博等APP会在节假日等动态的TabBar.这样可 ...

  10. BZOJ 1042: [HAOI2008]硬币购物 容斥+背包

    1042: [HAOI2008]硬币购物 Description 硬币购物一共有4种硬币.面值分别为c1,c2,c3,c4.某人去商店买东西,去了tot次.每次带di枚ci硬币,买si的价值的东西.请 ...