Skip to content

Commit

Permalink
Use typing_extensions.NotRequired to reduce boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Jul 29, 2024
1 parent 5e4afaf commit 501b16c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions manim/mobject/graphing/coordinate_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from typing import TYPE_CHECKING, Any, Callable, TypeVar, overload

import numpy as np
from typing_extensions import Self, TypedDict
from typing_extensions import NotRequired, Self, TypedDict

from manim import config
from manim.constants import *
Expand Down Expand Up @@ -72,7 +72,7 @@ class _MatmulConfig(TypedDict):
"""

method: str
unpack: bool
unpack: NotRequired[bool]


class CoordinateSystem:
Expand Down Expand Up @@ -3042,9 +3042,8 @@ def construct(self):

_matmul_config = {
"method": "polar_to_point",
"unpack": True,
}
_rmatmul_config = {"method": "point_to_polar", "unpack": False}
_rmatmul_config = {"method": "point_to_polar"}

def __init__(
self,
Expand Down Expand Up @@ -3418,7 +3417,7 @@ def construct(self):

_matmul_config = {"method": "number_to_point", "unpack": False}

_rmatmul_config = {"method": "point_to_number", "unpack": False}
_rmatmul_config = {"method": "point_to_number"}

def __init__(self, **kwargs: Any) -> None:
super().__init__(
Expand Down

0 comments on commit 501b16c

Please sign in to comment.