because time is built-in, and request is a site package:
Try printing the __file__ attribute to see where the module is located:
print(time.__file__)
AttributeError: 'module' object has no attribute '__file__'
you get an error, but with requests you get the answer
print(requests.__file__)
C:\Python34\lib\site-packages\requests\__init__.py
another hint is given by help(time.__loader__):
>>> help(time.__loader__)
Help on class BuiltinImporter in module importlib._bootstrap:
class BuiltinImporter(builtins.object)
| Meta path import for built-in modules.
for requests:
>>> help(requests.__loader__)
Help on SourceFileLoader in module importlib._bootstrap object:
class SourceFileLoader(FileLoader, SourceLoader)
| Concrete implementation of SourceLoader using the file system.
Anyway, don't call your modules as built-ins or library packages. In both cases you'll have problems.
- naming after a built-in: you cannot import it, as you saw
- naming after a site package: you cannot import the site package/use it in your module