@@ -66,10 +66,7 @@ def MakeXyzs(v):
6666
6767# pytype: skip-file
6868from typing import Any
69- from typing import Dict
7069from typing import Iterable
71- from typing import List
72- from typing import Type
7370
7471from apache_beam .coders import coders
7572from apache_beam .typehints import typehints
@@ -81,8 +78,8 @@ def MakeXyzs(v):
8178class CoderRegistry (object ):
8279 """A coder registry for typehint/coder associations."""
8380 def __init__ (self , fallback_coder = None ):
84- self ._coders : Dict [Any , Type [coders .Coder ]] = {}
85- self .custom_types : List [Any ] = []
81+ self ._coders : dict [Any , type [coders .Coder ]] = {}
82+ self .custom_types : list [Any ] = []
8683 self .register_standard_coders (fallback_coder )
8784
8885 def register_standard_coders (self , fallback_coder ):
@@ -110,7 +107,7 @@ def register_fallback_coder(self, fallback_coder):
110107
111108 def _register_coder_internal (
112109 self , typehint_type : Any ,
113- typehint_coder_class : Type [coders .Coder ]) -> None :
110+ typehint_coder_class : type [coders .Coder ]) -> None :
114111 self ._coders [typehint_type ] = typehint_coder_class
115112
116113 @staticmethod
@@ -123,7 +120,7 @@ def _normalize_typehint_type(typehint_type):
123120
124121 def register_coder (
125122 self , typehint_type : Any ,
126- typehint_coder_class : Type [coders .Coder ]) -> None :
123+ typehint_coder_class : type [coders .Coder ]) -> None :
127124 """
128125 Register a user type with a coder.
129126
@@ -244,7 +241,7 @@ class FirstOf(object):
244241 """For internal use only; no backwards-compatibility guarantees.
245242
246243 A class used to get the first matching coder from a list of coders."""
247- def __init__ (self , coders : Iterable [Type [coders .Coder ]]) -> None :
244+ def __init__ (self , coders : Iterable [type [coders .Coder ]]) -> None :
248245 self ._coders = coders
249246
250247 def from_type_hint (self , typehint , registry ):
0 commit comments