Conversation
mathics/builtin/system.py
Outdated
| <url>:Python 3.11:https://docs.python.org/3.11/library/stdtypes.html#int-max-str-digits</url> | ||
| <dl> | ||
| <dt>'$MaxLengthIntStringConversion' | ||
| <dd>A system constant that fixes the largest size of the String resulting from converting |
There was a problem hiding this comment.
String -> 'String' here and below. Integer ->'Integer'
"converting" -> "converting " so there is no hard line break.
Yes, our docstring formatting is weird. I hope to live to see the day when we can ditch it.
mathics/builtin/system.py
Outdated
|
|
||
| class MaxLengthIntStringConversion(Predefined): | ||
| """ | ||
| <url>:Python 3.11:https://docs.python.org/3.11/library/stdtypes.html#int-max-str-digits</url> |
There was a problem hiding this comment.
Python 3.11 -> Python 3.11 Integer string conversion length limitation
mathics/builtin/system.py
Outdated
| an Integer into a String. | ||
| </dl> | ||
|
|
||
| >> originalvalue = $MaxLengthIntStringConversion |
There was a problem hiding this comment.
The example is good, but I think there should be comments explain better what is going on. In particular, that internally things are okay, but when we get down to displaying the results or formatting, then we have a problem in converting to the output string because it may take a long time.
In a PR to get merged into this, I will work on some suggested expanded verbiage.
There was a problem hiding this comment.
I tried to improve the description, but I do not know how much we want to go deeper into this.
There was a problem hiding this comment.
One technique is to give something succinct but then use the examples to elucidate further. Examples though need some additional commentary and motivation was to why there are used, and what to look for, rather than be pure code.
| value_str = f"{msd} <<{num_digits - len(lsd)-len(msd)}>> {lsd}" | ||
| return String(value_str) | ||
|
|
||
|
|
There was a problem hiding this comment.
We should write a pytest for this.
There was a problem hiding this comment.
I just used the WL convention used when the same expression is formatted with Short
There was a problem hiding this comment.
Ok - we'll go with this kind of elision then. But we haven't tested it. And this kind of thing is not clear in the docstring either.
There was a problem hiding this comment.
Now I put a bunch of pytests. Also, I inaugurated the /test/eval/ directory.
f242297 to
9ec00f5
Compare
Go over mathics.builtin.system documentation
|
Whew! We've beat this one to death (for the time being). In the back of my mind is to mention the environment variable Merge and iterate. |
These are my 2 cents to solve the issue presented in #941