Am 28.05.13 18:20, schrieb Antoine Pitrou:
> Le Tue, 28 May 2013 23:07:37 +1000,
> Nick Coghlan <ncogh...@gmail.com> a écrit :
>> It was deliberate - a big part of PEP 432 is making sure that all the
>> interpreter state lives *in* the interpreter state (as part of the
>> config struct). 
> 
> It sounds a bit exagerated. We have encoders and decoders in the same
> (C) modules, compressors and decompressors ditto. Why not keep
> initialization and finalization in the same source file too?

I can sympathize with the motivation. Unlike encoders and decoders,
it is *very* tempting to put interpreter state into global variables.
With encoders and decoders, it's clear that globals won't work if you
have multiple of them. With interpreter state, it's either singletons
in the first place, or the globals can be swapped out when switching
interpreters.

By splitting initialization and finalization into distinct translation
units, you make it much more difficult to introduce new "hidden"
variables.

Regards,
Martin

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to