Missing OmPyUnit module in OmPyUnit

David Goodger dgoodger at bigfoot.com
Sat Jul 1 11:34:30 EDT 2000


on 2000-07-01 07:06, Doug Fort (dougfort at downright.com) wrote:
> However, the package I downloaded seems to be missing a module:   OmPyUnit.
> What's up with this?  It doesn't fill me with confidence.

OmPyUnit seems like it's meant to be a Python package, but it lacks an
__init__.py file. This causes package imports to fail in my interpreter
(1.5.2 on MacOS). According to Guido's essay "Built-in Package Support in
Python 1.5" at http://www.python.org/doc/essays/packages.html , "package
support *requires* that an __init__ module is present". Looks like an
oversight.

Simply creating an empty __init__.py file (module) in the OmPyUnit
directory, and making sure that the OmPyUnit directory is on Python's import
path, makes explicit imports work. ("from OmPyUnit import *" won't work
unless you define __all__ in __init__.py, though. But we don't use the "from
... import *" form, do we?)

-- 
David Goodger    dgoodger at bigfoot.com    Open-source projects:
 - The Go Tools Project: http://gotools.sourceforge.net
 (more to come!)




More information about the Python-list mailing list