ai-content-maker/.venv/Lib/site-packages/sympy/utilities/magic.py

13 lines
400 B
Python
Raw Permalink Normal View History

2024-05-03 04:18:51 +03:00
"""Functions that involve magic. """
def pollute(names, objects):
"""Pollute the global namespace with symbols -> objects mapping. """
from inspect import currentframe
frame = currentframe().f_back.f_back
try:
for name, obj in zip(names, objects):
frame.f_globals[name] = obj
finally:
del frame # break cyclic dependencies as stated in inspect docs