[Python-Dev] shal we redefine "module" and "package"?

Ben Finney bignose+hates-spam at benfinney.id.au
Thu May 1 04:37:58 CEST 2008


zooko <zooko at zooko.com> writes:

> I'm willing to bet that you will get the following answers:
> 
> A1.  foo [from 'import foo'] is a module.
> 
> A2.  bar [of 'bar-1.2.3.tar.gz'] is a package.
> 
> A3.  A distribution is a version of Linux that comes with a lot of
> Free Software.
> 
> 
> Unfortunately these answers aren't quite right.

More accurately, they're right in the context from which the speaker
learned them.

> A "package" is actually a directory containing an __init__.py file,
> and a distribution is actually what you think of when you say
> "package" -- a reusable package of Python code that you can, for
> example, get from the Python package index.

Only within Python's terminology. This, of course, conflicts with the
meanings that adhere to those words just about everywhere else on the
user's operating system.

> Educational efforts such as the Python tutorial and the distutils
> docs have not succeeded in training Python programmers to understand
> the terminology for these things as used by the Python implementors,

More accurately, the meanings you list in the hypothetical responses
above are entrenched and more useful for general use.

> so perhaps instead the implementors should start using the
> terminology understood by the programmers:

In principle this would be good. However:

> 1.  A "module" shall henceforth be the name for either a foo.py file
> (a single-file module), or a directory with an __init__.py in it (a
> directory module).

How then to distinguish between these? They're clearly separate
concepts, and I think they need distinct terms.

> 2.  A "package" shall henceforth be the name of the thing that is
> currently [in Python terminology] called a "distribution".

That one would be good.

You then have the converse problem of changing the use of terminology
that is currently entrenched in existing Python documentation and
minds :-)

-- 
 \        "Always code as if the guy who ends up maintaining your code |
  `\     will be a violent psychopath who knows where you live." —John |
_o__)                                                         F. Woods |
Ben Finney



More information about the Python-Dev mailing list