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.misc.defaults.variable_names return tuple in all cases #29797
Comments
Commit: |
This comment has been minimized.
This comment has been minimized.
Author: Reimundo Heluani |
comment:3
For safety: def latex_variable_names(n, name=None):
- """
+ r"""
Converts a root string into a tuple of variable names by adding
numbers in sequence. Also, minor nitpick with the doc formatting: - - ``n`` a non-negative Integer. The number of variable names to
- output.
- - ``names`` a string (Default: ``None``); The root of the variable
- name.
+ - ``n`` a non-negative Integer; the number of variable names to
+ output
+ - ``names`` a string (default: ``None``); the root of the variable
+ name. Once changed, you can set a positive review on my behalf. |
Reviewer: Travis Scrimshaw |
comment:4
Thanks for making the fix, but I think there are space characters at the ends of some lines (and a line with only spaces). Please get rid of those spaces. Also, since you are editing the file, please change |
comment:5
Replying to @DaveWitteMorris:
I am -1 on this change because it is actually slower (surprisingly) to not have the inner list comprehension. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
Replying to @tscrim:
Was I suppose to make this change to 'positive review'? |
comment:8
Replying to @tscrim:
Indeed! There's no "tuple comprehension" in python; just the possibility to make a tuple from an iterator. You can save the "tuple" by writing
but as far as I can see this has about the same performance as |
comment:9
OK, I stand corrected. I made the suggestion because it was a reviewer comment on one of the patches I wrote, and made sense to me. (I did some quick tests on this case and I am usually not seeing any significant difference in performance, but |
Changed branch from u/heluani/sage_misc_defaults_variable_names_return_tuple_in_all_cases to |
sage.misc.defaults.variable_names and latex_variable_names return tuple if the number of variable names requested is bigger than 1 or 0 and a list if it's 1. This ticket fixes that.
Component: misc
Author: Reimundo Heluani
Branch/Commit:
725d4b5
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/29797
The text was updated successfully, but these errors were encountered: