Usual practice: running/testing modules in a package

med.swl at gmail.com med.swl at gmail.com
Fri Aug 22 09:48:50 EDT 2008


On 18 ago, 08:28, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> A package is a library, meant to be imported by some other code. Your main script (or the testing code) is a program, it uses (i.e. imports) the library.

You are right that a module is a library and its main use is to be
imported from another module or program. But is a common practice in
Python to introduce testing code as part as the module itself. Even
there is an option “-m” to do that.
So (in my humbled opinion), that is one error Python must fix.



More information about the Python-list mailing list