Windows console is broken

bearophile bearophileHUGS at lycos.com
Fri Feb 1 12:56:58 PST 2008


Bill Baxter:
> I think python's a little different though in that there is no real 
> "private".  A language with a public-everything philosophy really needs 
> to watch out for namespace pollution.

I agree, I wasn't comparing the two languages because the situations are a little different (and in D you have function signatures that are enforced more by the compiler, that changes the situation a lot).
But in Python you can use names starting with _ and the __all__ to improve the situation some:

>The public names defined by a module are determined by checking the module's namespace for a variable named __all__; if defined, it must be a sequence of strings which are names defined or imported by that module. The names given in __all__ are all considered public and are required to exist. If __all__ is not defined, the set of public names includes all names found in the module's namespace which do not begin with an underscore character (‘_’). __all__ should contain the entire public API. It is intended to avoid accidentally exporting items that are not part of the API (such as library modules which were imported and used within the module).<

(You can also see my recent post about the module topic).

Bye,
bearophile



More information about the Digitalmars-d mailing list