A Pyrex user recently pointed out to me that trying to give a docstring to an __xxx__ method of an extension type doesn't work. The reason for this is that the C functions implementing these methods live in slots of the typeobject, and there's apparently nowhere to put docstrings for them. I'm speculating that this could be worked around by getting the slot's wrapper object out of the type dict after the type is initialised, and stuffing a docstring into it. This would only work if a new set of wrappers is created for each type, rather than re-using generic ones. An experiment suggests that this is what happens -- can anyone confirm this? Or, is there a better way of giving these things docstrings that I've missed? Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4