| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| if (sym_matches_type(arg, &PyUnicode_Type)) { | ||
| // e.g. str('foo') or str(foo) where foo is known to be a string | ||
| PyObject *value = sym_get_const(ctx, arg); | ||
| res = sym_new_const(ctx, value); | ||
| } |
There was a problem hiding this comment.
This is an optimization that Brandt suggested. When in str(foo), foo is known to be a string, we can propagate it to the output. I also added a test for this case.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks great! Just two suggestions:
Sorry, something went wrong.
|
Thanks for the review! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
CALL_STR_1 is equivalent to str(...).
Very similar to previous work on splitting up CALL_TYPE_1: #132419
This splits the instruction into a smaller instruction + 2 guards which can be optimized away. This also sets the return type to str.