![]() ![]() I thus created pkg/main2.py, identical to main.py but with the additional future import directive. However, further along in the 2.5 changelog, we find this (emphasis added): main.py contains the following code: import stringĪs expected, running this with Python 2.5 fails with an AttributeError: $ python2.5 pkg/main.pyĪttributeError: 'module' object has no attribute 'ascii_uppercase' So I created this exact directory structure: $ ls -R ![]() Straight from the changelog linked above, this statement accurately summarized my understanding of the absolute import change: However, upon installing Python 2.5 and attempting to craft an example of properly using from _future_ import absolute_import, I realize things are not so clear. I have answered a question regarding absolute imports in Python, which I thought I understood based on reading the Python 2.5 changelog and accompanying PEP. Question or problem about Python programming:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |