Comments (7)
The following works for my immediate problem but it makes my skin crawl a little.
while a.startswith('-'):
a = a[1:]
while a.endswith('-'):
a = a[:-1]
from transcrypt.
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.
from transcrypt.
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?
Thanks!
from transcrypt.
Implementing this should be very easy, it's worth implementing.
from transcrypt.
I suggest we reopen this, too.
from transcrypt.
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.
from transcrypt.
@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.
from transcrypt.
Related Issues (20)
- object() constructor HOT 7
- Support for regex library? HOT 1
- Missing types in the typing module
- List concatenation not working HOT 3
- Can't compile curly braces in format string
- parcel_demo needs to be updated to use Parcel V2
- Adding two lists converts to a string HOT 2
- Is Transcrypt Dead? HOT 5
- nodejs_demo doesn't work as described on web site; does via readme HOT 2
- Compile error when importing a long (path and class) name HOT 2
- Feature: `__` private members/name mangling in classes HOT 1
- No error is thrown in list.pop(idx) when the index is out of range
- Can you please maintain directory structure in __target__/ ? HOT 1
- A boolean operator is translated to a bitwise operator, not a boolean operator HOT 1
- A method in the second base class is not called even when the first base class is empty.
- Minification error on del[] HOT 1
- Python built-in map() to support more than one iterable
- How to compare two methods?
- ... in python code aborts compilation
- Add python 3.12 syntax support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transcrypt.