quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Brunson <brun...@brunson.com>
Subject Re: Updated documentation on apache.import_module()
Date Mon, 04 Dec 2006 00:53:38 GMT
Clodoaldo wrote:
> 2006/12/3, Graham Dumpleton <grahamd@dscpl.com.au>:
>>
>> Can you and anyone else who is interested, read through the
>> documentation
>> I have added and comment on whether it is adequate. Ie., is there
>> anything
>> that you can think is missing based on your own knowledge of the new
>> importer,
>> or anything that is particularly clear.
>>
>
> This paragraph is not clear for me:
>
> "In this scheme for maintaining a pseudo package, individual modules
> are still placed into a directory, but there cannot be a __init__.py
> file in the directory. If such a file does exist, it will simply be
> ignored."
>
> It says there cannot be a __init__.py  file in the directory and
> immediately after it says that if it exists it will be ignored. What
> will be ignored? The file or the pseudo package?
>
> Thinking about it the only way that the paragraph makes sense is if
> the package is ignored but for me it is confusing at first sight.
>

I believe he's saying the following:

Normally putting an __init__.py, even an empty one, will cause the
directory to act as a package and you can therefore of "import
<directory name>" or "from <directory name> import <something>". 
However using the mod_python path invalidates that package behavior, so
if you have a package that relies on code in __init__.py to be executed
on import, it won't work any more.

Please correct me if I'm wrong, but I think that's the behavior I'm seeing.


Mime
View raw message