diff --git a/manim/_config/utils.py b/manim/_config/utils.py index 46613e8d74..c70c1fb944 100644 --- a/manim/_config/utils.py +++ b/manim/_config/utils.py @@ -323,7 +323,7 @@ class MyScene(Scene): ... } def __init__(self) -> None: - self._d: dict[str, Any | None] = {k: None for k in self._OPTS} + self._d: dict[str, Any | None] = dict.fromkeys(self._OPTS) # behave like a dict def __iter__(self) -> Iterator[str]: diff --git a/manim/mobject/graph.py b/manim/mobject/graph.py index 72a26d27db..8afcf03012 100644 --- a/manim/mobject/graph.py +++ b/manim/mobject/graph.py @@ -826,7 +826,7 @@ def _create_vertices( labels = {v: labels for v in vertices} else: assert isinstance(labels, dict) - base_labels = {v: False for v in vertices} + base_labels = dict.fromkeys(vertices, False) base_labels.update(labels) labels = base_labels