[Python-Dev] Add __exports__ to modules

Paul Prescod paulp@ActiveState.com
Mon, 08 Jan 2001 08:46:47 -0800


Tim Peters wrote:
> 
> ... It doesn't make any *sense* that os exports
> "sys" either, or that random exports "cos", or that cgi exports "string", or
> ... this inelegance is ubiquitous.

I agree strongly. I think that Python people are careless about what
their module dictionaries look like. My two main annoyances are modules
that export other modules randomly and modules that export huge wacks of
constants.

> Indeed.  But I'm suggesting that the problems that *can* arise from
> "import*" illustrate the fundamental silliness of exporting things by
> accident.  It's come up much more often for me when I'm looking over
> someone's shoulder, teaching them how to use dir() in an interactive shell
> to answer their own damn questions <0.5 wink>.  It's usually the case that
> dir(M) shows them something that isn't documented, and over time I am *not*
> pleased that "oh, I guess the 'string' in there is just crap" is how they
> learn to view it.

Screw dir()! Let's talk about important stuff: Komodo. And Idle. And
WingIDE. And PythonWorks and PythonWin. :)

How are class browsers and "intellisense prompters" supposed to know
that it "makes sense" to prompt the user with os.path but not
CGIHTTPServer.os.path. 

Overall, I think Tim is right. We are all adults here and part of being
adults is keeping your privates private and your nose clean.

 Paul Prescod