-
-
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
Fix #9871 by making jl_substrtod/f whitespace-tolerant #9783
Conversation
130ecbb
to
d35b030
Compare
Do we want this behavior? As a datapoint, Python allows for trailing whitespace. >>> int("1\n")
1
>>> int("1 ")
1 |
I like it, makes parsing files a lot easier (e.g. parsing a line floats from a CSV manually doesn't require a |
Doesn't |
Good point! Pushed amended commit |
# float(SubString) wasn't tolerant of trailing whitespace, which was different | ||
# to "normal" strings. This also checks we aren't being too tolerant and allowing | ||
# any arbitrary trailing characters. | ||
@test float("1\n") == 1.0 |
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.
This needs to be changed to float64, but otherwise lgtm.
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.
It does call float64 though on all systems, right?
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.
It does, just thought it would be good to be explicit.
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.
Sure, I'll add it
There was an unusual Travis failure here for OSX that looked like #9572, but someone restarted the build and now the log with the failure is gone. If a failure log is worth keeping, it might be preferable to restart the build via rebasing rather than restarting through Travis' interface. |
I restarted it, sorry. Assumed it was a known issue. It did look like that though, you're right. |
Fix #9871 by making jl_substrtod/f whitespace-tolerant
Is this a backport candidate? #9781 (comment) |
I think it should be. Needs careful conflict resolution in backporting the tests, since there are other tests nearby for recent utf8proc and reverseind which would likely fail on release-0.3. |
Backported in 66f081d - someone speak up before we tag 0.3.9 in a few weeks if there's any backwards compatibility concerns about this (or any other backport for that matter). Apparently nobody was paying attention to the
bit a few months ago, whoops. |
No description provided.