python 中的内置函数

http://www.cnblogs.com/hongfei/p/3858256.html

 

  Built-in Functions  
abs()divmod()input()open()staticmethod()
all()enumerate()int()ord()str()
any()eval()isinstance()pow()sum()
basestring()execfile()issubclass()print()super()
bin()file()iter()property()tuple()
bool()filter()len()range()type()
bytearray()float()list()raw_input()unichr()
callable()format()locals()reduce()unicode()
chr()frozenset()long()reload()vars()
classmethod()getattr()map()repr()xrange()
cmp()globals()max()reversed()zip()
compile()hasattr()memoryview()round()__import__()
complex()hash()min()set()apply()
delattr()help()next()setattr()buffer()
dict()hex()object()slice()coerce()
dir()id()oct()sorted()intern()

 

内置方法 说明
 __init__(self,...) 初始化对象,在创建新对象时调用
 __del__(self) 释放对象,在对象被删除之前调用
 __new__(cls,*args,**kwd) 实例的生成操作
 __str__(self) 在使用print语句时被调用
 __getitem__(self,key) 获取序列的索引key对应的值,等价于seq[key]
 __len__(self) 在调用内联函数len()时被调用
 __cmp__(stc,dst) 比较两个对象src和dst
 __getattr__(s,name) 获取属性的值
 __setattr__(s,name,value) 设置属性的值
 __delattr__(s,name) 删除name属性
 __getattribute__() __getattribute__()功能与__getattr__()类似
 __gt__(self,other) 判断self对象是否大于other对象
 __lt__(slef,other) 判断self对象是否小于other对象
 __ge__(slef,other) 判断self对象是否大于或者等于other对象
 __le__(slef,other) 判断self对象是否小于或者等于other对象
 __eq__(slef,other) 判断self对象是否等于other对象
 __call__(self,*args) 把实例对象作为函数调用
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值