pdir2 module

本文深入探讨了Python内置的pdir模块,它提供了比内置的dir()更丰富的信息,包括特殊属性、抽象类、对象定制、类定制、容器特性、序列化以及描述符相关的方法。通过pdir,你可以更好地理解和调试Python对象的属性和行为。
摘要由CSDN通过智能技术生成
~ $ 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值