Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
706 views
in Technique[技术] by (71.8m points)

finding _collections in python source

I wanted to have a look at the python deque class. When I checked the source code , I found the following at line 10

 from _collections import deque, defaultdict

where exactly can I find this _collections module? I searched on my copy of the python source, but couldn't spot it.

Where is this class located?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

_collections is builtin extension module.

You can find source for _collection module here.

Setup.dist contains mapping between builtin extension module name to source file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...