[stdlib-sig] new package idea: socket

Alexandre Vassalotti alexandre at peadrop.com
Mon Mar 10 01:50:48 CET 2008


On Sun, Mar 9, 2008 at 6:15 PM, Brett Cannon <brett at python.org> wrote:
> So this one kind of is screaming at me:
>
>  socket -> socket.__init__
>  SocketServer -> socket.server
>  ssl -> socket.ssl
>
>  I know Guido has expressed his dislike of putting much code in a
>  package's __init__, but since every module that would go in this
>  package is dependent on the socket module anyway, I see no harm.
>
>  What do people think?
>

I like it. Also, I think it make sense to put socket's code in
socket.__init__. Doing otherwise, would be redundant for the users.
Imagine:

import socket.socket
s = socket.socket.socket(socket.socket.AF_INET, socket.socket.SOCK_STREAM)

Ugh! (Of course, you could do use a from-import, to avoid this)

-- Alexandre


More information about the stdlib-sig mailing list