[Python-ideas] re-organizing the sys module
Antoine Pitrou
solipsis at pitrou.net
Thu Mar 13 10:17:47 CET 2014
Le 13/03/2014 08:43, Eric Snow a écrit :
> At the moment I'm not proposing any big changes to sys nor any changes
> at all to its API. That can come later. <wink> Instead, this
> proposal is about setting the stage for better flexibility in making
> changes to sys when the need arises. Consequently I propose just
> 2.5000000000000001 relatively simple changes:
>
> 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.
> 2.5. the new module should use the replace-itself-in-sys.modules
> technique to provide a module subclass that supports descriptors.
I don't think any module should be specific in that regard. Special
cases generally make the language more complicated to learn. Also, you
haven't explained the rationale.
Regards
Antoine.
More information about the Python-ideas
mailing list