Where does that module live in the Python install?

home | blog | Teh Internet | guest blog |rants | political | projects | Gwen and Liam | Citadel patched | Tools | TMBG

- Careful Chrome users, this search box might be "Not secure"

inspect module to the rescue:
import inspect
import datetime

for name, data in inspect.getmembers(datetime):
    print name, data

Wait for output...
__doc__ Fast implementation of the datetime type.
__file__ /usr/lib/python2.7/lib-dynload/datetime.x86_64-linux-gnu.so
__name__ datetime
__package__ None
date <type 'datetime.date'>
datetime <type 'datetime.datetime'>
datetime_CAPI <capsule object "datetime.datetime_CAPI" at 0x7f39d93a7960>
time <type 'datetime.time'>
timedelta <type 'datetime.timedelta'>
tzinfo <type 'datetime.tzinfo'>

Crud. Not exactly helpful.
But source is available :-)