-
-
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
Should lpad/rpad be defined in terms of textwidth instead of code units or have the option to do so? #38256
Comments
I have seen functions like Does someone know the usecase for using |
Triage said |
From triage: we can't think of a use case where you would want |
Hey, |
Go for it! |
@rohanxyzg, Just a heads up since you post this in a few "good first issue" posts, there is generally no need to "claim" an issue, you can just start working on it and submit a PR when it is finished :). |
Hi, can you help me out with how should I approach this issue! |
Fix #38256, per triage consensus there
Fix JuliaLang#38256, per triage consensus there
Fix JuliaLang#38256, per triage consensus there
One of the main use cases of
lpad
andrpad
is, at least for me personally, to align things in the terminal. However,lpad
andrpad
are defined (and documented) to work in terms of code units (i.e. they calllength
on the input string) which means that whenlength
andtextwidth
disagree, you get unaligned output:This can cause bugs like KristofferC/TimerOutputs.jl#94.
Two points of discussions:
textwidth
instead oflength
? Perhaps too much of a breaking change.textwidth
, e.g. with a kwarg?The text was updated successfully, but these errors were encountered: