diff options
author | Anthony Sottile <asottile@umich.edu> | 2019-03-08 10:58:00 -0800 |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-08 10:58:00 -0800 |
commit | ab9b31f94737895f0121f26ba3ad718ebbc24fe1 (patch) | |
tree | 5891d2056a0f382f4f3a53a24a8d2b97069f8186 /Lib/importlib | |
parent | 8a1bab92915dd5c88832706c56af2f5611181d50 (diff) | |
download | cpython-git-ab9b31f94737895f0121f26ba3ad718ebbc24fe1.tar.gz |
bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 71fdd0cb59..146c6472f7 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1163,6 +1163,9 @@ class _NamespacePath: def __iter__(self): return iter(self._recalculate()) + def __getitem__(self, index): + return self._recalculate()[index] + def __setitem__(self, index, path): self._path[index] = path |