@@ -118,18 +118,20 @@ def __init__(
118
118
self .is_neither_frozen_nor_nonfrozen = is_neither_frozen_nor_nonfrozen
119
119
self ._api = api
120
120
121
- def to_argument (self , current_info : TypeInfo , * , of : Literal ['__init__' , 'replace' , '__post_init__' ]) -> Argument :
121
+ def to_argument (
122
+ self , current_info : TypeInfo , * , of : Literal ["__init__" , "replace" , "__post_init__" ]
123
+ ) -> Argument :
122
124
arg_kind = ARG_POS
123
- if of == ' __init__' :
125
+ if of == " __init__" :
124
126
if self .kw_only and self .has_default :
125
127
arg_kind = ARG_NAMED_OPT
126
128
elif self .kw_only and not self .has_default :
127
129
arg_kind = ARG_NAMED
128
130
elif not self .kw_only and self .has_default :
129
131
arg_kind = ARG_OPT
130
- elif of == ' replace' :
132
+ elif of == " replace" :
131
133
arg_kind = ARG_NAMED if self .is_init_var and not self .has_default else ARG_NAMED_OPT
132
- elif of == ' __post_init__' :
134
+ elif of == " __post_init__" :
133
135
# We always use `ARG_POS` without a default value, because it is practical.
134
136
# Consider this case:
135
137
#
@@ -253,7 +255,7 @@ def transform(self) -> bool:
253
255
and attributes
254
256
):
255
257
args = [
256
- attr .to_argument (info , of = ' __init__' )
258
+ attr .to_argument (info , of = " __init__" )
257
259
for attr in attributes
258
260
if attr .is_in_init and not self ._is_kw_only_type (attr .type )
259
261
]
@@ -1093,7 +1095,7 @@ def check_post_init(api: TypeChecker, defn: FuncItem, info: TypeInfo) -> None:
1093
1095
ideal_sig = ideal_sig_method .type
1094
1096
assert isinstance (ideal_sig , ProperType ) # we set it ourselves
1095
1097
assert isinstance (ideal_sig , CallableType )
1096
- ideal_sig = ideal_sig .copy_modified (name = ' __post_init__' )
1098
+ ideal_sig = ideal_sig .copy_modified (name = " __post_init__" )
1097
1099
1098
1100
api .check_override (
1099
1101
override = defn .type ,
0 commit comments