namespace in Python?

Heiko Wundram modelnine at
Mon Dec 12 14:46:35 EST 2005

Carl wrote:
> What is the equivalent of a C++ (or C#) namespace in Python?

Your best bet will be modules:


def test():
    print "I am test() from"

import a



They are no direct match to C++-namespaces though, as the namespace doesn't
show up in the source but rather relies on the naming of the source

--- Heiko.

More information about the Python-list mailing list