Use PEP484 type hints
PEP484 defines mechanism for type hints in Python. This is useful for IDEs, static code analysis and type-checkers like "mypy".
In modern Python, when you write code like this:
def foo(a: str) -> str:
return a
The resulting function object foo
will have foo.__annotations__
which is a dict that looks like this: {'a': str, 'return': str}
pygobject already puts this kind of data in docstrings, so putting it in __annotations__
shouldn't be too difficult.
Edited by Elad Alfassa