~ $ pip3 install pdir2
>>>import pdir
>>> pdir(pdir)
special attribute:
__class__, __dict__, __doc__, __module__, __weakref__
abstract class:
__subclasshook__
object customization:
__format__, __hash__, __init__, __new__, __repr__, __sizeof__, __str__
rich comparison:
__eq__, __ge__, __gt__, __le__, __lt__, __ne__
attribute access:
__delattr__, __dir__, __getattribute__, __setattr__
class customization:
__init_subclass__
container:
__getitem__, __len__
pickle:
__reduce__, __reduce_ex__
descriptor:
methods: @property with getter, Returns all methods of the inspected object.
own: @property with getter, Returns attributes that are not inhterited from parent classes.
properties: @property with getter, Returns all properties of the inspected object.
public: @property with getter, Returns public attributes of the inspected object.
function:
index:
s: Searches for names that match some pattern.
search: Searches for names that match some pattern.
pdir2 module
最新推荐文章于 2025-05-14 14:37:17 发布
本文深入探讨了Python内置的pdir模块,它提供了比内置的dir()更丰富的信息,包括特殊属性、抽象类、对象定制、类定制、容器特性、序列化以及描述符相关的方法。通过pdir,你可以更好地理解和调试Python对象的属性和行为。
414

被折叠的 条评论
为什么被折叠?



