Skip to content

Commit 614c9cc

Browse files
committed
Format with black
1 parent aaaf4c4 commit 614c9cc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

mypy/checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,6 @@ def check___new___signature(self, fdef: FuncDef, typ: CallableType) -> None:
13381338
"but must return a subtype of",
13391339
)
13401340

1341-
13421341
def check_reverse_op_method(
13431342
self, defn: FuncItem, reverse_type: CallableType, reverse_name: str, context: Context
13441343
) -> None:

mypy/semanal.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,13 @@ def analyze_func_def(self, defn: FuncDef) -> None:
842842
# Mark protocol methods with empty bodies and None-incompatible return types as abstract.
843843
if self.is_class_scope() and defn.type is not None:
844844
assert self.type is not None and isinstance(defn.type, CallableType)
845-
if (not self.is_stub_file and self.type.is_protocol and
846-
(not isinstance(self.scope.function, OverloadedFuncDef)
847-
or defn.is_property) and
848-
not can_be_none(defn.type.ret_type) and is_trivial_body(defn.body)):
845+
if (
846+
not self.is_stub_file
847+
and self.type.is_protocol
848+
and (not isinstance(self.scope.function, OverloadedFuncDef) or defn.is_property)
849+
and not can_be_none(defn.type.ret_type)
850+
and is_trivial_body(defn.body)
851+
):
849852
defn.is_abstract = True
850853

851854
if (
@@ -6110,7 +6113,7 @@ def can_be_none(t: Type) -> bool:
61106113
"""Can a variable of the given type be None?"""
61116114
t = get_proper_type(t)
61126115
return (
6113-
isinstance(t, NoneType) or
6114-
isinstance(t, AnyType) or
6115-
(isinstance(t, UnionType) and any(can_be_none(ut) for ut in t.items))
6116+
isinstance(t, NoneType)
6117+
or isinstance(t, AnyType)
6118+
or (isinstance(t, UnionType) and any(can_be_none(ut) for ut in t.items))
61166119
)

0 commit comments

Comments
 (0)