Package organization

F. Petitjean littlejohn.75 at
Wed Jun 22 21:18:07 CEST 2005

Le Wed, 22 Jun 2005 20:42:24 +0200, Thomas Lotze a écrit :
> Hi,
> I've two questions concerning organizing and naming things when writing
> a Python package.
>   Assume I have a package called PDF. Should the classes then be called
>   simply File and Objects, as it is clear what they do as they are
>   imported from PDF? Or should they be called PDFFile and PDFObjects, as
>   the names would be too undescriptive otherwise?

As you whish :-)
if in the package ie in the (not the best idea)
from PDF import File as PDFFile  # always possible

if File is defined in a module Objects
from PDF.Objects import File  # as PDFFile is always possible.

Have you installed the reportlab package ? It is full of from ... import
..  and it generates PDF.

More information about the Python-list mailing list