Perhaps I'm just miswording my searches, but I'm not finding anything concrete for the following scenario:
Say I have my Python script in main.py and I have a few helper functions in a helpers.py module. In helpers.py, I have a function that relies on urllib, and I'm not using urllib inside of main.py otherwise.
Should I import the module inside of helpers.py, inside the function using urllib, or just inside main.py?
Edit: For some reason, this question was marked as a duplicate to import at module level or at function level?, but this is not correct. PEP8 guidelines advise doing imports at the top of the file. They don't answer the scenario I've advised above, where the function with its own dependencies is imported from another file.