MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / get_dummy_object

Function get_dummy_object

tests/auxil/dummy_objects.py:181–190  ·  view source on GitHub ↗
(obj_type: type | str, as_tuple: bool = False)

Source from the content-addressed store, hash-verified

179
180
181def get_dummy_object(obj_type: type | str, as_tuple: bool = False) -> object:
182 obj_type_name = obj_type.__name__ if isinstance(obj_type, type) else obj_type
183 if (return_value := _PREPARED_DUMMY_OBJECTS.get(obj_type_name)) is None:
184 raise ValueError(
185 f"Dummy object of type '{obj_type_name}' not found. Please add it manually."
186 )
187
188 if as_tuple:
189 return (return_value,)
190 return return_value
191
192
193_RETURN_TYPES: TypeAlias = bool | int | str | dict[str, object]

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…