Today I learned- Python's Absolute Import

While exploring the Django and Django REST source code I found-

from __future__ import absolute_import

and curious to find more about it started searching for various resources. Importing in Python versions <3.x was relative in modules and absolute in >=3.x versions so we use absolute_import for making import absolute for python <3.x versions. Now when using absolute imports we have a few interesting scenarios which I found making this importing concept confusing. The resource which provided the answers to all my doubts and made this clear was this post-



Comments

Popular Posts