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

Method __getattr__

cadquery/assembly.py:825–836  ·  view source on GitHub ↗

. based access to children.

(self, name: str)

Source from the content-addressed store, hash-verified

823 return name in self.objects or name in self._subshape_names.inv
824
825 def __getattr__(self, name: str) -> Union["Assembly", Shape]:
826 """
827 . based access to children.
828 """
829
830 if name in self.objects:
831 return self.objects[name]
832 elif name in self._subshape_names.inv:
833 rv = self._subshape_names.inv[name]
834 return rv[0] if len(rv) == 1 else compound(rv)
835
836 raise AttributeError(f"{name} is not an attribute of {self}")
837
838 def __dir__(self):
839 """

Callers

nothing calls this directly

Calls 1

compoundFunction · 0.85

Tested by

no test coverage detected