MCPcopy Create free account
hub / github.com/python/mypy / _vec_to_sequence

Function _vec_to_sequence

mypyc/irbuild/vec.py:611–634  ·  view source on GitHub ↗
(
    builder: LowLevelIRBuilder, vec: Value, line: int, method: str, result_type: RType
)

Source from the content-addressed store, hash-verified

609
610
611def _vec_to_sequence(
612 builder: LowLevelIRBuilder, vec: Value, line: int, method: str, result_type: RType
613) -> Value | None:
614 vec_type = vec.type
615 assert isinstance(vec_type, RVec)
616 item_type = vec_type.item_type
617 api_name = vec_api_by_item_type.get(item_type)
618 if api_name is not None:
619 name = f"{api_name}.{method}"
620 elif supports_vec_to_sequence(vec_type):
621 name = f"VecTApi.{method}"
622 else:
623 return None
624 return builder.add(
625 CallC(
626 name,
627 [vec],
628 result_type,
629 steals=[True],
630 is_borrowed=False,
631 error_kind=ERR_MAGIC,
632 line=line,
633 )
634 )

Callers 2

vec_to_listFunction · 0.85
vec_to_tupleFunction · 0.85

Calls 5

CallCClass · 0.90
isinstanceFunction · 0.85
supports_vec_to_sequenceFunction · 0.85
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…