MCPcopy Index your code
hub / github.com/python/mypy / is_optional

Method is_optional

mypyc/ir/rtypes.py:1063–1069  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1061 assert False, f"unexpected item type: {self.item_type}"
1062
1063 def is_optional(self) -> bool:
1064 item_type = self.item_type
1065 if isinstance(item_type, RUnion):
1066 return True
1067 elif isinstance(item_type, RVec):
1068 return item_type.is_optional()
1069 return False
1070
1071 def depth(self) -> int:
1072 item_type = self.item_type

Callers 10

__str__Method · 0.95
get_argsFunction · 0.45
num_bitmap_argsFunction · 0.45
_construct_varargsMethod · 0.45
_py_vector_callMethod · 0.45
optionalMethod · 0.45
num_bitmap_argsFunction · 0.45
vec_item_type_cMethod · 0.45

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected