[issue42454] Move slice creation to the compiler for constants

Pablo Galindo Salgado report at bugs.python.org
Mon Nov 30 14:06:12 EST 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> I thought about using code.__hash__ in the first place, but the compiler's underlying store system (both compiler_unit->u_consts and compiler->c_const_cache) uses dictionary's where the keys are constant objects themselves (or tuples where one of the items is the constant). We might need to change that first (either using something else for the keys, or switch to lists? or something else).

I have to say that I feel that this will complicate things too much. Part of the appeal of this change is how straightforward and maintainable is. Fiddling with code objects lowers the watermark.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42454>
_______________________________________


More information about the Python-bugs-list mailing list