Hide module function definitions

A. Lloyd Flanagan alloydflanagan at comcast.net
Tue Jun 15 18:08:11 EDT 2004


"Raymond Tinsel" <tinsel at wt.tno.nl> wrote in message news:<cammdg$g9o$1 at voyager.news.surf.net>...
> In those modules I also have function definitions of functions I only use in
> that module.
> Is it possible to hide these functions when somebody would use "import
> mymodule"?

If you start the function name with an underscore, python won't import
it.  Also, you can define the special variable __all__.

See http://docs.python.org/ref/import.html.



More information about the Python-list mailing list