Get all capabilities of the specified type.
(self, capability: type[T])
| 81 | return len(self.get(capability)) > 0 |
| 82 | |
| 83 | def get(self, capability: type[T]) -> list[T]: |
| 84 | """Get all capabilities of the specified type.""" |
| 85 | matches: list[T] = [ |
| 86 | # NOTE: unfortunately pyright can't handle this |
| 87 | cap |
| 88 | for cap in self._capabilities |
| 89 | if type(cap) == capability # type: ignore |
| 90 | ] |
| 91 | return matches |
| 92 | |
| 93 | def get_capability_names(self, capability: type[T]) -> list[str]: |
| 94 | return [t.name for t in self.get(capability)] |
no outgoing calls