-
-
Notifications
You must be signed in to change notification settings - Fork 602
Lazy imports with deprecation #14275
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
Comments
Attachment: 14275.patch.gz |
Work Issues: failing doctest |
comment:2
Hey David, The doctest is failing because the mismatch of the trac numbers. Also could you add a doctest with a message as well? Thanks, Travis |
Reviewer: Travis Scrimshaw |
comment:3
The way I see it, deprecation only makes sense for stuff that is imported into the global namespace. Anything that is not directly accessible from the command line is, by definition, an implementation detail. And once you require backwards compatibility for implementation details it basically becomes impossible to change anything. So there is no point in deprecating import locations. |
Commit: |
comment:6
This could be used to remove things from the global namespace but the class itself doesn't change. New commits:
|
Branch: u/tscrim/14275 |
Changed work issues from failing doctest to none |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
Comment from the sage-combinat thread : the way it is implemented you add a "deprecation" Nathann |
comment:10
No, because then we'd have to import
Otherwise we completely change the syntax and functionality to include |
comment:11
Ahahaahha. Well, for as long as you know that the two reasons you gave me are bad reasons and can be easily avoided, all is fine. It is not so bad. Good to go ! Nathann |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Nathann Cohen |
Changed author from David Roe to David Roe, Travis Scrimshaw |
comment:12
Thanks Nathann. |
Changed branch from u/tscrim/14275 to |
It's annoying when other people move something around in the Sage library and it's no longer available in the previous location to be imported. Sage currently has some mechanisms for alleviating this problem (
sage.misc.superceded.deprecated_callable_import
andsage.structure.sage_object.register_unpickle_override
for example). This ticket adds another option: lazily import the old name so that a deprecation warning is issued whenever it is referred to.Component: misc
Author: David Roe, Travis Scrimshaw
Branch/Commit:
a484809
Reviewer: Travis Scrimshaw, Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/14275
The text was updated successfully, but these errors were encountered: