# unless we let PyType_Ready create the slot wrappers we have
# a significant performance hit. (See trac #561.)
for func in entry.type.scope.pyfunc_entries:
- if func.is_special and func.doc:
+ if func.is_special and func.wrapperbase_cname:
code.putln("{");
code.putln(
'PyObject *wrapper = PyObject_GetAttrString((PyObject *)&%s, "%s"); %s' % (
entry.doc_cname = \
Naming.funcdoc_prefix + prefix + name
if entry.is_special:
- entry.wrapperbase_cname = Naming.wrapperbase_prefix + prefix + name
+ if entry.name in TypeSlots.invisible or not entry.doc:
+ entry.wrapperbase_cname = None
+ else:
+ entry.wrapperbase_cname = Naming.wrapperbase_prefix + prefix + name
else:
entry.doc = None
if proto_only:
return
if (Options.docstrings and self.entry.doc and
- not self.entry.scope.is_property_scope):
+ not self.entry.scope.is_property_scope and
+ (not self.entry.is_special or self.entry.wrapperbase_cname)):
docstr = self.entry.doc
if docstr.is_unicode:
docstr = docstr.utf8encode()
import StringEncoding
import sys
+invisible = ['__cinit__', '__dealloc__', '__richcmp__',
+ '__nonzero__', '__bool__']
+
class Signature(object):
# Method slot signature descriptor.
#