-3

I am looking at some source code in Python and see that it is importing the genericpath module. Where can I find this module?

import genericpath
from genericpath import *

Searching for genericpath is turning up nothing...

timbram
  • 1,797
  • 5
  • 28
  • 49

1 Answers1

9

To check where module resides you may use __file__ attribute.

>>> import genericpath
>>> genericpath.__file__
'C:\\Python27\\lib\\genericpath.pyc'

genericpath contains common implementation for os.path modules (ntpath, posixpath). Normally, you should never use any of these names explicitly, os.path will dispatch all requests to correct underlying library.

Łukasz Rogalski
  • 22,092
  • 8
  • 59
  • 93