mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)
This commit is contained in:
parent
8a1bab9291
commit
ab9b31f947
4 changed files with 888 additions and 869 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue