Question on making names visible in packages

Sean Ross sross at
Sun Mar 14 22:32:31 CET 2004

"Kenneth McDonald" <kmmcdonald at> wrote in message
news:slrnc59er9.3hp.kmmcdonald at
> import Package
> and then to use the classes as
> Package.Class1, Package.Class2, etc.
> However, I'm only able to get this behavior when I leave the
> class definitions in the file. When in other files,
> they of course have to be referenced as :
> Package.filename.Class1
> Is there some way of making the names visible at the top level
> of the module, to mask the fact that they are split amongst
> different files within the package?

In your you can add :

from filename import Class1

to make the names visible at the top-level.


More information about the Python-list mailing list