[mod_python] empty docstrings

Graham Dumpleton graham.dumpleton at gmail.com
Tue May 15 20:14:18 EDT 2007


Do you have the directive:

  PythonOptimize On

set in your Apache configuration. If you do, then comment it out,
restart Apache and try again.

Graham

On 16/05/07, Martin Dobias <wonder.sk at gmail.com> wrote:
> Hi,
>
> I've been trying to get to run matplotlib with mod_python, but it
> fails when it gets imported. After some debugging I've found out that
> the problem is that parsing of docstrings in their classes fails. The
> reason is that the docstrings are empty instead of containing the
> actual text.
>
> Here's a simple script that demonstrates this behaviour - displays
> 'None' from MyClass.__doc__
>
> ======
> from mod_python import apache
>
> class MyClass:
>         """some documentation"""
>         pass
>
> def handler(req):
>         req.write("Docstring content: %s \n" % MyClass.__doc__)
>         return apache.OK
> ======
>
> Is there any way how to enforce inclusion of docstrings?
> Or am I missing something essential?
>
> Regards,
> Martin Dobias
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list