Python查看包中的全部方法

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_41596915/article/details/97403292
# 查看deque模块中的所有方法
from collections import deque

print([el for el in dir(deque) if not el.startswith('_')])

Run:
[‘append’, ‘appendleft’, ‘clear’, ‘copy’, ‘count’, ‘extend’, ‘extendleft’, ‘index’, ‘insert’, ‘maxlen’, ‘pop’, ‘popleft’, ‘remove’, ‘reverse’, ‘rotate’]

猜你喜欢

转载自blog.csdn.net/qq_41596915/article/details/97403292
今日推荐