Closed GoogleCodeExporter closed 8 years ago
The attached patch solves the problems in the following ways:
1. The argument passed to print is parenthesized.
2. raw_input() is first called; if the call fails, input() is used instead.
3. We make sure that at least the dividend is a float.
The patch also fixes some minor bugs:
* Math.PI -> math.pi;
* Blockly.Python.math_random_int returns the correct value.
Original comment by corbelli...@gmail.com
on 17 Sep 2012 at 3:03
Attachments:
I'm going to claim that point 3 is not an issue since Blockly does not
guarantee identical results in all languages. To do otherwise would require
every operator to be wrapped in a function call. This would kill legibility of
the generated code. See the last point on this page:
http://code.google.com/p/blockly/wiki/Language
Assigning to our Python guru, Quynh.
Original comment by neil.fra...@gmail.com
on 17 Sep 2012 at 3:07
Good point, you are right. The problem of legibility also came to my
mind while I was writing the fix. Here is the same patch without the
integer division fix.
Original comment by corbelli...@gmail.com
on 17 Sep 2012 at 3:28
Andrea,
Thank you for finding the bugs and providing great patches! Patches for issue
74 and issue 75 are now part of r419. You not only know JavaScript and Python
well but seem to understand deeply how Blockly works, it would be great if you
were a committer!
Original comment by Q.Neut...@gmail.com
on 21 Sep 2012 at 1:48
Original issue reported on code.google.com by
corbelli...@gmail.com
on 17 Sep 2012 at 2:58