Docstrings for classes get "doubled"
Bug #215052 reported by
Hans Terlouw
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cython |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
Docstrings for classes get "doubled". For example, the docstring in the following Cython code:
class dummy(object):
"Dummy class documentation"
pass
will appear "doubled" in the generated C code:
static char __pyx_k_2[] = "Dummy class documentation\
(Docstrings for functions and methods are not affected.)
Changed in cython: | |
importance: | Undecided → Medium |
status: | New → Fix Committed |
To post a comment you must log in.
The code in Nodes.py goes like this:
class PyClassDefNode( StatNode, BlockNode): embed_pos_ in_docstring: position( self.pos)
doc_ node = ExprNodes. StringNode( pos, value = doc)
doc_ node = None
def __init__(self, pos, name, bases, doc, body):
# ...
self.doc = doc
# ...
if self.doc and Options.docstrings:
if Options.
doc = 'File: %s (starting at line %s)'%relative_
doc = doc + '\\n' + self.doc
else:
I have no idea what the
doc = doc + '\\n' + self.doc
bit is supposed to mean. It looks like it's there for a purpose...