@@ -231,11 +231,14 @@ def instantiate(__path: str, __mode: str, **kwargs: Any) -> Any:
231231
232232 Args:
233233 __path: if a string is provided, it's interpreted as the full path of the target class or function component.
234- If a callable is provided, ``__path(**kwargs)`` or ``functools.partial(__path, **kwargs)`` will be returned.
234+ If a callable is provided, ``__path(**kwargs)`` will be invoked and returned for ``__mode="default"``.
235+ For ``__mode="callable"``, the callable will be returned as ``__path`` or, if ``kwargs`` are provided,
236+ as ``functools.partial(__path, **kwargs)`` for future invoking.
237+
235238 __mode: the operating mode for invoking the (callable) ``component`` represented by ``__path``:
236239
237240 - ``"default"``: returns ``component(**kwargs)``
238- - ``"partial "``: returns ``functools.partial( component, **kwargs) `` if ``kwargs`` is not empty, otherwise returns `` component``
241+ - ``"callable "``: returns ``component`` or, if ``kwargs`` are provided, ``functools.partial( component, **kwargs)``.
239242 - ``"debug"``: returns ``pdb.runcall(component, **kwargs)``
240243
241244 kwargs: keyword arguments to the callable represented by ``__path``.
@@ -259,7 +262,7 @@ def instantiate(__path: str, __mode: str, **kwargs: Any) -> Any:
259262 return component
260263 if m == CompInitMode .DEFAULT :
261264 return component (** kwargs )
262- if m == CompInitMode .PARTIAL :
265+ if m == CompInitMode .CALLABLE :
263266 return partial (component , ** kwargs ) if kwargs else component
264267 if m == CompInitMode .DEBUG :
265268 warnings .warn (
0 commit comments