nngogol / PySimpleGUIDocGen

Software for making documentation for PySimpleGUI
9 stars 2 forks source link

Where should "types" be indicated? #18

Closed MikeTheWatchGuy closed 5 years ago

MikeTheWatchGuy commented 5 years ago

I would like to sometimes put the types on things in both the parameter list as well as return types.

For return types, there is actually an rtype: docstring entry in addition to the returns: string.

For parameters, I'm looking online and it seems like they put it in () before the variable name.

Is this going to fuck up your software?

def RGB(red, green, blue):
    """
    Given integer values of Red, Green, Blue, return a color string "#RRGGBB"
    :param (int) red: int: Red portion from 0 to 255
    :param (int) green: int: Green portion from 0 to 255
    :param (int) blue: int: Blue portion from 0 to 255
    :return: A single RGB String in the format "#RRGGBB" where each pair is a hex number.
    :rtype (str)
    """
    return '#%02x%02x%02x' % (red, green, blue)

For now I'll remove the rtype parameter since it's not expected by your software. I'll instead put it in () after the :return: like this: ":return: (str) A single RGB String.....

nngogol commented 5 years ago

Don't: :param (int) green: int: Green portion from 0 to 255 Do: :param green: (int) Green portion from 0 to 255