[pypy-dev] How are namespaces implemented in rpython?

Carl Friedrich Bolz cfbolz at gmx.de
Tue Dec 6 11:54:14 CET 2011


On 12/06/2011 05:40 AM, Alexander Golec wrote:
> I'm guessing this explains this fragment from the rpython coding guide:
>
> *constants*
>
>     all module globals are considered constants. Their binding must not
>     be changed at run-time. Moreover, global (i.e. prebuilt) lists and
>     dictionaries are supposed to be immutable: modifying e.g. a global
>     list will give inconsistent results. However, global instances don’t
>     have this restriction, so if you need mutable global state, store it
>     in the attributes of some prebuilt singleton instance.

Exactly.

Cheers,

Carl Friedrich



More information about the pypy-dev mailing list