| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
How do you feel about recursively checking the tuple's elements for safety? Something like: if (typ == &PyTuple_Type) {
Py_ssize_t length = _Py_uop_sym_tuple_length(sym);
if (length < 0) {
return false;
}
for (Py_ssize_t i = 0; i < length; i++) {
if (!_Py_uop_sym_is_safe_const(ctx, sym)) {
return false;
}
}
return true;
}Potential downside is that in theory, the tuples could be huge. We could set an upper bound of a maximum of a few elements or something, though (but that gets tricky with the recursion, which could be arbitrarily deep too). |
Sorry, something went wrong.
|
The tuples in the optimizer are limited to a size of 6, though that could recursively go on for a long time... I think it's not worth thinking over. I don't think it's a common thing to use tuples in a "constant" way to do operations on. If they are, they would use lists instead. Unless of course they want to program in an immutable fashion. |
Sorry, something went wrong.
|
Constant tuples can be arbitrary size. This constant evaluation doesn’t operate on abstract tuples. But your point stands, probably better to ignore them for now. |
Sorry, something went wrong.
Fix up pure types in JIT
Fix up pure types in JIT
Fix up pure types in JIT
Fix up pure types in JIT
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.