MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _get_const_value

Function _get_const_value

tools/python-3.11.9-amd64/Lib/dis.py:354–367  ·  view source on GitHub ↗

Helper to get the value of the const in a hasconst op. Returns the dereferenced constant if this is possible. Otherwise (if it is a LOAD_CONST and co_consts is not provided) returns the dis.UNKNOWN sentinel.

(op, arg, co_consts)

Source from the content-addressed store, hash-verified

352 show_caches=show_caches)
353
354def _get_const_value(op, arg, co_consts):
355 """Helper to get the value of the const in a hasconst op.
356
357 Returns the dereferenced constant if this is possible.
358 Otherwise (if it is a LOAD_CONST and co_consts is not
359 provided) returns the dis.UNKNOWN sentinel.
360 """
361 assert op in hasconst
362
363 argval = UNKNOWN
364 if op == LOAD_CONST:
365 if co_consts is not None:
366 argval = co_consts[arg]
367 return argval
368
369def _get_const_info(op, arg, co_consts):
370 """Helper to get optional details about const references

Callers 2

_get_const_infoFunction · 0.85
_find_importsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected