differentmatt / filbert

JavaScript parser of Python
Other
133 stars 27 forks source link

true and false shouldn't be valid Python #50

Closed dideler closed 8 years ago

dideler commented 9 years ago

In filbert, True and true in Python both get evaluated to true; in JS. Similarly, False and false evaluate to false; in JS.

Only True and False should work. Python would consider true and false variables, and if they weren't defined beforehand, calling them would result in a NameError. E.g.

NameError: name 'true' is not defined

Remembering that Python booleans are titleized is another learning block, so this bug may give new programmers a less frustrating experience (avoids moments like "why isn't my if statement working?") but it also teaches them incorrect Python. Just something to consider.

dzhang314 commented 9 years ago

On a related note, str(True) and str(False) ought to return "True" and "False", not "true" and "false".

nwinter commented 8 years ago

Fixed with @basicer's new Esper interpreter.