1. 首页
  2. 数据库
  3. 其它
  4. python中的内置函数getattr()介绍及示例

python中的内置函数getattr()介绍及示例

上传者: 2021-01-01 03:09:52上传 PDF文件 48.99KB 热度 27次
在python的官方文档中:getattr()的解释如下: getattr(object, name[, 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.fooba
下载地址
用户评论