Static variables [was Re: syntax difference]

Chris Angelico rosuav at gmail.com
Sat Jun 23 01:21:33 EDT 2018


On Sat, Jun 23, 2018 at 2:16 PM, Chris Angelico <rosuav at gmail.com> wrote:
> For getting rid of the "len=len" trick, though, I would REALLY like to
> transform those into LOAD_CONST. That'd be a fun bytecode hack all on
> its own. In fact, I'm gonna have a shot at that. An "early bind these
> names" decorator.

Well, that was easier than I expected. Which almost certainly means I
haven't properly solved the problem.

https://github.com/Rosuav/shed/blob/master/consts.py

Let's start finding all the edge cases that don't work, so I can work
on fixing them :)

ChrisA



More information about the Python-list mailing list