@@ -687,7 +687,7 @@ def deleted_as_rvalue(self, typ: DeletedType, context: Context) -> None:
687687 if typ .source is None :
688688 s = ""
689689 else :
690- s = " '{}'" .format (typ .source )
690+ s = ' "{}"' .format (typ .source )
691691 self .fail ('Trying to read deleted variable{}' .format (s ), context )
692692
693693 def deleted_as_lvalue (self , typ : DeletedType , context : Context ) -> None :
@@ -699,7 +699,7 @@ def deleted_as_lvalue(self, typ: DeletedType, context: Context) -> None:
699699 if typ .source is None :
700700 s = ""
701701 else :
702- s = " '{}'" .format (typ .source )
702+ s = ' "{}"' .format (typ .source )
703703 self .fail ('Assignment to variable{} outside except: block' .format (s ), context )
704704
705705 def no_variant_matches_arguments (self ,
@@ -1101,7 +1101,7 @@ def need_annotation_for_var(self, node: SymbolNode, context: Context,
11011101 else :
11021102 needed = 'comment'
11031103
1104- self .fail (" Need type {} for '{}'{}" .format (needed , unmangle (node .name ), hint ), context ,
1104+ self .fail (' Need type {} for "{}"{}' .format (needed , unmangle (node .name ), hint ), context ,
11051105 code = codes .VAR_ANNOTATED )
11061106
11071107 def explicit_any (self , ctx : Context ) -> None :
@@ -1160,10 +1160,12 @@ def typeddict_key_not_found(
11601160 self .fail ('\' {}\' is not a valid TypedDict key; expected one of {}' .format (
11611161 item_name , format_item_name_list (typ .items .keys ())), context )
11621162 else :
1163- self .fail ("TypedDict {} has no key '{}'" .format (format_type (typ ), item_name ), context )
1163+ self .fail ('TypedDict {} has no key "{}"' .format (
1164+ format_type (typ ), item_name ), context )
11641165 matches = best_matches (item_name , typ .items .keys ())
11651166 if matches :
1166- self .note ("Did you mean {}?" .format (pretty_seq (matches [:3 ], "or" )), context )
1167+ self .note ("Did you mean {}?" .format (
1168+ pretty_seq (matches [:3 ], "or" )), context )
11671169
11681170 def typeddict_context_ambiguous (
11691171 self ,
@@ -1179,10 +1181,10 @@ def typeddict_key_cannot_be_deleted(
11791181 item_name : str ,
11801182 context : Context ) -> None :
11811183 if typ .is_anonymous ():
1182- self .fail (" TypedDict key '{}' cannot be deleted" .format (item_name ),
1184+ self .fail (' TypedDict key "{}" cannot be deleted' .format (item_name ),
11831185 context )
11841186 else :
1185- self .fail (" Key '{}' of TypedDict {} cannot be deleted" .format (
1187+ self .fail (' Key "{}" of TypedDict {} cannot be deleted' .format (
11861188 item_name , format_type (typ )), context )
11871189
11881190 def typeddict_setdefault_arguments_inconsistent (
@@ -1235,8 +1237,8 @@ def typed_function_untyped_decorator(self, func_name: str, context: Context) ->
12351237
12361238 def bad_proto_variance (self , actual : int , tvar_name : str , expected : int ,
12371239 context : Context ) -> None :
1238- msg = capitalize (" {} type variable '{}' used in protocol where"
1239- " {} one is expected" .format (variance_string (actual ),
1240+ msg = capitalize (' {} type variable "{}" used in protocol where'
1241+ ' {} one is expected' .format (variance_string (actual ),
12401242 tvar_name ,
12411243 variance_string (expected )))
12421244 self .fail (msg , context )
@@ -1280,14 +1282,14 @@ def redundant_left_operand(self, op_name: str, context: Context) -> None:
12801282 it does not change the truth value of the entire condition as a whole.
12811283 'op_name' should either be the string "and" or the string "or".
12821284
802E
td> """
1283- self .redundant_expr (" Left operand of '{}'" .format (op_name ), op_name == 'and' , context )
1285+ self .redundant_expr (' Left operand of "{}"' .format (op_name ), op_name == 'and' , context )
12841286
12851287 def unreachable_right_operand (self , op_name : str , context : Context ) -> None :
12861288 """Indicates that the right operand of a boolean expression is redundant:
12871289 it does not change the truth value of the entire condition as a whole.
12881290 'op_name' should either be the string "and" or the string "or".
12891291 """
1290- self .fail (" Right operand of '{}' is never evaluated" .format (op_name ),
1292+ self .fail (' Right operand of "{}" is never evaluated' .format (op_name ),
12911293 context , code = codes .UNREACHABLE )
12921294
12931295 def redundant_condition_in_comprehension (self , truthiness : bool , context : Context ) -> None :
@@ -1352,7 +1354,7 @@ def report_protocol_problems(self,
13521354 missing = get_missing_protocol_members (subtype , supertype )
13531355 if (missing and len (missing ) < len (supertype .type .protocol_members ) and
13541356 len (missing ) <= MAX_ITEMS ):
1355- self .note ("'{}' is missing following '{}' protocol member{}:"
1357+ self .note ('"{}" is missing following "{}" protocol member{}:'
13561358 .format (subtype .type .name , supertype .type .name , plural_s (missing )),
13571359 context ,
13581360 code = code )
0 commit comments