-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
lazy import attributes of a class are not substituted back after the import #15648
Comments
comment:1
See my comment at #10963. We could simply create a lazy class attribute with an import statement inside. Proof of concept:
Alternatively, since |
comment:2
Strange. Shouldn't if owner is None:
if self._namespace and self._namespace[alias] is self:
self._namespace[alias] = self._object
else:
from inspect import getmro
for cls in getmro(owner):
if cls.__dict__.get(alias, None) is self:
setattr(cls, alias, self._object)
break This should actually do the trick. |
comment:3
In the example of the ticket description, I suppose you simply need to proved |
comment:4
The only (mild) problems I see:
Hence, I am all for removing |
Work Issues: Do we need a lazy import to act as lazy instance attribute? |
comment:5
Hence, unless you agree that we should change the lazy import statement so that it additionally acts as a lazy instance attribute, then this ticket is invalid. |
Author: Jeroen Demeyer |
Dependencies: #22752 |
Changed work issues from Do we need a lazy import to act as lazy instance attribute? to none |
Branch: u/jdemeyer/ticket/15648 |
Commit: |
Changed commit from |
Changed author from Jeroen Demeyer to none |
Changed branch from u/jdemeyer/ticket/15648 to none |
Changed dependencies from #22752 to none |
Component: misc
Issue created by migration from https://trac.sagemath.org/ticket/15648
The text was updated successfully, but these errors were encountered: