shal we redefine "module" and "package"?

Folks: Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions: Q1. You type "import foo" and it works. What kind of thing is foo? Q2. You go to the Python package index and download something named "bar-1.0.0.tar.gz". What kind of thing is bar? Q3. What is a "distribution"? I'm willing to bet that you will get the following answers: A1. foo is a module. A2. bar 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. 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. 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, so perhaps instead the implementors should start using the terminology understood by the programmers: 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). 2. A "package" shall henceforth be the name of the thing that is currently called a "distribution". Regards, Zooko who doesn't mind stirring up trouble on occasion...

On Wed, Apr 30, 2008 at 04:21:13PM -0600, zooko wrote:
so perhaps instead the implementors should start using the terminology understood by the programmers:
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).
2. A "package" shall henceforth be the name of the thing that is currently called a "distribution".
And while we are at it, I'd like to propose to rename the very language because everybody knows that python is a huge four-legged poisonous lizard. (Sorry for being so poisonously [pythonic?] sarcastic. Just cannot resist.) Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

zooko wrote:
Folks:
Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions:
Q1. You type "import foo" and it works. What kind of thing is foo?
Q2. You go to the Python package index and download something named "bar-1.0.0.tar.gz". What kind of thing is bar?
Q3. What is a "distribution"?
I'm willing to bet that you will get the following answers:
A1. foo is a module.
A2. bar 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. 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.
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, so perhaps instead the implementors should start using the terminology understood by the programmers:
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).
2. A "package" shall henceforth be the name of the thing that is currently called a "distribution".
-1
Zooko
who doesn't mind stirring up trouble on occasion...
regards Steve who doesn't mind trouble but would rather see communications improve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/

On 10:53 pm, steve@holdenweb.com wrote:
zooko wrote:
Unfortunately these answers aren't quite right. 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.
The fact that the Python "package" index is a place where you get "distributions" does seem a bit weird to me, but this is not necessarily a problem that can be fixed. Ambiguity is part of human language. Perhaps suggest transliterations of these terms for talking about python in lojban? :)
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).
I have a less disruptive counterproposal. How about just starting to refer to directories (or "folders", or zip entries) with '__init__.py' in them as "package modules"? A package is-a module anyway.
2. A "package" shall henceforth be the name of the thing that is currently called a "distribution".
I belive a multi-word term here would be similarly more memorable and precise. A "package distribution" would include the more familiar term while still being specific, consistent with the old terminology, and correct. Using a qualifying word is probably a good idea in this context anyway. I usually say "debian package", "RPM", "MSI", or "tarball" unless I'm specifically talking about "packages for your platform", almost always in the phrase, "please do not use distutils to do a system install of Twisted, use the specific package for your platform".
-1
I do, however, agree with Steve emphatically on your original proposal. Changing the terminology now will make billions upon billions of Python web pages, modules (c.f. twisted.python.modules.PythonModule.isPackage()) documents, and searchable message archives obsolete, not to mention that 90% of the community will probably ignore you and use the old terminology anyway, creating more confusion than it eliminates.

On Apr 30, 2008, at 5:11 PM, glyph@divmod.com wrote:
I have a less disruptive counterproposal. How about just starting to refer to directories (or "folders", or zip entries) with '__init__.py' in them as "package modules"? A package is-a module anyway.
That's a good idea.
I belive a multi-word term here would be similarly more memorable and precise. A "package distribution" would include the more familiar term while still being specific, consistent with the old terminology, and correct. Using a qualifying word is probably a good idea in this context anyway. I usually say "debian package", "RPM", "MSI", or "tarball" unless I'm specifically talking about "packages for your platform",
That's a good one too.
almost always in the phrase, "please do not use distutils to do a system install of Twisted, use the specific package for your platform".
This is a tangent, but why do you give that advice? I typically give people the opposite advice on how to install Twisted.
I do, however, agree with Steve emphatically on your original proposal. Changing the terminology now will make billions upon billions of Python web pages, modules (c.f. twisted.python.modules.PythonModule.isPackage()) documents, and searchable message archives obsolete, not to mention that 90% of the community will probably ignore you and use the old terminology anyway, creating more confusion than it eliminates.
I suspect 90% of the community already uses my proposed terminology -- that was my original challenge to round up a Python programmer and find out. But I agree that my proposal would contribute to confusion and disruption, and I like your counterproposals better, at least for now. Directories, folders, or zip entries with __init__.py in them are "package modules", and Python packages are "package distributions". Regards, Zooko

zooko wrote:
Folks:
Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions:
Q1. You type "import foo" and it works. What kind of thing is foo?
foo is a package or a module. Not enough information is provide here to say which.
Q2. You go to the Python package index and download something named "bar-1.0.0.tar.gz". What kind of thing is bar?
bar is a package, a module, or a collection of a number of these things. Again, not enough information is provided in the question to say which is actually the case. Cheers, Nick. P.S. People, including programmers, are often sloppy with terminology. This is not a new problem. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org

"zooko" <zooko@zooko.com> wrote in message news:50D35C20-ED3D-4A7D-965D-D5BBD76EDDC7@zooko.com... | Folks: | Unfortunately these answers aren't quite right. 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. If I go to a market, I may buy an individual food item (an apple, for instance), but most foods come in packages. The items and packages are them put in distribution carriers (bags) for transport home, where they are unbagged. A .tgz file is a bag, not a package. Since I am buying food, not bags, I would not want the store called a distribution/bag store. Indeed, other types of stores use the same or similar distribution carriers, just as .tgz is used for things others than Python modules and packages.

zooko <zooko@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
participants (7)
-
Ben Finney
-
glyph@divmod.com
-
Nick Coghlan
-
Oleg Broytmann
-
Steve Holden
-
Terry Reedy
-
zooko