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.
# 查看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’]