@@ -211,6 +211,7 @@ def encode_type(
211211 base_model : str ,
212212 in_module : list [ModuleName ],
213213) -> Tuple [TypeExpression , list [ModuleName ], list [FileContents ], set [TypeName ]]:
214+ encoder_name : Optional [str ] = None # defining this up here to placate mypy
214215 chunks : List [FileContents ] = []
215216 if isinstance (type , RiverNotType ):
216217 return (TypeName ("None" ), [], [], set ())
@@ -528,7 +529,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
528529 # For the encoder path, do we need "x" to be bound?
529530 # lambda x: ... vs lambda _: {}
530531 needs_binding = False
531- encoder_names : set [ TypeName ] = set ()
532+ encoder_names = set ()
532533 if type .properties :
533534 needs_binding = True
534535 typeddict_encoder .append ("{" )
@@ -537,7 +538,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
537538 type_name , _ , contents , _ = encode_type (
538539 prop , TypeName (prefix + name .title ()), base_model , in_module
539540 )
540- encoder_name : Optional [ str ] = None
541+ encoder_name = None
541542 chunks .extend (contents )
542543 if base_model == "TypedDict" :
543544 if isinstance (prop , RiverNotType ):
0 commit comments