dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

Wrong Formatting for Input params with default values #69

Closed DKandrew closed 3 years ago

DKandrew commented 6 years ago

Here is the function header generated by pyment

def plot_outlier(inlier, outlier, outlier_rgb = [1, 0, 0]):
    """Plot the outlier of ...

    :param inlier: 
    :param outlier: 
    :param outlier_rgb:  (Default value = [1)
    :param 0: 
    :param 0]: 

    """

I give an default value of the outlier_rgb = [1,0,0]. But it seems like pyment did not recognize it and create two additional param for me.

dadadel commented 6 years ago

Indeed, although providing a list as parameter is not recommended in Python, the signature's parameters are extracted splitting on the coma.

It is also the case for a dict as parameter or even a string containing comas.

dadadel commented 3 years ago

This issue is fixed in PR #96