-
Notifications
You must be signed in to change notification settings - Fork 216
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
Python string.strip() optional arguments not implemented #41
Comments
Indeed this was not yet done to keep the libraries as small as possible. Tried to cover the most common usage first. Probably will supply a more extensive lib in a later version. |
Can we reopen this one? I very much need a strip() that does more than trim whitespace. If not, can you suggest a workaround that will do the right thing in both Cpython and Transcrypt? |
Implementing this should be very easy, it's worth implementing. |
I suggest we reopen this, too. |
The following works for my immediate problem but it makes my skin crawl a little.
|
Don't think Javascript has anything that does that natively, so if Transcrypt did do so, it would probably compile to something like what you suggested, despite the discomfort that would induce :-). For example. The regex based suggested polyfill for native trim() at MDN is also interesting. Please mention what you settle on, could be useful. Perhaps one day one could have ones cake and eat it by having modules that provide closer cpython support at the cost of size / speed, thereby saving the core from bloat but providing the option to those that can live with that. |
@fzzylogic Good point! I think there are a couple of meta-issues here so I'm going to submit those separately to promote wider discussion. |
Python
foo
Generated javascript prints
foocba
The text was updated successfully, but these errors were encountered: