MCPcopy Index your code
hub / github.com/python/cpython / _get_const_info

Function _get_const_info

Lib/dis.py:704–714  ·  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

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

Callers 1

get_argval_argreprMethod · 0.85

Calls 1

_get_const_valueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…