Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type is removed from parameter if not in type hints when converting reST docstring #99

Closed
dadadel opened this issue Mar 9, 2021 · 0 comments

Comments

@dadadel
Copy link
Owner

dadadel commented Mar 9, 2021

If a type is provided in a reST dosctring for a parameter, it will be removed in the output docstring if not present in the type hint:

def func(param1):
    """Description

    :param param1:
    :type param1: str
    :returns: the return value

    """
    pass

Will produce:

# Patch generated by Pyment v0.4.0dev

--- a/t.py
+++ b/t.py
@@ -1,8 +1,7 @@
 def func(param1):
     """Description
 
-    :param param1:
-    :type param1: str
+    :param param1: 
     :returns: the return value
 
     """

However it works well when input docstring is google style:

def func(param1):
    """Description

    Args:
      param1(str):

    Returns:
      the return value

    """
    pass

Produces:

# Patch generated by Pyment v0.4.0dev

--- a/t2.py
+++ b/t2.py
@@ -1,11 +1,9 @@
 def func(param1):
     """Description
 
-    Args:
-      param1(str):
-
-    Returns:
-      the return value
+    :param param1: 
+    :type param1: str
+    :returns: the return value
 
     """
     pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant