MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_const_info

Function _get_const_info

Lib/dis.py:698–708  ·  view source on GitHub ↗

Helper to get optional details about const references Returns the dereferenced constant and its repr if the value can be calculated. Otherwise returns the sentinel value dis.UNKNOWN for the value and an empty string for its repr.

(op, arg, co_consts)

Source from the content-addressed store, hash-verified

696 return argval
697
698def _get_const_info(op, arg, co_consts):
699 """Helper to get optional details about const references
700
701 Returns the dereferenced constant and its repr if the value
702 can be calculated.
703 Otherwise returns the sentinel value dis.UNKNOWN for the value
704 and an empty string for its repr.
705 """
706 argval = _get_const_value(op, arg, co_consts)
707 argrepr = repr(argval) if argval is not UNKNOWN else ''
708 return argval, argrepr
709
710def _get_name_info(name_index, get_name, **extrainfo):
711 """Helper to get optional details about named references

Callers 1

get_argval_argreprMethod · 0.85

Calls 2

_get_const_valueFunction · 0.85
reprFunction · 0.85

Tested by

no test coverage detected