[Python-Dev] PEP about sys.implementation and implementation specific user site directory

Brett Cannon brett at python.org
Sat Oct 10 04:35:48 CEST 2009


On Fri, Oct 9, 2009 at 18:14, Benjamin Peterson <benjamin at python.org> wrote:

> 2009/10/9 Christian Heimes <lists at cheimes.de>:
> > Benjamin Peterson wrote:
> >> I think we should make a semi-private (public to the stdlib) module
> >> like _sys or _implementation part of the Python VM API. Then, instead
> >> of stuffing everything into sys, we can provide this information in
> >> modules where it belongs.
> >
> >
> > That's an interesting counter proposal. Your idea requires an additional
> > import that I try to avoid. Looking at memory and performance, an
> > additional module that is imported anyway isn't better. In my humble
> > opinion the implementation information belongs into the sys module
> > anyway. A new module just for the user site suffix seems unnecessary.
>
> But we want to hide that this is an implementation detail from the
> user. Having a new module just for this attribute might seem like
> overkill, but I hope that we could use it for more things in the
> future.


To also address Christian's import worry, this new module could contain
everything needed to start the interpreter, much like _warnings does
compared to warnings.

But I honestly don't see why this doesn't belong in sys; it has to do with
the system environment which is the interpreter. Yes, some things currently
in sys could possibly be put elsewhere (e.g. the exception stuff could be in
'exceptions'), but I don't think sys is that much of an odd collection of
code. Without having a desire to eventually clean up the sys module (which I
am not proposing as I know that will never fly) I don't see this as being
worth it.



> Besides, if _sys is a builtin module, importing it will not
> add much overhead.
>

Well, that's assuming the other interpreters makes it built-in. Otherwise
it's only a CPython/python.org perk.


>
> I forgot to ask before: Does this deprecate
> platform.python_implementation()?


 Probably should.

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20091009/a6fc4983/attachment-0001.htm>


More information about the Python-Dev mailing list