[stdlib-sig] new package idea: socket

Fred Drake fdrake at acm.org
Mon Mar 10 01:19:03 CET 2008


On Mar 9, 2008, at 8:13 PM, Brett Cannon wrote:
> Problem with that is it goes against name simplification;
> 'socket.socket' is not as simple as 'socket'. So why do the two of you
> think this is better than just importing 'socket'?

With the proposal, you still just import socket, but the  
implementation for the names in socket is in socket.socket.

The motivation is more of a pattern that I've seen work well in  
practice:  __init__.py is pretty minimal, and the implementations are  
all in "normal" modules with package.module names.  The real advantage  
is that all real code is in a file with a descriptive name; __init__  
doesn't describe package contents, but package initialization.


   -Fred

-- 
Fred Drake   <fdrake at acm.org>






More information about the stdlib-sig mailing list