@@ -502,13 +502,13 @@ def __repr__(self: Graph) -> str:
502502 def _create_vertex (
503503 self ,
504504 vertex : Hashable ,
505- position : Optional [ np .ndarray ] = None ,
505+ position : np .ndarray | None = None ,
506506 label : bool = False ,
507507 label_fill_color : str = BLACK ,
508- vertex_type : Type [ " Mobject" ] = Dot ,
509- vertex_config : Optional [ dict ] = None ,
510- vertex_mobject : Optional [ dict ] = None ,
511- ) -> Tuple [Hashable , np .ndarray , dict , " Mobject" ]:
508+ vertex_type : type [ Mobject ] = Dot ,
509+ vertex_config : dict | None = None ,
510+ vertex_mobject : dict | None = None ,
511+ ) -> tuple [Hashable , np .ndarray , dict , Mobject ]:
512512 if position is None :
513513 position = self .get_center ()
514514
@@ -550,8 +550,8 @@ def _add_created_vertex(
550550 vertex : Hashable ,
551551 position : np .ndarray ,
552552 vertex_config : dict ,
553- vertex_mobject : " Mobject" ,
554- ) -> " Mobject" :
553+ vertex_mobject : Mobject ,
554+ ) -> Mobject :
555555 if vertex in self .vertices :
556556 raise ValueError (
557557 f"Vertex identifier '{ vertex } ' is already used for a vertex in this graph." ,
@@ -621,15 +621,15 @@ def _add_vertex(
621621 )
622622
623623 def _create_vertices (
624- self : " Graph" ,
624+ self : Graph ,
625625 * vertices : Hashable ,
626- positions : Optional [ dict ] = None ,
626+ positions : dict | None = None ,
627627 labels : bool = False ,
628628 label_fill_color : str = BLACK ,
629- vertex_type : Type [ " Mobject" ] = Dot ,
630- vertex_config : Optional [ dict ] = None ,
631- vertex_mobjects : Optional [ dict ] = None ,
632- ) -> Iterable [Tuple [Hashable , np .ndarray , dict , " Mobject" ]]:
629+ vertex_type : type [ Mobject ] = Dot ,
630+ vertex_config : dict | None = None ,
631+ vertex_mobjects : dict | None = None ,
632+ ) -> Iterable [tuple [Hashable , np .ndarray , dict , Mobject ]]:
633633 if positions is None :
634634 positions = {}
635635 if vertex_mobjects is None :
@@ -734,7 +734,7 @@ def _add_vertices_animation(self, *args, anim_args=None, **kwargs):
734734
735735 vertex_mobjects = self ._create_vertices (* args , ** kwargs )
736736
737- def on_finish (scene : " Scene" ):
737+ def on_finish (scene : Scene ):
738738 for v in vertex_mobjects :
739739 scene .remove (v [- 1 ])
740740 self ._add_created_vertex (* v )
0 commit comments