[Python-ideas] re-organizing the sys module
Eric Snow
ericsnowcurrently at gmail.com
Fri Mar 14 03:08:35 CET 2014
On Mar 13, 2014 3:18 AM, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
>
> Le 13/03/2014 08:43, Eric Snow a écrit :
>
>> 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.
It means no one needs to change 'import sys' to 'import _sys' in their code.
> 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.
As I noted, we would need to update some spots in the stdlib to import _sys
rather than sys.
>
>
>> 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.
As others have noted, there isn't much point to making any of these changes
until we have some need that they satisfy. I anticipate having that need
in the mid-term and wanted to see if the proposed approach is palatable.
-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140313/db60724e/attachment.html>
More information about the Python-ideas
mailing list