-
Notifications
You must be signed in to change notification settings - Fork 1k
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 tobool function #4647
Fix tobool function #4647
Conversation
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 rather an entire re work, it's not like bools can only consist of true
Also we should do strict comparison and not by just y
because str
could be equal to year
and it would still return as true
in this case
What do you suggest, why is this better than nothing, the current code is broken, it cannot index a string with the |
This function accepts any word that starts with It doesn't accept |
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.
For the time being, this works and fixes an otherwise broken function. We can move the discussion to what strings to accept to a separate issue.
Well what's the purpose of fixing something for the sake of just fixing it halfway that we open up another pr to fully fix it? |
Good point, it was a support function for loading XML but if it's used elsewhere, it should indeed be moved. I agree with all your points, I would just do one step at a time, but I would approve a major fix that checks all boxes 😉 |
alright sounds fine to me |
Pull Request Prelude
Changes Proposed
the
tobool
function was not getting any characters from the str parameter, so it would always returnfalse
In this case the correct
string.sub
method is being used and the correct index is1
Issues addressed: Nothing!