Coverage for /usr/lib/python3/dist-packages/sympy/utilities/magic.py: 14%
7 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
1"""Functions that involve magic. """
3def pollute(names, objects):
4 """Pollute the global namespace with symbols -> objects mapping. """
5 from inspect import currentframe
6 frame = currentframe().f_back.f_back
8 try:
9 for name, obj in zip(names, objects):
10 frame.f_globals[name] = obj
11 finally:
12 del frame # break cyclic dependencies as stated in inspect docs