Message246139
| Author |
scoder |
| Recipients |
Arfrever, asvetlov, gvanrossum, larry, martin.panter, ncoghlan, python-dev, scoder, vstinner, yselivanov |
| Date |
2015年07月03日.06:23:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1435904602.72.0.552061743629.issue24325@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This is not purely about speeding up the code. It's also about avoiding to replace the code object of a function, which is essentially a big and clumsy hack only to achieve setting a flag. Some tools, namely line_profiler, use the current code object as a dict key for state keeping. Replacing the reference in "__code__" might confuse them if they happened to catch a reference before.
That's why I asked for applying at least the simple patch that sets the flag with a C level helper function. But I'd be ok with applying the latest patch as it is. The non-flag-setting parts are simple and a straight forward translation of the current Python code. |
|