码迷,mamicode.com
首页 > 其他好文 > 详细

dir() 和 __dict__ 的对比

时间:2018-04-12 15:24:01      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:sse   dir   string   call   module   sed   else   use   and   

""" dir([object]) -> list of strings

If called without an argument, return the names in the current scope.
Else, return an alphabetized list of names comprising (some of) the attributes
of the given object, and of attributes reachable from it.
If the object supplies a method named __dir__, it will be used; otherwise
the default dir() logic is used and returns:
for a module object: the module‘s attributes.
for a class object: its attributes, and recursively the attributes
of its bases.
for any other object: its attributes, its class‘s attributes, and recursively the attributes of its class‘s base classes. """

dir() 和 __dict__ 的对比

标签:sse   dir   string   call   module   sed   else   use   and   

原文地址:https://www.cnblogs.com/YingxuanZHANG/p/8807514.html

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