@@ -2315,7 +2315,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
2315
2315
hints = {}
2316
2316
for base in reversed (obj .__mro__ ):
2317
2317
ann = annotationlib .get_annotations (base , format = format )
2318
- if format is annotationlib .Format .STRING :
2318
+ if format == annotationlib .Format .STRING :
2319
2319
hints .update (ann )
2320
2320
continue
2321
2321
if globalns is None :
@@ -2339,7 +2339,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False,
2339
2339
value = _eval_type (value , base_globals , base_locals , base .__type_params__ ,
2340
2340
format = format , owner = obj )
2341
2341
hints [name ] = value
2342
- if include_extras or format is annotationlib .Format .STRING :
2342
+ if include_extras or format == annotationlib .Format .STRING :
2343
2343
return hints
2344
2344
else :
2345
2345
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,
2353
2353
and not hasattr (obj , '__annotate__' )
2354
2354
):
2355
2355
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 :
2357
2357
return hints
2358
2358
2359
2359
if globalns is None :
0 commit comments