Repository: ManimCommunity/manim
File: manim/mobject/probability.py (Python)

Code before:
                lg = [54, 23, 47, 48, 40, 64, 112, 87]
                versions = [
                    "v0.1.0",
                    "v0.1.1",
                    "v0.2.0",
                    "v0.3.0",
                    "v0.4.0",
                    "v0.5.0",
                    "v0.6.0",
                    "v0.7.0",
                ]
                colors = ["#003f5c", "#58508d", "#bc5090", "#ff6361", "#ffa600"]
                bar = BarChart(
                    lg,
                    max_value=max(lg),
                    bar_colors=colors,
                    bar_names=versions,
                    bar_label_scale_val=0.3,
                )
                self.add(bar)
    """

    def __init__(
        self,
        values: Iterable[float],
        height: int = 4,
        width: int = 6,
        n_ticks: int = 4,
        tick_width: float = 0.2,
        label_y_axis: bool = True,
        y_axis_label_height: float = 0.25,
        max_value: float = 1,
        bar_colors: List[Color] = [BLUE, YELLOW],
        bar_fill_opacity: float = 0.8,
        bar_stroke_width: float = 3,
        bar_names: List[str] = [],
        bar_label_scale_val: float = 0.75,
        **kwargs
    ):  # What's the return type?
        VGroup.__init__(self, **kwargs)
        self.n_ticks = n_ticks
        self.tick_width = tick_width
        self.label_y_axis = label_y_axis
        self.y_axis_label_height = y_axis_label_height
        self.max_value = max_value
        self.bar_colors = bar_colors
        self.bar_fill_opacity = bar_fill_opacity
        self.bar_stroke_width = bar_stroke_width
        self.bar_names = bar_names
        self.bar_label_scale_val = bar_label_scale_val


Review comment (bug):
Please be careful with adding type hints. Are you sure that height can only be int and not e.g. float?
My friendly advice (only meant in the best way, not meant as an accusation): Please only add type hints when you are 100% sure that any other option would not be possible.
Also, I remember there were some really complicated functions in `space_ops` that got type hints, where I was not sure if they were right. As tyephints is not the easiest programming topic, I would also suggest that we revert some not 100% save changes in `space_ops`, because it is deftly better to have no typehints then wrong typehints.

Code after:
        Maximum value of the data.
    bar_colors
        The colors of the bars.
    bar_fill_opacity
        The opacity of the bars.
    bar_stroke_width
        The stroke width of the bars.
    bar_names
        The names of each bar.
    bar_label_scale_val
        The label size.

    Examples
    --------
    .. manim:: BarChartExample
        :save_last_frame:

        class BarChartExample(Scene):
            def construct(self):
                pull_req = [54, 23, 47, 48, 40, 64, 112, 87]
                versions = [
                    "v0.1.0",
                    "v0.1.1",
                    "v0.2.0",
                    "v0.3.0",
                    "v0.4.0",
                    "v0.5.0",
                    "v0.6.0",
                    "v0.7.0",
                ]
                colors = ["#003f5c", "#58508d", "#bc5090", "#ff6361", "#ffa600"]
                bar = BarChart(
                    pull_req,
                    max_value=max(pull_req),
                    bar_colors=colors,
                    bar_names=versions,
                    bar_label_scale_val=0.3,
                )
                self.add(bar)
    """

    def __init__(
        self,
        values: Iterable[float],
        height: float = 4,
        width: float = 6,
        n_ticks: int = 4,
        tick_width: float = 0.2,
        label_y_axis: bool = True,
        y_axis_label_height: float = 0.25,
        max_value: float = 1,