See all Python method package

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: 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’]

Guess you like

Origin blog.csdn.net/qq_41596915/article/details/97403292