isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Unable to use variables autoinitialized to input from `.v` #262

Open Mukundan314 opened 4 years ago

Mukundan314 commented 4 years ago

Using variables auto initialized to input (i.e. z,Q) from .v like:

.v"z

gives the error:

Traceback (most recent call last):
  File "pyth.py", line 771, in <module>
  File "<string>", line 3, in <module>
  File "pyth.py", line 434, in pyth_eval
  File "<string>", line 1, in <module>
NameError: name 'z' is not defined
mathcat4 commented 3 years ago

@Mukundan314 Also doesn't work with just v"z. ;-) Then the error is

Traceback (most recent call last):
  File "pyth.py", line 771, in <module>
  File "<string>", line 3, in <module>
  File "/app/macros.py", line 1093, in Pliteral_eval
  File "/app/.heroku/python/lib/python3.7/ast.py", line 91, in literal_eval
  File "/app/.heroku/python/lib/python3.7/ast.py", line 90, in _convert
  File "/app/.heroku/python/lib/python3.7/ast.py", line 63, in _convert_signed_num
  File "/app/.heroku/python/lib/python3.7/ast.py", line 55, in _convert_num
ValueError: malformed node or string: <_ast.Name object at 0x7efcabb279e8>