-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
deprecate print_shortest? #25745
Comments
Triage decided the code can remain in Grisu, but it shouldn't be exported anymore |
Triage: We should un-export this from base, but keep it available in Grisu if people want to use it directly. Using Grisu directly is sometimes a reasonable thing to do if you want really custom float printing, e.g. the plotting packages use it to print data points with consistent precision. |
print_shortest is also used in writedlm(), line 733 of DelimitedFiles in stdlib. |
As part of the stdlib it's fairly kosher for that to depend on an internal Base function since they will be updated in sync. |
This could become a |
We could also just get rid of this since the only reason |
I've been strongly reluctant to have IOContext be used to pass specific formatting choices recursively. I think if you care about that level of detail in your output, you should [have to] define the recursive structure also. Not sure why mbauman removed needs-tests – this function does not appear to have any. If it's not simply deleted, it needs them written instead. |
This issue doesn't add any features so this is not the place to put the "needs tests" label. If you want to open a separate issue about testing |
Now that we have |
Frankly, I'm just not sure this is all that necessary of a function. But sure, that's an option. |
I think the magic of print_shortest in writedlm() is not necessary. It lose the type differentation for floats with '*.0' because print_shortest write them as '0', so afterwards you dont know wether this element was originaly an Int or an Float. |
This deprecates `print_shortest` to `Base.Grisu.print_shortest`. The only place where `print_shortest` is used is in DelimitedFiles, when writing numeric values. This has been changed to `print`, which is technically a breaking change, though it more accurately represents the value being written. Fixes #25745.
This is kind of a weird, old legacy function that we export. Should we deprecate it? Use an IO context flag? Just unexport it?
The text was updated successfully, but these errors were encountered: