Skip to content

Commit

Permalink
Merge pull request #659 from jdegenstein/context-aware-shapes
Browse files Browse the repository at this point in the history
context aware shapes: fix to generic typevar to pass-through return types of those affected by functools.wraps correctly
  • Loading branch information
jdegenstein authored Jul 17, 2024
2 parents cb6cbc3 + 15397be commit 440841e
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 = TypeVar("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 440841e

Please sign in to comment.