Method: rich.console.group
Calls: 4, Exceptions: 0, Paths: 1Back
Path 1: 4 calls (1.0)
True (3) False (1)
group.
1def group(fit: bool = True) -> Callable[..., Callable[..., Group]]:
2 """A decorator that turns an iterable of renderables in to a group.
3
4 Args:
5 fit (bool, optional): Fit dimension of group to contents, or fill available space. Defaults to True.
6 """
7
8 def decorator(
9 method: Callable[..., Iterable[RenderableType]]
10 ) -> Callable[..., Group]:
11 """Convert a method that returns an iterable of renderables in to a Group."""
12
13 @wraps(method)
14 def _replace(*args: Any, **kwargs: Any) -> Group:
15 renderables = method(*args, **kwargs)
16 return Group(*renderables, fit=fit)
17
18 return _replace
19
20 return decorator