Repository: Textualize/textual
File: src/textual/widgets/_progress_bar.py (Python)

Code before:
    """The total number of steps associated with this progress bar, when known.

    The value `None` will render an indeterminate progress bar.
    """
    percentage: reactive[float | None] = reactive[Optional[float]](None)
    """The percentage of progress that has been completed.

    The percentage is a value between 0 and 1 and the returned value is only
    `None` if the total progress of the bar hasn't been set yet.

    Example:
        ```py
        progress_bar = ProgressBar()
        print(progress_bar.percentage)  # None
        progress_bar.update(total=100)
        progress_bar.advance(50)
        print(progress_bar.percentage)  # 0.5
        ```
    """
    _display_eta: reactive[int | None] = reactive[Optional[int]](None)

    gradient: reactive[Gradient | None] = reactive(None)
    """Optional gradient object (will replace CSS styling in bar)."""

    BAR_RENDERABLE: BarRenderable = BarRenderable
    """Optional BarRenderable class for custom ProgressBar icons."""

    def __init__(
        self,
        total: float | None = None,
        *,
        show_bar: bool = True,
        show_percentage: bool = True,
        show_eta: bool = True,
        name: str | None = None,
        id: str | None = None,
        classes: str | None = None,
        disabled: bool = False,
        clock: Clock | None = None,
        gradient: Gradient | None = None,
    ):
        """Create a Progress Bar widget.

        The progress bar uses "steps" as the measurement unit.

        Example:
            ```py
            class MyApp(App):
                def compose(self):
                    yield ProgressBar(total=100)


Review comment (suggestion):
Maybe change the docstring to something like:
```py
"""BarRenderable to use for rendering the bar-part of the ProgressBar"""
```
since it is not optional, it just has a default, and I'm not sure if 'icons' conveys the meaning.

Code after:
    """The total number of steps associated with this progress bar, when known.

    The value `None` will render an indeterminate progress bar.
    """
    percentage: reactive[float | None] = reactive[Optional[float]](None)
    """The percentage of progress that has been completed.

    The percentage is a value between 0 and 1 and the returned value is only
    `None` if the total progress of the bar hasn't been set yet.

    Example:
        ```py
        progress_bar = ProgressBar()
        print(progress_bar.percentage)  # None
        progress_bar.update(total=100)
        progress_bar.advance(50)
        print(progress_bar.percentage)  # 0.5
        ```
    """
    _display_eta: reactive[int | None] = reactive[Optional[int]](None)

    gradient: reactive[Gradient | None] = reactive(None)
    """Optional gradient object (will replace CSS styling in bar)."""

    BAR_RENDERABLE: Type[BarRenderable] = BarRenderable
    """BarRenderable to use for rendering the bar-part of the ProgressBar"""

    def __init__(
        self,
        total: float | None = None,
        *,
        show_bar: bool = True,
        show_percentage: bool = True,
        show_eta: bool = True,
        name: str | None = None,
        id: str | None = None,
        classes: str | None = None,
        disabled: bool = False,
        clock: Clock | None = None,
        gradient: Gradient | None = None,
    ):
        """Create a Progress Bar widget.

        The progress bar uses "steps" as the measurement unit.

        Example:
            ```py
            class MyApp(App):
                def compose(self):
                    yield ProgressBar(total=100)