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. windows核心编程之进程间共享数据

    有时候我们会遇到window进程间共享数据的需求,例如说我想知道系统当前有多少某个进程的实例. 我们能够在程序中定义一个全局变量.初始化为0.每当程序启动后就加1.当然我们我们能够借助第三方介质来储存 ...

  2. linux中select网络通信

    //ser.cpp #include <iostream> #include <fcntl.h> #include <sys/socket.h> #include ...

  3. 利用python暴力破解ssh

    # -*- coding:utf-8 -*- #python 2.7 import optparse,sys,threading import pexpect PROMPT = ['#','>' ...

  4. 转移iOS App常见问题和回答

    打算转移公司的app,做下转移的记录 怎样转移app官方的一个视频:http://v.youku.com/v_show/id_XNjI0MjQxMzI0.html 以下是apple官方转移常见问题回答 ...

  5. 使用外部 toolchain 编译 openwrt

    默认编译 openwrt 时会先编译一套 toolchain. 这个步骤耗时较长. 使用外部 toolchain 可以多个 project 共用一套 toolchain , 而且也不重再编译它了. 省 ...

  6. alsa声卡切换

    环境 ubuntu12.04 因为桌面版的默认装了,而且调声音也很方便,这里说一下server版下的配置,毕竟做开发经常还是用server版的 1.安装 apt-get install alsa-ba ...

  7. Oracle核心技术 笔记(该书读得不细致,须要找时间再细读~~)

    Oracle核心技术 跳转至: 导航. 搜索 文件夹 1 開始 2 redo和undo 3 事务与一致性 4 锁与闩 5 缓存和复制 6 写入和恢复 7 解析与优化 8 RAC及'缺陷' 9 附录A ...

  8. 项目Alpha冲刺(团队9/10)

    项目Alpha冲刺(团队9/10) 团队名称: 云打印 作业要求: 项目Alpha冲刺(团队) 作业目标: 完成项目Alpha版本 团队队员 队员学号 队员姓名 个人博客地址 备注 221600412 ...

  9. php输出echo、print、print_r、printf、sprintf、var_dump比较

    php输出echo.print.print_r.printf.sprintf.var_dump比较 一.echo    echo() 实际上不是一个函数,是php语句,因此您无需对其使用括号.不过,如 ...

  10. 使用URL dispatcher的范例

    在上面的一篇文章中,我们介绍了怎样使用URL disptacher.在这篇文章中,我们来通过一个范例更进一步来了解怎样实现它. 1)创建一个具有URL dispatcher的应用 我们首先打开我们的S ...