-
-
Notifications
You must be signed in to change notification settings - Fork 673
Fixes in save_session() #37004
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
Merged
Merged
Fixes in save_session() #37004
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was introduced to help transition from python 2 to python 3 and is no longer used.
There's no need to do it. Moreover, dictionaries in python keep insertion order, so we don't need to sort for testing either. Note that in the test sage: a = 10 sage: factor = 20 sage: show_identifiers() ['factor', 'a'] factor is indeed inserted first at sagemath startup (as a function)
Documentation preview for this PR (built with commit 2673c8b; changes) is ready! 🎉 |
fchapoton
approved these changes
Jan 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Jan 16, 2024
sagemathgh-37004: Fixes in save_session() 1. fix test for cython functions in save_session() This fixes sagemath#37003 2. fix handling of lazy import variables in save_session() This fixes sagemath#37002 3. remove unused `extra_globals` attribute in class DocTestTask This was introduced for the transition from python 2 to 3, no longer used 4. don't sort the output of `sage.misc.session.show_identifiers()` There's no need to sort here... sorting was introduced in baedc41 in order to fix doctest errors, but dictionaries now keep the insertion order. Thus `show_identifiers()` will return the variables in the order they were introduced for the first time which seems reasonable and it's fine to test. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. Fixes: sagemath#37002, sagemath#37003 URL: sagemath#37004 Reported by: Gonzalo Tornaría Reviewer(s): Frédéric Chapoton
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Jan 16, 2024
sagemathgh-37004: Fixes in save_session() 1. fix test for cython functions in save_session() This fixes sagemath#37003 2. fix handling of lazy import variables in save_session() This fixes sagemath#37002 3. remove unused `extra_globals` attribute in class DocTestTask This was introduced for the transition from python 2 to 3, no longer used 4. don't sort the output of `sage.misc.session.show_identifiers()` There's no need to sort here... sorting was introduced in baedc41 in order to fix doctest errors, but dictionaries now keep the insertion order. Thus `show_identifiers()` will return the variables in the order they were introduced for the first time which seems reasonable and it's fine to test. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. Fixes: sagemath#37002, sagemath#37003 URL: sagemath#37004 Reported by: Gonzalo Tornaría Reviewer(s): Frédéric Chapoton
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Jan 16, 2024
sagemathgh-37004: Fixes in save_session() 1. fix test for cython functions in save_session() This fixes sagemath#37003 2. fix handling of lazy import variables in save_session() This fixes sagemath#37002 3. remove unused `extra_globals` attribute in class DocTestTask This was introduced for the transition from python 2 to 3, no longer used 4. don't sort the output of `sage.misc.session.show_identifiers()` There's no need to sort here... sorting was introduced in baedc41 in order to fix doctest errors, but dictionaries now keep the insertion order. Thus `show_identifiers()` will return the variables in the order they were introduced for the first time which seems reasonable and it's fine to test. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. Fixes: sagemath#37002, sagemath#37003 URL: sagemath#37004 Reported by: Gonzalo Tornaría Reviewer(s): Frédéric Chapoton
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes save_session() broken when cython changes #37003
This fixes save_session() is broken when interactive #37002
extra_globals
attribute in class DocTestTaskThis was introduced for the transition from python 2 to 3, no longer used
sage.misc.session.show_identifiers()
There's no need to sort here... sorting was introduced in baedc41 in order to fix doctest errors, but dictionaries now keep the insertion order. Thus
show_identifiers()
will return the variables in the order they were introduced for the first time which seems reasonable and it's fine to test.📝 Checklist
Fixes: #37002, #37003