MCPcopy
hub / github.com/python-attrs/attrs / _compile_and_eval

Function _compile_and_eval

src/attr/_make.py:216–227  ·  view source on GitHub ↗

Evaluate the script with the given global (globs) and local (locs) variables.

(
    script: str,
    globs: dict[str, Any] | None,
    locs: Mapping[str, object] | None = None,
    filename: str = "",
)

Source from the content-addressed store, hash-verified

214
215
216def _compile_and_eval(
217 script: str,
218 globs: dict[str, Any] | None,
219 locs: Mapping[str, object] | None = None,
220 filename: str = "",
221) -> None:
222 """
223 Evaluate the script with the given global (globs) and local (locs)
224 variables.
225 """
226 bytecode = compile(script, filename, "exec")
227 eval(bytecode, globs, locs)
228
229
230def _linecache_and_compile(

Callers 5

_add_initFunction · 0.90
_linecache_and_compileFunction · 0.85
_add_hashFunction · 0.85
_add_eqFunction · 0.85
_add_reprFunction · 0.85

Calls

no outgoing calls

Tested by 1

_add_initFunction · 0.72