Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
clean sage.all and user_globals upon initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
nbruin authored and Matthias Koeppe committed Dec 18, 2022
1 parent a29a25d commit 1fa627b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sage/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ def quit_sage(verbose=True):
set_random_seed()


# Relink imported lazy_import objects to point to the appropriate namespace

from sage.misc.lazy_import import clean_namespace
clean_namespace(globals())
del clean_namespace

# From now on it is ok to resolve lazy imports
sage.misc.lazy_import.finish_startup()

Expand Down
2 changes: 2 additions & 0 deletions src/sage/repl/user_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def initialize_globals(all, g=None):
for key in dir(all):
if key[0] != '_':
user_globals[key] = getattr(all, key)
from sage.misc.lazy_import import clean_namespace
clean_namespace(user_globals)


def get_global(name):
Expand Down

0 comments on commit 1fa627b

Please sign in to comment.