Type hinting google docstring Attributes

Answered

 Docstring Google/NumPy format allow define class attributes with keyword "Attributes". But pycharm type hinting ignore it. 

Class attributes defined under keyword Parameters works fine, but its not correct.

 

class Foo(object):
"""Foo object

Parameters
----------
param1 : int
Description of arg1
param2 : str
Description of arg2

Attributes
----------
msg : dict
Description of msg
code : list
Description of code

"""
def __init__(self, param1, param2):
self.msg = None
self.code = None

class Bar(object): 
"""Bar object

Parameters
----------
param1 : int
Description of arg1
param2 : str
Description of arg2
msg : dict
Description of msg
code : list
Description of code

"""
def __init__(self, param1, param2):
self.msg = None
self.code = None
0
1 comment

Hi Lipovsky 92! I believe this problem is covered by PY-16760 and PY-22464.

0

Please sign in to leave a comment.