Fix: PyDocs: Annotations for callables with variable number of arguments
Annotation `Callable[[Any, ...], str | None]` is not supported by Python typing system and ... will be misinterpreted as unknown type instead of option to provide variable number of arguments. Ref !138804
This commit is contained in:
committed by
Campbell Barton
parent
534044ccef
commit
f7ce58cefc
@@ -93,7 +93,10 @@ PyDoc_STRVAR(
|
||||
"additional user defined positional arguments are passed to the message function.\n"
|
||||
"\n"
|
||||
" :arg message: The message or a function that returns the message.\n"
|
||||
" :type message: str | Callable[[Any, ...], str | None]\n");
|
||||
" :type message: str | Callable[..., str | None]\n"
|
||||
" :arg args: A sequence of arguments to pass to ``message``, if it's a callable, "
|
||||
"otherwise argument is not available.\n"
|
||||
" :type args: Any\n");
|
||||
|
||||
static PyObject *BPY_rna_operator_poll_message_set(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
|
||||
@@ -155,9 +155,9 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg callback:\n"
|
||||
" A function that will be called when the cursor is drawn.\n"
|
||||
" It gets the specified arguments as input with the mouse position (tuple) as last "
|
||||
"argument.\n"
|
||||
" :type callback: Callable[[Any, ..., tuple[int, int]], Any]\n"
|
||||
" It gets the specified arguments as input with the mouse position "
|
||||
"(``tuple[int, int]``) as last argument.\n"
|
||||
" :type callback: Callable[..., Any]\n"
|
||||
" :arg args: Arguments that will be passed to the callback.\n"
|
||||
" :type args: tuple[Any, ...]\n"
|
||||
" :arg space_type: The space type the callback draws in; for example ``VIEW_3D``. "
|
||||
@@ -229,7 +229,7 @@ PyDoc_STRVAR(
|
||||
" :arg callback:\n"
|
||||
" A function that will be called when the region is drawn.\n"
|
||||
" It gets the specified arguments as input, it's return value is ignored.\n"
|
||||
" :type callback: Callable[[Any, ...], Any]\n"
|
||||
" :type callback: Callable[..., Any]\n"
|
||||
" :arg args: Arguments that will be passed to the callback.\n"
|
||||
" :type args: tuple[Any, ...]\n"
|
||||
" :arg region_type: The region type the callback draws in; usually ``WINDOW``. "
|
||||
|
||||
Reference in New Issue
Block a user