This commit is contained in:
Joscha 2019-12-03 09:15:07 +00:00
parent f415070c11
commit a6c2e7897a
2 changed files with 0 additions and 22 deletions

View file

@ -1,21 +0,0 @@
"""
This module contains helper functions for evaluating python code and
managing local variables.
"""
import copy
import types
from typing import Any, Dict
__all__ = ["copy_local_variables"]
def copy_local_variables(local: Dict[str, Any]) -> Dict[str, Any]:
local_copy = {}
for key, value in local:
if isinstance(value, types.ModuleType):
local_copy[key] = value
else:
local_copy[key] = copy.deepcopy(value)
return local_copy