码迷,mamicode.com
首页 > 编程语言 > 详细

python-getattr

时间:2016-11-22 22:51:10      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:attr   http   title   style   highlight   not   ide   des   turn   

getattr(objectname[, default])

Return the value of the named attribute of object.  name must be a string. If the string is the name of one of the object’s attributes, the result is the value of that attribute. For example, getattr(x, ‘foobar‘) is equivalent to x.foobar. If the named attribute does not exist, default is returned if provided, otherwise AttributeError is raised.

python-getattr

标签:attr   http   title   style   highlight   not   ide   des   turn   

原文地址:http://www.cnblogs.com/malongqianyue/p/6091222.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!