-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Fix handling of non ascii characters in swap case (fixes: #3847) #3848
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 handling of non ascii characters in swap case (fixes: #3847) #3848
Conversation
I noticed that the pre-commit hook failed - apparently due to some reformatting? Excerpt from the log:
Is there any action required by me to fix this? |
Would be good if type hints were added to the function, i.e.: from typing import Text
def swap_case(sentence: Text) -> Text:
... |
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.
Thank you for fixing this issue!
…ms#3847) (TheAlgorithms#3848) * TheAlgorithms#3847 fix handling of non-ASCII characters in swap_case * TheAlgorithms#3847 remove unused regex * Fix formatting (with black) Fixes: TheAlgorithms#3847 * Add type hints for `swap_case` function Co-authored-by: Frank Schmitt <[email protected]> Co-authored-by: Dhruv Manilawala <[email protected]>
…ms#3847) (TheAlgorithms#3848) * TheAlgorithms#3847 fix handling of non-ASCII characters in swap_case * TheAlgorithms#3847 remove unused regex * Fix formatting (with black) Fixes: TheAlgorithms#3847 * Add type hints for `swap_case` function Co-authored-by: Frank Schmitt <[email protected]> Co-authored-by: Dhruv Manilawala <[email protected]>
…ms#3847) (TheAlgorithms#3848) * TheAlgorithms#3847 fix handling of non-ASCII characters in swap_case * TheAlgorithms#3847 remove unused regex * Fix formatting (with black) Fixes: TheAlgorithms#3847 * Add type hints for `swap_case` function Co-authored-by: Frank Schmitt <[email protected]> Co-authored-by: Dhruv Manilawala <[email protected]>
…ms#3847) (TheAlgorithms#3848) * TheAlgorithms#3847 fix handling of non-ASCII characters in swap_case * TheAlgorithms#3847 remove unused regex * Fix formatting (with black) Fixes: TheAlgorithms#3847 * Add type hints for `swap_case` function Co-authored-by: Frank Schmitt <[email protected]> Co-authored-by: Dhruv Manilawala <[email protected]>
Describe your change:
This fixes 3847 - handling of non-ASCII characters in swap_case.
Output before (buggy):
python3 swap_case.py
Please input sentence:äü
ÄäÜü
Output now (correct):
python3 swap_case.py
Please input sentence:äü
ÄÜ
Checklist:
Fixes: #{$ISSUE_NO}
.=> It's not contained in the commit messages, but in the PR description. I hope this will suffice. Otherwise, I can of course add a dummy commit.