-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Feature or enhancement
Proposal:
I want to add two functions to the CPython programming language. They interact with the CPython backend itself. Here they are:
exec_c()
eval_c()
It would make Python way more customizable.
They would have full access to the global variables of the backend, so it could be used as an extender for the project,
or you could use it to test a driver, say:
You have a driver that nullifies BugKeCheck2
(the function that raises BSODs) and want to test it, but don't have gcc
, etc...
You are familiar with Python, but you know you have to raise it from low(er)-level C, so you do:
exec_c("BugKeCheck.BugKeCheck1.BugKeCheck2();", accept_errors=True)
Example:
# P.S.: I don't know how to code in C, so im using what I do know
exec_c('"Hello" >> stdout;') # None
eval_c('"Hello" >> stdout;') # "Hello"
[EDIT: I am not a big fan of this anymore.]
Has this already been discussed elsewhere?
This is a minor feature [EDIT: This is proven otherwise, as it "needs a PEP" (-@sobolevn. Nov 10, 2024)], which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response