-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Executors - the SimpleEval equivalent of exec() #66
Conversation
only runs through generators as values are required (e.g. `next([a for a in range(1000)])` won't build a huge list); allows extension to other comprehension types
3.8 changed some things
# Conflicts: # .gitignore
Hello @mommothazaz123! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Note: This PR includes the changes in #62, #63, and #64.
I'd like to hear any comments on the idea of extending SimpleEval to execute a full body of statements, akin to py3's
exec()
function! This draft PR includes an implementation (starting on L746) that builds off of my changes in #63 ofSimpleExecutor.execute(expression)
.Additionally, I implemented multi-line statements and control flow (
if
,for
,while
,break
, etc) inExecutorWithControl
.Let me know if this sounds like something that's out of this library's scope, or if I should write up some test cases for executors!
Here's some examples of executors in action:
If-else
For
Nested control
Keyword control