Merge pull request #659 from jdegenstein/context-aware-shapes

context aware shapes: fix to generic typevar to pass-through return types of those affected by functools.wraps correctly
This commit is contained in:
jdegenstein 2024-07-17 13:01:43 -05:00 committed by GitHub
commit 440841ec34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1283,11 +1283,12 @@ class WorkplaneList:
P = ParamSpec("P") P = ParamSpec("P")
T2 = TypeVar("T2")
def __gen_context_component_getter( def __gen_context_component_getter(
func: Callable[Concatenate[Builder, P], T] func: Callable[Concatenate[Builder, P], T2]
) -> Callable[P, T]: ) -> Callable[P, T2]:
@functools.wraps(func) @functools.wraps(func)
def getter(select: Select = Select.ALL): def getter(select: Select = Select.ALL):
context = Builder._get_context(func.__name__) context = Builder._get_context(func.__name__)