Skip to content

Commit

Permalink
Fix: Data type '...' is misinterpreted
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Dec 31, 2024
1 parent 4c8d511 commit f987ede
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fake_bpy_module/transformer/data_type_refiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ def _get_refined_data_type_fast( # noqa: C901, PLR0911, PLR0912
if s:
return [make_data_type_node(f"`{s}`")]

if dtype_str == "...":
return [make_data_type_node("...")]

if dtype_str in ("type", "object", "function"):
return [make_data_type_node("typing.Any")]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
<class-ref>
ClassA
], None]
<data>
<name>
data_python_typing_syntax_6
<description>
<data-type-list>
<data-type>
Callable[[float, int], tuple[float, int]
<data>
<name>
data_parentheses_pair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@
,
None
]
<data>
<name>
data_python_typing_syntax_6
<description>
<data-type-list>
<data-type>
Callable[
[
float
,
int
]
,
tuple[
float
,
int
]
<data>
<name>
data_parentheses_pair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

:type: Callable[[int, :class:`ClassA`], None]

.. data:: data_python_typing_syntax_6

:type: Callable[[float, int], tuple[float, int]]

.. data:: data_parentheses_pair

:type: (:class:`ClassA`, :class:`module_2.ClassB`) pair
Expand Down

0 comments on commit f987ede

Please sign in to comment.