This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jimli
Recipients docs@python, jimli
Date 2019-06-26.23:46:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561592764.17.0.159166057812.issue37422@roundup.psfhosted.org>
In-reply-to
Content
In Python 2, `__path__` used to be a list, so all of the operations available to list are available, e.g., `insert`; you can also do indexing; e.g., `__path__[0]`.

However, I believe that starting from Python 3, it seems to be a <class '_frozen_importlib_external._NamespacePath'>, and a lot of operations that worked previously stopped working.It seems so abruptive and I can't find any deprecation notice on this.

Previously, one is able to insert an additional path to the front of the list by doing

module.__path__.insert(0, 'src/mypath')

Now the only procedure allowed seems to be append. Is there any way to mimic the old behaviour? Sorry, this is my first question so maybe this issue doesn't deserve any more attention. If there is any documentation that talks about the change of type of the NamespacePath, please kindly lemme know.

Sincerely,

Related issues include https://bugs.python.org/issue35843
History
Date User Action Args
2019-06-26 23:46:04jimlisetrecipients: + jimli, docs@python
2019-06-26 23:46:04jimlisetmessageid: <1561592764.17.0.159166057812.issue37422@roundup.psfhosted.org>
2019-06-26 23:46:04jimlilinkissue37422 messages
2019-06-26 23:46:03jimlicreate