[bindings] Fix overload order

This commit is contained in:
Frank Martinez
2025-10-07 12:04:08 -05:00
parent 2eedbce181
commit 1b0c0399e9
9 changed files with 50 additions and 47 deletions

View File

@@ -12,8 +12,8 @@ def export(**kwargs):
"""
...
def constmethod(): ...
def no_args(): ...
def constmethod(method): ...
def no_args(method): ...
def forward_declarations(source_code):
"""
A decorator to attach forward declarations to a class.

View File

@@ -120,6 +120,8 @@ class Placement(PyObjectBase):
def rotate(
self, center: Sequence[float], axis: Sequence[float], angle: float, *, comp: bool = False
) -> None: ...
@overload
def rotate(self, center: Vector, axis: Vector, angle: float, *, comp: bool = False) -> None:
"""
rotate(center, axis, angle, comp) -> None
@@ -138,6 +140,8 @@ class Placement(PyObjectBase):
optional keyword only argument, if True (default=False),
behave like TopoShape.rotate() (i.e. the resulting placements are interchangeable).
"""
def rotate(self, *args, **kwargs) -> None:
...
@constmethod

View File

@@ -54,6 +54,10 @@ class Quantity(PyObjectBase):
def __init__(self, string: str) -> None: ...
# fmt: on
@overload
def toStr(self, /) -> str: ...
@overload
def toStr(self, decimals: int, /) -> str: ...
@constmethod
def toStr(self, decimals: int = ..., /) -> str:
"""
@@ -64,10 +68,6 @@ class Quantity(PyObjectBase):
"""
...
@overload
def toStr(self, /) -> str: ...
@overload
def toStr(self, decimals: int, /) -> str: ...
@constmethod
def getUserPreferred(self) -> Tuple["Quantity", str]:
"""
@@ -97,6 +97,10 @@ class Quantity(PyObjectBase):
"""
...
@overload
def __round__(self, /) -> int: ...
@overload
def __round__(self, ndigits: int, /) -> float: ...
@constmethod
def __round__(self, ndigits: int = ..., /) -> Union[int, float]:
"""
@@ -105,7 +109,3 @@ class Quantity(PyObjectBase):
"""
...
@overload
def __round__(self, /) -> int: ...
@overload
def __round__(self, ndigits: int, /) -> float: ...

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from Metadata import export
from PyObjectBase import PyObjectBase
from Quantity import Quantity
from Unit import Unit
from typing import Final, Tuple, overload
@export(