It’s not necessary to rename the module. Instead, in Python 2.5 and above, use absolute_import
to change the importing behavior.
For example, to import the standard library socket
module, even if there is a socket.py
in the project:
from __future__ import absolute_import
import socket
In Python 3.x, this behaviour is the default. Pylint will complain about the code, but it’s perfectly valid.