These days I hardly get any time for anything i want to do, blogging being one of them. So I am starting this new series. The 15 minutes of life, wherein I will be spending a good 15 minutes to update the best things that happened to me in the day. This way, I will buy some more time to think on larger posts without compromising on my presence here. Moreover, thinking about the best things that happen, give a sweet end to the day.
How the Python import system works From: https://tenthousandmeters.com/blog/python-behind-the-scenes-11-how-the-python-import-system-works/ If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package ; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn't find a better solution. Every Python programmer experienced something like this, and popular StackOverflow questions, such us Importing files from different folder (1822 votes), Relative imports in Python 3 (1064 votes) and Relative imports for the billionth time (993 votes), are a good indicator of that. The Python import system doesn't just seem complicated – it is complicated. So even though the documentation is really good, it d
Comments
Post a Comment