[Python-3000] Dict literal bytecode

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Mar 25 21:43:10 CET 2008


On Tue, Mar 25, 2008 at 4:26 PM, Adam Olsen <rhamph at gmail.com> wrote:

>  I meant that there may be disgustingly
>  large globals that exceed some maximum size the stack allows.

I am to aware of any hard limit on the stack size other than whatever
the limit for a contiguous in-memory array may be.


>  Can you confirm/disprove that the maximum size will be the same after as it
>  was before?
>
It is possible to design an artificial program that will have a larger
peak memory footprint with batch processing than without, but my
argument is that it is unlikely encounter such a program in the wild.


>  It does not even have to be a frozenset.  A set works just as well,
>  never modified by the produced bytecode.
>

With the current implementation, precomputed constants must be
hashable because the compiler uses a dictionary lookup in order to
eliminate duplicates.  This is of course just an implementation
detail, but it would actually be hard to work around it.


More information about the Python-3000 mailing list