[Python-ideas] re-organizing the sys module

Serhiy Storchaka storchaka at gmail.com
Thu Mar 13 13:04:15 CET 2014


13.03.14 11:17, Antoine Pitrou написав(ла):
>> 1. the existing sys module be renamed to _sys (and the stdlib be
>> changed accordingly where appropriate);
>> 2. a pure Python sys module be added to the stdlib that wraps the
>> existing API;
>
> I'm not sure what that brings until the need arises.
> However, making it a pure Python sys module means it won't be
> immediately available at startup like sys currently is (i.e. it's a
> built-in module). I don't know if there are any scenarios where it may
> matter.

Many sys attributes (argv, displayhook, excepthook, modules, path, 
path_hooks, path_importer_cache, ps1, ps2, stderr, stdin, stdout, 
tracebacklimit) are used implicit in builtins and in interpreter core. 
Even import system doesn't work without the sys module. So it should be 
initialized very early and finalized very late.




More information about the Python-ideas mailing list