Static variables [was Re: syntax difference]

Chris Angelico chris.angelico at 1
Sat Jun 23 16:21:32 EDT 2018


From: "Chris Angelico" <chris.angelico at 1:261/38.remove-r7u-this>

From: Chris Angelico <rosuav at gmail.com>

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

-+- BBBS/Li6 v4.10 Toy-3
 + Origin: Prism bbs (1:261/38)

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)



More information about the Python-list mailing list