New submission from Jim Li <ji...@bcgsc.ca>:

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

----------
assignee: docs@python
components: Documentation
messages: 346701
nosy: docs@python, jimli
priority: normal
severity: normal
status: open
title: Documentation on the change of __path__ in Python 3
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37422>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to