-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sage.matrix: Resolve circular imports without using __init__.py #30784
Comments
This comment has been minimized.
This comment has been minimized.
Author: Matthias Koeppe |
New commits:
|
Commit: |
comment:3
What's the advantage of using global variables? I think python is also caching the imported module under the hood (https://docs.python.org/3/reference/import.html#the-module-cache). |
comment:4
I'm imitating existing code in Cython modules here, for example in |
comment:6
Green patchbot, needs review. (One other patchbot fails with an unrelated error.) |
comment:7
LGTM |
Reviewer: François Bissey |
comment:8
Thanks! |
comment:9
Without double-checking I would guess that the python import cache is heavily optimized. But even given the minimal performance penalty, I would suggest to using a simple import in favor of the global variable. The latter is a possible source of bugs (devs forgetting to use import before using it) and heavily complicates the work of static type checking tools. But maybe I'm also missing some other advantages of this approach (@francois). |
Changed branch from u/mkoeppe/sage_matrix__resolve_circular_imports_without_using___init___py to |
This is preparation for making
sage.matrix
a namespace package in #28925.CC: @simon-king-jena @tscrim @tobiasdiez @videlec @kiwifb
Component: refactoring
Author: Matthias Koeppe
Branch/Commit:
ea0d15a
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/30784
The text was updated successfully, but these errors were encountered: