[mod_python] empty docstrings

Martin Dobias wonder.sk at gmail.com
Tue May 15 20:04:36 EDT 2007


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


More information about the Mod_python mailing list