File tree 3 files changed +4
-3
lines changed
3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1076,6 +1076,8 @@ def check_func_item(
1076
1076
1077
1077
if name == "__exit__" :
1078
1078
self .check__exit__return_type (defn )
1079
+ # TODO: the following logic should move to the dataclasses plugin
1080
+ # https://github.com/python/mypy/issues/15515
1079
1081
if name == "__post_init__" :
1080
1082
if dataclasses_plugin .is_processed_dataclass (defn .info ):
1081
1083
dataclasses_plugin .check_post_init (self , defn , defn .info )
Original file line number Diff line number Diff line change @@ -515,7 +515,6 @@ def __init__(self) -> None:
515
515
# Original, not semantically analyzed type (used for reprocessing)
516
516
self .unanalyzed_type : mypy .types .ProperType | None = None
517
517
# If method, reference to TypeInfo
518
- # TODO: Type should be Optional[TypeInfo]
519
518
self .info = FUNC_NO_INFO
520
519
self .is_property = False
521
520
self .is_class = False
Original file line number Diff line number Diff line change @@ -1070,8 +1070,8 @@ def replace_function_sig_callback(ctx: FunctionSigContext) -> CallableType:
1070
1070
)
1071
1071
1072
1072
1073
- def is_processed_dataclass (info : TypeInfo | None ) -> bool :
1074
- return info is not None and "dataclass" in info .metadata
1073
+ def is_processed_dataclass (info : TypeInfo ) -> bool :
1074
+ return info and "dataclass" in info .metadata
1075
1075
1076
1076
1077
1077
def check_post_init (api : TypeChecker , defn : FuncItem , info : TypeInfo ) -> None :
You can’t perform that action at this time.
0 commit comments