Comments (2)
@jayvdb
Existing testcases didn't catch this one..
Ruby uses a greater than, whereas python is a greater-than/equal-to for positive steps
But this seems a little tricky to do "in-place" as the range step may be ascending or descending.
I'm not sure how much this deviates from the original philosophy of trying to do as much as possible in-line, but I think an additional range-function: PyLib.range()
on the ruby side that closely maps to python's behavior is the best way to proceed in terms of correctness - at the expense of having to include the module using either the -r/-b options for py2rb.
from py2rb.
I am open to either approach. py2many
transpilers usually have a supporting library to deal with Python, and I am already adding a -r .../py2rb/builtins/module.rb
in my wrapper. However most also implement Python range
by doing +1 or -1 on the args in-place. See https://github.com/adsharma/py2many/search?q=visit_range
from py2rb.
Related Issues (14)
- Bare except catching failure
- sys.argv and sys.exit
- py2many tests/cases/assert.py fails
- byte literals not supported HOT 4
- Syntax error in maths
- only two ok HOT 1
- Bug when using py2rb HOT 2
- Instructions HOT 1
- 🎉
- Test [FAIL] HOT 2
- Support for Python 3.8
- AnnAssign not supported
- Upper case variable names in functions causes ruby error: dynamic constant assignment
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 py2rb.