Compile function code object from args and body.
(
name: str,
args: List[str],
body: List[str],
*,
globals: Dict[str, Any] = None,
locals: Dict[str, Any] = None,
return_type: Any = MISSING,
argsep: str = ", ",
)
| 24 | |
| 25 | |
| 26 | def Function( |
| 27 | name: str, |
| 28 | args: List[str], |
| 29 | body: List[str], |
| 30 | *, |
| 31 | globals: Dict[str, Any] = None, |
| 32 | locals: Dict[str, Any] = None, |
| 33 | return_type: Any = MISSING, |
| 34 | argsep: str = ", ", |
| 35 | ) -> Callable: |
| 36 | """Compile function code object from args and body.""" |
| 37 | return build_function( |
| 38 | name=name, |
| 39 | source=build_function_source( |
| 40 | name=name, |
| 41 | args=args, |
| 42 | body=body, |
| 43 | return_type=return_type, |
| 44 | argsep=argsep, |
| 45 | ), |
| 46 | return_type=return_type, |
| 47 | globals=globals, |
| 48 | locals=locals, |
| 49 | ) |
| 50 | |
| 51 | |
| 52 | def build_closure_source( |
no test coverage detected