-
Notifications
You must be signed in to change notification settings - Fork 171
Add isspace API in str #2373
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
Add isspace API in str #2373
Changes from 14 commits
f40f524
a468227
18b2f70
b89419d
08aa19a
dad38f9
2642039
273844c
c4af949
c576fa4
a9ac4af
24ec976
96c069d
8fa3b8d
ceafe99
ce6917e
c7fcfce
58f8dc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -858,6 +858,15 @@ def _lpython_str_isascii(s: str) -> bool: | |||
return False | ||||
return True | ||||
|
||||
@overload | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know what overload does. from the code, it seems it adds attributes to it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, we have to remove |
||||
def _lpython_str_isspace(s:str) -> bool: | ||||
ch: str | ||||
for ch in s: | ||||
if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\v': | ||||
return False | ||||
return True | ||||
|
||||
|
||||
def list(s: str) -> list[str]: | ||||
l: list[str] = [] | ||||
i: i32 | ||||
|
Uh oh!
There was an error while loading. Please reload this page.