Message246139
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. |
|
Date |
User |
Action |
Args |
2015-07-03 06:23:22 | scoder | set | recipients:
+ scoder, gvanrossum, ncoghlan, vstinner, larry, Arfrever, asvetlov, python-dev, martin.panter, yselivanov |
2015-07-03 06:23:22 | scoder | set | messageid: <1435904602.72.0.552061743629.issue24325@psf.upfronthosting.co.za> |
2015-07-03 06:23:22 | scoder | link | issue24325 messages |
2015-07-03 06:23:22 | scoder | create | |
|