MCPcopy Index your code
hub / github.com/pyinvoke/invoke / _add_object

Method _add_object

invoke/collection.py:116–124  ·  view source on GitHub ↗
(self, obj: Any, name: Optional[str] = None)

Source from the content-addressed store, hash-verified

114 self._add_object(obj, name)
115
116 def _add_object(self, obj: Any, name: Optional[str] = None) -> None:
117 method: Callable
118 if isinstance(obj, Task):
119 method = self.add_task
120 elif isinstance(obj, (Collection, ModuleType)):
121 method = self.add_collection
122 else:
123 raise TypeError("No idea how to insert {!r}!".format(type(obj)))
124 method(obj, name=name)
125
126 def __repr__(self) -> str:
127 task_names = list(self.tasks.keys())

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected