I saw this line of code by chance yesterdayfrom _collections import deque
I was looking at the python library documentation. When I saw collections, I went to find the source code of deque.
Then I looked for _collections, but it was not found in the Lib directory. Use the search file When I found the directoryLib/site-packages/requests/packages/urllib3/_collections.py
, but there was no code about deque in it, so I was curiousfrom _collections import deque
, where did this _collections come from
here
https://github.com/python/cpy...
Built-in module, similar to c extension
In [4]: import _collections
In [5]: _collections
Out[5]:
_collections
是一个内置模块, 要从源码查找:Python-2.7.12/Modules/_collectionsmodule.c