Re:A function decorator that rewrites the bytecode to enable...
by ufo on Monday September 20, 2021 @09:23PM
(#28601072)
One thing I don't like about goto is that it allows the creation of irreducible control flow. Makes all kinds of optimizations and program analysis more difficult. When I have the chance, I advocate for more well behaved alternatives such as labeled break statements. Although they're more restrictive, most of the time they're all you need.
[ Parent
| on HN ]
Re:A function decorator that rewrites the bytecode to enable...
by klyrs on Monday September 20, 2021 @09:55PM
(#28601253)
This is true, but I suspect that you're getting downvoted because python doesn't do bytecode optimization.
Re:A function decorator that rewrites the bytecode to enable...
by nerdponx on Monday September 20, 2021 @11:21PM
(#28601774)
CPython doesn't. But the other Python implementations (PyPy, GraalVM, et al) don't even use the CPython bytecode.
Re:A function decorator that rewrites the bytecode to enable...
by klyrs on Tuesday September 21, 2021 @12:16PM
(#28606578)
Also true... but this decorator isn't going to work in that context.
Re:A function decorator that rewrites the bytecode to enable...
by masklinn on Tuesday September 21, 2021 @05:37AM
(#28603383)
Cpython absolutely does, just not much of it (it has a peephole optimiser with a very small set of opts).