MCPcopy
hub / github.com/CadQuery/cadquery / __getitem__

Method __getitem__

cadquery/sketch.py:1260–1271  ·  view source on GitHub ↗
(self: T, item: Union[int, Sequence[int], slice])

Source from the content-addressed store, hash-verified

1258 return self.__class__(obj=_to_compound(res))
1259
1260 def __getitem__(self: T, item: Union[int, Sequence[int], slice]) -> T:
1261
1262 vals = self.vals()
1263
1264 if isinstance(item, Iterable):
1265 self._selection = [vals[i] for i in item]
1266 elif isinstance(item, slice):
1267 self._selection = vals[item]
1268 else:
1269 self._selection = [vals[item]]
1270
1271 return self
1272
1273 def filter(self: T, f: Callable[[SketchVal], bool]) -> T:
1274 """

Callers

nothing calls this directly

Calls 1

valsMethod · 0.95

Tested by

no test coverage detected