sanyaade-g2g-repos / skulpt

Automatically exported from code.google.com/p/skulpt
Other
0 stars 0 forks source link

2.x or 3.x? #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This isn't really a bug report, but rather something to consider when building 
any Python implementation: are we trying to emulate Python 2.x, or 3.x? 

Some features seem to behave more like 3.x (int/int = float) while others favor 
<3.0 (print as a statement, rather than a function).

Original issue reported on code.google.com by carnioja...@gmail.com on 29 Nov 2010 at 4:54

GoogleCodeExporter commented 9 years ago
It's a bit odd right now, but for the most part the semantics are 3.x
because they're more regular and cleaner (no old-style classes, eg.) but the
syntax is 2.x because that's the parser that I had/wrote.

So, probably not the answer you were looking for, but that's what it is
right now.

Original comment by sgraham on 30 Nov 2010 at 4:57

GoogleCodeExporter commented 9 years ago

Original comment by sgraham on 30 Nov 2010 at 5:48

GoogleCodeExporter commented 9 years ago
Slight addendum, I currently expect the output to be the same as taking 2.x, 
running 2to3, and then running on python3. This isn't actually how I currently 
test, but for various object related behaviour, this is how Skulpt acts.

Original comment by sgraham on 30 Nov 2010 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by sgraham on 30 Nov 2010 at 7:32

GoogleCodeExporter commented 9 years ago
So I've been working on a Python 3 parser (basically just copying+pasting the 
asdl and refactoring the tokenizer) for Skulpt just in case anyone's 
interested.. been hitting some snags though, on the tokenize.py, since the 
python 3 tokenizer doesn't seem to have a comment token (and just generally 
does some weird stuff) :-/

Original comment by carnioja...@gmail.com on 22 Jun 2011 at 7:02