Allow unsafe custom __getitem__ executions when allow unsafe executions is on
This commit is contained in:
1 parent
8a4b079d0f
commit
57aefed6ea
3 files changed
+25
-5
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user