Commit c054d0d2 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge pull request #270 from ohanar/special_method_docstring_guard

Special method docstring guard
parents c66eca29 521ed9d8
......@@ -2538,6 +2538,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
'__releasebuffer__')
if (func.is_special and Options.docstrings and
func.wrapperbase_cname and not is_buffer):
slot = TypeSlots.method_name_to_slot[func.name]
preprocessor_guard = slot.preprocessor_guard_code()
if preprocessor_guard:
code.putln(preprocessor_guard)
code.putln('#if CYTHON_COMPILING_IN_CPYTHON')
code.putln("{")
code.putln(
......@@ -2558,6 +2562,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("}")
code.putln("}")
code.putln('#endif')
if preprocessor_guard:
code.putln('#endif')
if type.vtable_cname:
code.putln(
"if (__Pyx_SetVtable(%s.tp_dict, %s) < 0) %s" % (
......
......@@ -21,7 +21,7 @@ cdef class C:
def __set__(self, x):
"And here is another one."
def __add__(self, other):
def __div__(self, other):
"usable docstring"
def __iter__(self):
"usable docstring"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment