When I jump to definition of map() function in PyCharm, I get a code with only pass-construction in it and no code which makes something. I tried to find it in other places, but it seems like I don't have any idea of where it can be. Please, help!
Asked
Active
Viewed 1,560 times
1 Answers
1
Builtin functions are not written in Python, but rather in C. What you see in you IDE is only a placeholder, it is of course not the real implementation.
Here you can find the cPython implementation of map
.
You will notice that since map
is a class, its method are defined beforehand. By exemple, if you are interested in map.__next__
, you look for the definition. map_next
. After those method definitions, you can find the allocation of the map
type.

Olivier Melançon
- 21,584
- 4
- 41
- 73