How to force my whole package to use a __future__ directive?

Viewed 308

Can I place:

from __future__ import absolute_import

inside __init__.py on the top level dir on my package and garantee that the absolute_import will be applied to all code that runs inside that package or sub-packages?

Or should I put that directive in each model that does an absolute import?

I maintain a Python package and I'm trying to keep my code as easy as possible to migrate to Python3 when the time comes. I can't do it right away because my dependencies are not on Python3 yet.

1 Answers
Related