You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it might be possible to add a path parameter to run_code, so that it could create a code objection a different path than the default of "<string>\0". It could be an optional parameter that defaults to the current value. Alternatively, to not break the API, maybe another function called run_code_path could be created that is also public that run_code calls with that parameter?
I am doing arbitrary code execution, but I want the tracebacks to refer to line numbers that can be referenced, so I am creating a temporary file, writing the code to it, then evaling that code with that path:
Hello!
I was wondering if it might be possible to add a
path
parameter torun_code
, so that it could create a code objection a different path than the default of"<string>\0"
. It could be an optional parameter that defaults to the current value. Alternatively, to not break the API, maybe another function calledrun_code_path
could be created that is also public thatrun_code
calls with that parameter?Currently, I am keeping a duplicate of that function in my source with the parameter added, which adds some overhead when changes happen upstream.
I am doing arbitrary code execution, but I want the tracebacks to refer to line numbers that can be referenced, so I am creating a temporary file, writing the code to it, then evaling that code with that path:
https://github.com/egraphs-good/egglog-python/blob/59b04eaa4f87ac320385efe4b6d71e93db64a116/src/py_object_sort.rs#L351-L365
I am happy to make a PR to add this feature if it is desired. Thanks!
The text was updated successfully, but these errors were encountered: