@@ -675,8 +675,7 @@ def incompatible_argument(
675675 arg_type , callee .arg_types [n - 1 ], options = self .options
676676 )
677677 info = (
678- f" (expression has type { arg_type_str } , "
679- f"target has type { callee_type_str } )"
678+ f" (expression has type { arg_type_str } , target has type { callee_type_str } )"
680679 )
681680 error_msg = (
682681 message_registry .INCOMPATIBLE_TYPES_IN_ASSIGNMENT .with_additional_msg (info )
@@ -1433,8 +1432,7 @@ def first_argument_for_super_must_be_type(self, actual: Type, context: Context)
14331432
14341433 def unsafe_super (self , method : str , cls : str , ctx : Context ) -> None :
14351434 self .fail (
1436- 'Call to abstract method "{}" of "{}" with trivial body'
1437- " via super() is unsafe" .format (method , cls ),
1435+ f'Call to abstract method "{ method } " of "{ cls } " with trivial body via super() is unsafe' ,
14381436 ctx ,
14391437 code = codes .SAFE_SUPER ,
14401438 )
@@ -1588,8 +1586,10 @@ def final_cant_override_writable(self, name: str, ctx: Context) -> None:
15881586
15891587 def cant_override_final (self , name : str , base_name : str , ctx : Context ) -> None :
15901588 self .fail (
1591- 'Cannot override final attribute "{}"'
1592- ' (previously declared in base class "{}")' .format (name , base_name ),
1589+ (
1590+ f'Cannot override final attribute "{ name } " '
1591+ f'(previously declared in base class "{ base_name } ")'
1592+ ),
15931593 ctx ,
15941594 )
15951595
@@ -1676,15 +1676,16 @@ def overloaded_signatures_typevar_specific(self, index: int, context: Context) -
16761676
16771677 def overloaded_signatures_arg_specific (self , index : int , context : Context ) -> None :
16781678 self .fail (
1679- "Overloaded function implementation does not accept all possible arguments "
1680- "of signature {}" .format (index ),
1679+ (
1680+ f"Overloaded function implementation does not accept all possible arguments "
1681+ f"of signature { index } "
1682+ ),
16811683 context ,
16821684 )
16831685
16841686 def overloaded_signatures_ret_specific (self , index : int , context : Context ) -> None :
16851687 self .fail (
1686- "Overloaded function implementation cannot produce return type "
1687- "of signature {}" .format (index ),
1688+ "Overloaded function implementation cannot produce return type of signature {index}" ,
16881689 context ,
16891690 )
16901691
@@ -1707,8 +1708,7 @@ def operator_method_signatures_overlap(
17071708 context : Context ,
17081709 ) -> None :
17091710 self .fail (
1710- 'Signatures of "{}" of "{}" and "{}" of {} '
1711- "are unsafely overlapping" .format (
1711+ 'Signatures of "{}" of "{}" and "{}" of {} are unsafely overlapping' .format (
17121712 reverse_method ,
17131713 reverse_class .name ,
17141714 forward_method ,
@@ -1997,8 +1997,7 @@ def bad_proto_variance(
19971997 self , actual : int , tvar_name : str , expected : int , context : Context
19981998 ) -> None :
19991999 msg = capitalize (
2000- '{} type variable "{}" used in protocol where'
2001- " {} one is expected" .format (
2000+ '{} type variable "{}" used in protocol where {} one is expected' .format (
20022001 variance_string (actual ), tvar_name , variance_string (expected )
20032002 )
20042003 )
@@ -2246,15 +2245,17 @@ def report_protocol_problems(
22462245 for name , subflags , superflags in conflict_flags [:MAX_ITEMS ]:
22472246 if not class_obj and IS_CLASSVAR in subflags and IS_CLASSVAR not in superflags :
22482247 self .note (
2249- "Protocol member {}.{} expected instance variable,"
2250- " got class variable" .format (supertype .type .name , name ),
2248+ "Protocol member {}.{} expected instance variable, got class variable" .format (
2249+ supertype .type .name , name
2250+ ),
22512251 context ,
22522252 code = code ,
22532253 )
22542254 if not class_obj and IS_CLASSVAR in superflags and IS_CLASSVAR not in subflags :
22552255 self .note (
2256- "Protocol member {}.{} expected class variable,"
2257- " got instance variable" .format (supertype .type .name , name ),
2256+ "Protocol member {}.{} expected class variable, got instance variable" .format (
2257+ supertype .type .name , name
2258+ ),
22582259 context ,
22592260 code = code ,
22602261 )
0 commit comments