Created
July 25, 2020 03:38
-
-
Save Ksengine/8171e2d769056a9ee2e401cdc4f2aa26 to your computer and use it in GitHub Desktop.
Python Script Object Notation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stringify(obj): | |
return str(obj) | |
def parse(string): | |
if string[0] == ' ': | |
raise Exception('cannot parse') | |
for i in __builtins__.__dict__: | |
if string.startswith(i+'('): | |
raise Exception('cannot parse') | |
if string.startswith(i+' '): | |
raise Exception('cannot parse') | |
return eval(string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment