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

Commit

Permalink
src/sage/misc/lazy_import.pyx: Codestyle/markup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 18, 2022
1 parent 1fa627b commit 6e384f5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/sage/misc/lazy_import.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,9 @@ def get_star_imports(module_name):

def attributes(a):
"""
Returns the private attributes of a LazyImport object in a dictionary (for debugging purposes).
Return the private attributes of a :class:`LazyImport` object in a dictionary.
This is for debugging and doctesting purposes only.
EXAMPLES::
Expand Down Expand Up @@ -1195,11 +1197,11 @@ def attributes(a):

def clean_namespace(namespace):
"""
Adjusts LazyImport bindings in given namespace to refer to this actual namespace.
Adjust :class:`LazyImport` bindings in given namespace to refer to this actual namespace.
When LazyImport objects are imported into other namespaces via normal import
instructions, then the data stored on a LazyImport object that helps it to adjust the
binding in the namespace to the actual imported object upon access, is not adjusted.
When :class:`LazyImport` objects are imported into other namespaces via normal ``import``
instructions, the data stored on a :class:`LazyImport` object that helps it to adjust the
binding in the namespace to the actual imported object upon access is not adjusted.
This routine fixes that.
EXAMPLES::
Expand All @@ -1221,7 +1223,8 @@ def clean_namespace(namespace):
if type(v) is LazyImport:
w = v
if w._namespace is not None and (w._namespace is not namespace or w._as_name != k):
namespace[k]=LazyImport(w._module, w._name, as_name=k, at_startup=w._at_startup, namespace=namespace, deprecation=w._deprecation)
namespace[k] = LazyImport(w._module, w._name, as_name=k, at_startup=w._at_startup,
namespace=namespace, deprecation=w._deprecation)

# Add support for _instancedoc_
from sage.misc.instancedoc import instancedoc
Expand Down

0 comments on commit 6e384f5

Please sign in to comment.