I’ve looked through the CPython sources (Hg online here), but I can’t seem to find where os.stat() is defined. It looks like stat is magically a global in the os module (Lib/os.py, ca. line 139).
Can someone point me to the appropriate file(s)?
Looks like line 51 (for UNIX; there are similar lines for other platforms):
Tracing it back, we find out we reach that point through the return value of line 29:
And
posix_statis defined in Modules/posixmodule.c:2301, which is ultimately called byos: