python2.2 LESS docstring'able

Pete Shinners shredwheat at attbi.com
Fri Mar 29 12:37:23 EST 2002


I've got an extension object and a function to create the object.

MyObj()    # create new MyObj
MyObjType  # the type for MyObj

in pre-2.2 i can have a docstring for each of these. my question is now 
that i'm "combining" the type and the little constructor, what is the 
best way to merge the docstrings? i'd like my object to still have the 
docstring for that type. but i'd really like to be able to see the 
calling syntax for the constructor in docstrings as well?

so that's my little confusion. not the end of the world. i've just got 2 
nice docstrings here, and only a slot for one of them. does the 
PythonType structure need another slot? tp_new_doc? a docstring for the 
Type, and a docstring for instanced objects? hmm, well that still might 
not solve everything.

what's a humble extension writer to do? i suppose i could use a little 
#if magic and combine the docstrings when python 2.2 is being used. is 
that the only real solution?






More information about the Python-list mailing list