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

Code before:
        fill_opacity: float = 0.0,
        stroke_color: Color | None = None,
        stroke_opacity: float = 1.0,
        stroke_width: float = DEFAULT_STROKE_WIDTH,
        draw_stroke_behind_fill: bool = False,
        # Indicates that it will not be displayed, but
        # that it should count in parent mobject's path
        pre_function_handle_to_anchor_scale_factor: float = 0.01,
        make_smooth_after_applying_functions: float = False,
        background_image_file: str | None = None,
        # This is within a pixel
        # TODO, do we care about accounting for
        # varying zoom levels?
        tolerance_for_point_equality: float = 1e-8,
        n_points_per_curve: int = 3,
        long_lines: bool = False,
        should_subdivide_sharp_curves: bool = False,
        should_remove_null_curves: bool = False,
        # Could also be "bevel", "miter", "round"
        joint_type: LineJointType | None = None,
        flat_stroke: bool = True,
        render_primitive=moderngl.TRIANGLES,
        triangulation_locked: bool = False,
        **kwargs,
    ):
        self._is_initialized: bool = False
        self.data = {}
        self.fill_opacity = fill_opacity
        self.stroke_opacity = stroke_opacity
        self.stroke_width = stroke_width
        self.draw_stroke_behind_fill = draw_stroke_behind_fill
        # Indicates that it will not be displayed, but
        # that it should count in parent mobject's path
        self.pre_function_handle_to_anchor_scale_factor = (
            pre_function_handle_to_anchor_scale_factor
        )
        self.make_smooth_after_applying_functions = make_smooth_after_applying_functions
        self.background_image_file = background_image_file
        # This is within a pixel
        # TODO, do we care about accounting for
        # varying zoom levels?
        self.tolerance_for_point_equality = tolerance_for_point_equality
        self.n_points_per_curve = n_points_per_curve
        self.long_lines = long_lines
        self.should_subdivide_sharp_curves = should_subdivide_sharp_curves
        self.should_remove_null_curves = should_remove_null_curves
        if joint_type is None:
            joint_type = LineJointType.AUTO
        self.joint_type = joint_type
        self.flat_stroke = flat_stroke
        self.render_primitive = render_primitive

Review comment (suggestion):
Perhaps this should be replaced with a computed property, something like

```
@property
def _is_initialized(self):
    return hasattr('something_set_by_init_shader_data', self) and ...
```

But probably this doesn't really make that much of a difference; just wanted to avoid introducing some sort of inconsistency regarding the `_is_initialized` attribute.

Code after:
        fill_opacity: float = 0.0,
        stroke_color: Color | None = None,
        stroke_opacity: float = 1.0,
        stroke_width: float = DEFAULT_STROKE_WIDTH,
        draw_stroke_behind_fill: bool = False,
        # Indicates that it will not be displayed, but
        # that it should count in parent mobject's path
        pre_function_handle_to_anchor_scale_factor: float = 0.01,
        make_smooth_after_applying_functions: float = False,
        background_image_file: str | None = None,
        # This is within a pixel
        # TODO, do we care about accounting for
        # varying zoom levels?
        tolerance_for_point_equality: float = 1e-8,
        n_points_per_curve: int = 3,
        long_lines: bool = False,
        should_subdivide_sharp_curves: bool = False,
        should_remove_null_curves: bool = False,
        # Could also be "bevel", "miter", "round"
        joint_type: LineJointType | None = None,
        flat_stroke: bool = True,
        render_primitive=moderngl.TRIANGLES,
        triangulation_locked: bool = False,
        **kwargs,
    ):
        self.data = {}
        self.fill_opacity = fill_opacity
        self.stroke_opacity = stroke_opacity
        self.stroke_width = stroke_width
        self.draw_stroke_behind_fill = draw_stroke_behind_fill
        # Indicates that it will not be displayed, but
        # that it should count in parent mobject's path
        self.pre_function_handle_to_anchor_scale_factor = (
            pre_function_handle_to_anchor_scale_factor
        )
        self.make_smooth_after_applying_functions = make_smooth_after_applying_functions
        self.background_image_file = background_image_file
        # This is within a pixel
        # TODO, do we care about accounting for
        # varying zoom levels?
        self.tolerance_for_point_equality = tolerance_for_point_equality
        self.n_points_per_curve = n_points_per_curve
        self.long_lines = long_lines
        self.should_subdivide_sharp_curves = should_subdivide_sharp_curves
        self.should_remove_null_curves = should_remove_null_curves
        if joint_type is None:
            joint_type = LineJointType.AUTO
        self.joint_type = joint_type
        self.flat_stroke = flat_stroke
        self.render_primitive = render_primitive
        self.triangulation_locked = triangulation_locked