@@ -2315,7 +2315,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
23152315 hints = {}
23162316 for base in reversed (obj .__mro__ ):
23172317 ann = annotationlib .get_annotations (base , format = format )
2318- if format is annotationlib .Format .STRING :
2318+ if format == annotationlib .Format .STRING :
23192319 hints .update (ann )
23202320 continue
23212321 if globalns is None :
@@ -2339,7 +2339,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
23392339 value = _eval_type (value , base_globals , base_locals , base .__type_params__ ,
23402340 format = format , owner = obj )
23412341 hints [name ] = value
2342- if include_extras or format is annotationlib .Format .STRING :
2342+ if include_extras or format == annotationlib .Format .STRING :
23432343 return hints
23442344 else :
23452345 return {k : _strip_annotations (t ) for k , t in hints .items ()}
@@ -2353,7 +2353,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
23532353 and not hasattr (obj , '__annotate__' )
23542354 ):
23552355 raise TypeError (f"{ obj !r} is not a module, class, or callable." )
2356- if format is annotationlib .Format .STRING :
2356+ if format == annotationlib .Format .STRING :
23572357 return hints
23582358
23592359 if globalns is None :
0 commit comments