self.is_temp = 1
def nogil_check(self, env):
- if self.arg.type.is_pyobject:
+ if self.arg.type.is_pyobject and self._special_builtins.get(self.arg.type) is None:
self.gil_error()
gil_message = "Truth-testing Python object"
else:
return False
+def if_list_nogil(list obj):
+ """
+ >>> if_list_nogil( [] )
+ False
+ >>> if_list_nogil( [1] )
+ True
+ >>> if_list_nogil(None)
+ False
+ """
+ cdef bint result
+ with nogil:
+ if obj:
+ result = True
+ else:
+ result = False
+ return result
+
def if_list_literal(t):
"""
>>> if_list_literal(True)