how can I read python build-in function’s source code? eg, filter, map, reduce
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
These functions are written in C. You can view the source code here (be sure to select the correct version by tag) or download the source tarball from here.
Anyway, you can find the code for all function in
__builtin__in the filePython/bltinmodule.c. I.e. the implementation offilteris a function calledbuiltin_filter.The sources for other modules are in the
Modules/folder.