Thomas Heller writes: > Is the documentation wrong, or is the code wrong (I didn't find > any use of METH_CLASS in the CVS sources)? There's an example in sandbox/datetime/datetime.c; search for "datetime_now". > [I must say that I'm not really sure how this relates to the > calling convention flags. Have tried METH_O and METH_VARARGS > so far.] Guido van Rossum writes: > You have to call classmethod() from C; it's available as > &PyClassMethod_Type, you can call it with e.g. PyObject_Call. The > argument should be a function object that you created by calling > PyCFunction_New. Then stick it into your type's tp_dict (after > calling PyType_Ready()). I'll note that while this is a little tedious, it's easily packaged into a helper function. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
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