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:
@@ -66,12 +66,12 @@ def region_2d_to_origin_3d(region, rv3d, coord, *, clamp=None):
|
||||
:type region: :class:`bpy.types.Region`
|
||||
:arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
||||
:type rv3d: :class:`bpy.types.RegionView3D`
|
||||
:arg coord: 2d coordinates relative to the region;
|
||||
:arg coord: 2D coordinates relative to the region;
|
||||
(event.mouse_region_x, event.mouse_region_y) for example.
|
||||
:type coord: 2d vector
|
||||
:type coord: Sequence[float]
|
||||
:arg clamp: Clamp the maximum far-clip value used.
|
||||
(negative value will move the offset away from the view_location)
|
||||
:type clamp: float or None
|
||||
:type clamp: float | None
|
||||
:return: The origin of the viewpoint in 3d space.
|
||||
:rtype: :class:`mathutils.Vector`
|
||||
"""
|
||||
@@ -164,7 +164,7 @@ def location_3d_to_region_2d(region, rv3d, coord, *, default=None):
|
||||
:arg default: Return this value if ``coord``
|
||||
is behind the origin of a perspective view.
|
||||
:return: 2d location
|
||||
:rtype: :class:`mathutils.Vector` or ``default`` argument.
|
||||
:rtype: :class:`mathutils.Vector` | Any
|
||||
"""
|
||||
from mathutils import Vector
|
||||
|
||||
|
||||
Reference in New Issue
Block a user