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

Code before:
    """

    animation_overrides = {}

    @classmethod
    def __init_subclass__(cls, **kwargs):
        super().__init_subclass__(**kwargs)

        cls.animation_overrides: Dict[
            Type["Animation"],
            Callable[["Mobject"], "Animation"],
        ] = {}
        cls._add_intrinsic_animation_overrides()
        cls._original__init__ = cls.__init__

    def __init__(self, color=WHITE, name=None, dim=3, target=None, z_index=0):
        self.color = Color(color) if color else None
        self.name = self.__class__.__name__ if name is None else name
        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()

    @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

Review comment (suggestion):
NIT: odd spacing
```suggestion
        self.color = Color(color) if color else None
```

Code after:
    """

    animation_overrides = {}

    @classmethod
    def __init_subclass__(cls, **kwargs):
        super().__init_subclass__(**kwargs)

        cls.animation_overrides: Dict[
            Type["Animation"],
            Callable[["Mobject"], "Animation"],
        ] = {}
        cls._add_intrinsic_animation_overrides()
        cls._original__init__ = cls.__init__

    def __init__(self, color=WHITE, name=None, dim=3, target=None, z_index=0):
        self.name = self.__class__.__name__ if name is None else name
        self.dim = dim
        self.target = target
        self.z_index = z_index
        self.point_hash = None
        self.submobjects = []
        self.updaters = []
        self.updating_suspended = False
        self.color = Color(color) if color else None

        self.reset_points()
        self.generate_points()
        self.init_colors()

    @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]