1
0
forked from VimPlug/jedi

Allow unsafe custom __getitem__ executions when allow unsafe executions is on

This commit is contained in:
Dave Halter
2023-07-29 00:33:09 +02:00
parent 8a4b079d0f
commit 57aefed6ea
3 changed files with 25 additions and 5 deletions

View File

@@ -230,8 +230,8 @@ class DirectObjectAccess:
return [annotation]
return None
def py__simple_getitem__(self, index):
if type(self._obj) not in ALLOWED_GETITEM_TYPES:
def py__simple_getitem__(self, index, *, safe=True):
if safe and type(self._obj) not in ALLOWED_GETITEM_TYPES:
# Get rid of side effects, we won't call custom `__getitem__`s.
return None