• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
返回主页

薄荷味日记

  • 博客园
  • 首页
  • 新随笔
  • 联系
  • 管理
  • 订阅 订阅

python 内置函数

https://www.runoob.com/python/python-built-in-functions.html

Python 内置函数

  内置函数  
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() reverse() zip()
compile() hasattr() memoryview() round() __import__()
complex() hash() min() set()  
delattr() help() next() setattr()  
dict() hex() object() slice()  
dir() id() oct() sorted() exec 内置表达式

 

getattr

class A(object):        
    def set(self, a, b):
        x = a        
        a = b        
        b = x        
        print (a, b) 

a = A()   
print(a)

# <__main__.A at 0x7f76891f2310>

c = getattr(a, 'set')
print(c)

# <bound method A.set of <__main__.A object at 0x7f76891f2310>>

 

posted @ 2021-03-09 20:01  薄荷味日记  阅读(54)  评论(0)    收藏  举报
刷新页面返回顶部

公告

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3