kimes wrote: > I've just started digging into how python works.. > I found that other mudules are clearly declared like one file per a > module.. > > But the only os.path doesn't have their own file.. > ye I know is has actually depending on os like in my case posixpath.. > > What I'd love to know is.. > when I call import os.path.. > how happened under the hood? > > I'm currently using python 2.4 in linux machine.. > I'd appreciate it
See line 5 of os.py (comment) - os.path is one of the modules posixpath, ntpath, or macpath It says it sets os.path depending on the platform and does so in line 132 sys.modules['os.path'] = path In your case, os.path should be implemented in posixpath.py See line 48 to see where it came from In short, "use the source, Luke" :-) especially when Python is exceptionally readable. -- http://mail.python.org/mailman/listinfo/python-list