You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ivar is for instance attributes and cvar is for class attributes, so:
fromtypingimportClassVarclassA:
"""My class :ivar n: Number of items. :cvar threshold: Threshold for items. """n: intthreshold: ClassVar[int] =3def__init__(self) ->None:
self.n=2
If you wanted to specify a type you could do it with vartype.
The main advantage over the .. attribute:: syntax is that it's more compact, which is why I prefer it.
The text was updated successfully, but these errors were encountered:
Secondly, use the new version of the docstring parser in pydoclint
The first part is more time consuming. I can get to it in the next few weeks (or longer, depending on my availability). But if you'd like to take a stab at it, I'd really appreciate it! (I opened an issue there: jsh9/docstring_parser_fork#9)
These are little-known fields, but they are documented here: https://www.sphinx-doc.org/en/master/usage/domains/python.html#info-field-lists
ivar
is for instance attributes andcvar
is for class attributes, so:If you wanted to specify a type you could do it with
vartype
.The main advantage over the
.. attribute::
syntax is that it's more compact, which is why I prefer it.The text was updated successfully, but these errors were encountered: