I’m trying to add a linter to a repo that would enforce docstring documentation of arguments and return values for functions and methods, as described in the Google Python Style Guide. In general, I want to enforce the following docstring content: def blah(n: int) -> int: """ Args: n: a number Returns: The number plus ..
I’ve been reading through this guide to writing Google-style and Numpy-style docstrings with type hints for numpy ndarrays. In the Numpy-style docstring example, type hints are abbreviated as "np.ndarray". However, in the corresponding Google-style example, the type is written as "numpy.ndarray". Is it possible to use "np.ndarray" as a type in a Google-style docstring, or ..
I’m trying to follow the Google Style of docstrings, but I’m not sure how to document a function (and the class itself) when there’s functions that add/supdates an attribute. Currently I have something like this: class myclass(): """This is an example class Attributes: (Should I have this here?) att1 (float): Attribute 1 att2 (float): Attribute ..
I am trying to format my Python code according to the style guide followed at my company. I was sent an .XML file by a fellow developer to help format my code according to that. But I’ve no idea how to use the XML file to format my code. The file looks something like: <?xml ..
Google style guide requires to import modules. Say I have a non trivial class and several non-trivial derived classes. It seems that I have to put them all in the one file otherwise will have to use different prefixes when using them. Personally I prefer one class per file. Is there a common idiom to ..