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 <>
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.


Related issues include
Date User Action Args
2019-06-26 23:46:04jimlisetrecipients: + jimli, docs@python
2019-06-26 23:46:04jimlisetmessageid: <>
2019-06-26 23:46:04jimlilinkissue37422 messages
2019-06-26 23:46:03jimlicreate