Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
c054d0d2
Commit
c054d0d2
authored
Jan 08, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #270 from ohanar/special_method_docstring_guard
Special method docstring guard
parents
c66eca29
521ed9d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-0
tests/compile/specmethdocstring.pyx
tests/compile/specmethdocstring.pyx
+1
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
c054d0d2
...
...
@@ -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"
%
(
...
...
tests/compile/specmethdocstring.pyx
View file @
c054d0d2
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment