Closed vallsv closed 3 years ago
Hi! thanks for reporting. I think it is not related to __doc__
. Actually, if there's something before triple quotes that are just after the function signature, the problem arises.
Thus, following docstrings will fail:
def foo():
__doc__ = """\
Foo"""
def bar(param):
r"""this is a docstring
"""
def foobar():
u"""this is a docstring
"""
def no_docs():
something = '''bla bla bla'''
Producing the following patch:
# Patch generated by Pyment v0.3.3
--- a/issue90.py
+++ b/issue90.py
@@ -1,17 +1,17 @@
def foo():
- __doc__ = """\
- Foo"""
+ """__doc__ = """\
+ Foo
def bar(param):
- r"""this is a docstring
- """
+ """r"""this is a docstring
+
+ :param param:
def foobar():
- u"""this is a docstring
- """
+ """u"""this is a docstring"""
def no_docs():
- something = '''bla bla bla'''
+ """something = '''bla bla bla"""
@vallsv this is fixed in current master version. Can you check that your use case is addressed ?
Thx
Hi.
Here is a buggy transformation using
pygment test.py
v0.3.3It comes from a base code that i simplified to extract the problem. On the project the function is used as decorator to auto generate documentation.
Anyway the pygment result is not anymire valid.
Hope it can help.
Here is the patch result