-1

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!

MisterMiyagi
  • 44,374
  • 10
  • 104
  • 119
Bonderson
  • 13
  • 2

1 Answers1

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