@@ -4502,24 +4502,27 @@ def __iter__(self: T) -> Iterator[Shape]:
4502
4502
def filter (self : T , f : Callable [[CQObject ], bool ]) -> T :
4503
4503
"""
4504
4504
Filter items using a boolean predicate.
4505
+
4505
4506
:param f: Callable to be used for filtering.
4506
4507
:return: Workplane object with filtered items.
4507
4508
"""
4508
4509
4509
4510
return self .newObject (filter (f , self .objects ))
4510
4511
4511
- def map (self : T , f : Callable [[CQObject ], CQObject ]):
4512
+ def map (self : T , f : Callable [[CQObject ], CQObject ]) -> T :
4512
4513
"""
4513
4514
Apply a callable to every item separately.
4515
+
4514
4516
:param f: Callable to be applied to every item separately.
4515
4517
:return: Workplane object with f applied to all items.
4516
4518
"""
4517
4519
4518
4520
return self .newObject (map (f , self .objects ))
4519
4521
4520
- def apply (self : T , f : Callable [[Iterable [CQObject ]], Iterable [CQObject ]]):
4522
+ def apply (self : T , f : Callable [[Iterable [CQObject ]], Iterable [CQObject ]]) -> T :
4521
4523
"""
4522
4524
Apply a callable to all items at once.
4525
+
4523
4526
:param f: Callable to be applied.
4524
4527
:return: Workplane object with f applied to all items.
4525
4528
"""
@@ -4529,6 +4532,7 @@ def apply(self: T, f: Callable[[Iterable[CQObject]], Iterable[CQObject]]):
4529
4532
def sort (self : T , key : Callable [[CQObject ], Any ]) -> T :
4530
4533
"""
4531
4534
Sort items using a callable.
4535
+
4532
4536
:param key: Callable to be used for sorting.
4533
4537
:return: Workplane object with items sorted.
4534
4538
"""
@@ -4537,11 +4541,12 @@ def sort(self: T, key: Callable[[CQObject], Any]) -> T:
4537
4541
4538
4542
def invoke (
4539
4543
self : T , f : Union [Callable [[T ], T ], Callable [[T ], None ], Callable [[], None ]]
4540
- ):
4544
+ ) -> T :
4541
4545
"""
4542
4546
Invoke a callable mapping Workplane to Workplane or None. Supports also
4543
4547
callables that take no arguments such as breakpoint. Returns self if callable
4544
4548
returns None.
4549
+
4545
4550
:param f: Callable to be invoked.
4546
4551
:return: Workplane object.
4547
4552
"""
0 commit comments