How can I document that a function returns a tuple
in such a way that PyCharm will be able to use it for type hinting?
Contrived example:
I contacted PyCharm support, and this is what they said:
For tuple please use
(
syntax., , , e t.c.) E.g.:
""" :rtype: (string, int, int) """
This is confirmed in PyCharm's documentation:
Type Syntax
Type syntax in Python docstrings is not defined by any standard. Thus, PyCharm suggests the following notation:
...
- (Foo, Bar) # Tuple of Foo and Bar