PyDoc: use Python's type annotation syntax for doc-strings

Replace plain-text type information with the type syntax used
for Python's type annotations as it's more concise, especially for
callbacks which often didn't include useful type information.

Note that this change only applies to inline doc-strings,
generated doc-strings from RNA need to be updated separately.

Details:

- Many minor corrections were made when "list" was incorrectly used
  instead of "sequence".
- Some type information wasn't defined in the doc-strings and has been
  added.
- Verbose type info would benefit from support for type aliases.
This commit is contained in:
Campbell Barton
2024-11-03 15:42:19 +11:00
parent 3347aa4017
commit 3bcfb151c1
90 changed files with 722 additions and 676 deletions

View File

@@ -150,11 +150,11 @@ PyDoc_STRVAR(
" :arg type: Ramp blend type.\n"
" :type type: int\n"
" :arg color1: 1st color.\n"
" :type color1: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n"
" :type color1: :class:`mathutils.Vector` | tuple[float, float, float] | list[float]\n"
" :arg fac: Blend factor.\n"
" :type fac: float\n"
" :arg color2: 1st color.\n"
" :type color2: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n"
" :type color2: :class:`mathutils.Vector` | tuple[float, float, float] | list[float]\n"
" :return: Blended color in RGB format.\n"
" :rtype: :class:`mathutils.Vector`\n");