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

Function wrap_value

Lib/inspect.py:2187–2198  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

2185 return node.arg
2186
2187 def wrap_value(s):
2188 try:
2189 value = eval(s, module_dict)
2190 except NameError:
2191 try:
2192 value = eval(s, sys_module_dict)
2193 except NameError:
2194 raise ValueError
2195
2196 if isinstance(value, (str, int, float, bytes, bool, type(None))):
2197 return ast.Constant(value)
2198 raise ValueError
2199
2200 class RewriteSymbolics(ast.NodeTransformer):
2201 def visit_Attribute(self, node):

Callers 2

visit_AttributeMethod · 0.85
visit_NameMethod · 0.85

Calls 2

isinstanceFunction · 0.85
evalFunction · 0.50

Tested by

no test coverage detected