mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
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:
commit
440841ec34
1 changed files with 3 additions and 2 deletions
|
|
@ -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__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue