Skip to content

Commit

Permalink
build_common.py -> fix to generic typespec to pass-through return typ…
Browse files Browse the repository at this point in the history
…es of functools.wraps correctly
  • Loading branch information
jdegenstein authored Jul 17, 2024
1 parent cb6cbc3 commit 3ea67e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/build123d/build_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,11 +1283,12 @@ def localize(cls, *points: VectorLike) -> Union[list[Vector], Vector]:


P = ParamSpec("P")
T2 = TypeSpec("T2")


def __gen_context_component_getter(
func: Callable[Concatenate[Builder, P], T]
) -> Callable[P, T]:
func: Callable[Concatenate[Builder, P], T2]
) -> Callable[P, T2]:
@functools.wraps(func)
def getter(select: Select = Select.ALL):
context = Builder._get_context(func.__name__)
Expand Down

0 comments on commit 3ea67e2

Please sign in to comment.