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

Code before:
        self.point_hash = None
        self.submobjects = []
        self.updaters = []
        self.updating_suspended = False
        self.reset_points()
        self.generate_points()
        self.init_colors()

        # OpenGL data.
        self.data = {}
        self.depth_test = False
        self.is_fixed_in_frame = False
        self.gloss = 0.0
        self.shadow = 0.0
        self.needs_new_bounding_box = True
        self.parents = []
        self.family = [self]

        self.init_gl_data()
        self.init_gl_points()
        self.init_gl_colors()

        Container.__init__(self, **kwargs)

    @classmethod
    def get_animation_override(cls, animation_class):
        if animation_class in cls.animation_overrides:
            return cls.animation_overrides[animation_class]
        return None

    @classmethod
    def _add_intrinsic_animation_overrides(cls):
        for method_name in dir(cls):
            if method_name.startswith("__"):  # Preventing attribute errors
                continue
            method = getattr(cls, method_name)
            if hasattr(method, "_override_animation"):
                animation_class = method._override_animation
                cls.add_animation_override(animation_class, method)

    @classmethod
    def add_animation_override(cls, animation_class, override_func):
        print(cls.animation_overrides)
        if animation_class not in cls.animation_overrides:
            cls.animation_overrides[animation_class] = override_func
        else:
            raise MultiAnimationOverrideException(
                (
                    f"The animation {animation_class.__name__} for "
                    f"{cls.__name__} is overridden by more than one method: "
                    f"{cls.animation_overrides[animation_class].__qualname__} and "

Review comment (suggestion):
Nonblocking, but I'd prefer this to not start with `get_`, feels a tad unpythonic. `animation_override_for` would be something I'd prefer.

Code after:
        self.dim = dim
        self.target = target
        self.z_index = z_index
        self.point_hash = None
        self.submobjects = []
        self.updaters = []
        self.updating_suspended = False
        self.reset_points()
        self.generate_points()
        self.init_colors()

        # OpenGL data.
        self.data = {}
        self.depth_test = False
        self.is_fixed_in_frame = False
        self.gloss = 0.0
        self.shadow = 0.0
        self.needs_new_bounding_box = True
        self.parents = []
        self.family = [self]

        self.init_gl_data()
        self.init_gl_points()
        self.init_gl_colors()

        Container.__init__(self, **kwargs)

    @classmethod
    def animation_override_for(
        cls, animation_class: Type["Animation"]
    ) -> "Optional[Callable[[Mobject, ...], Animation]]":
        """Returns the function defining a specific animation override for this class.

        Parameters
        ----------
        animation_class
            The animation class for which the override function should be returned.

        Returns
        -------
        Optional[Callable[[Mobject, ...], Animation]]
            The function returning the override animation or ``None`` if no such animation
            override is defined.
        """
        if animation_class in cls.animation_overrides:
            return cls.animation_overrides[animation_class]

        return None

    @classmethod
    def _add_intrinsic_animation_overrides(cls):