Skip to content

Commit 4356244

Browse files
committed
Remove is_coroutine as it is misleading and no longer needed
1 parent cab403c commit 4356244

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

mypy/checker.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,11 +1497,6 @@ def visit_return_stmt(self, s: ReturnStmt) -> Type:
14971497
+ ": expected {}, got {}".format(return_type, typ)
14981498
)
14991499
else:
1500-
# return without a value
1501-
# empty returns are valid in coroutines
1502-
if (self.function_stack[-1].is_coroutine):
1503-
return None
1504-
15051500
# empty returns are valid in Generators with Any typed returns
15061501
if (self.function_stack[-1].is_generator and isinstance(return_type, AnyType)):
15071502
return None

mypy/nodes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ class FuncItem(FuncBase):
323323
# Is this an overload variant of function with more than one overload variant?
324324
is_overload = False
325325
is_generator = False # Contains a yield statement?
326-
is_coroutine = False # Contains @coroutine or yield from Future
327326
is_static = False # Uses @staticmethod?
328327
is_class = False # Uses @classmethod?
329328
# Variants of function with type variables with values expanded

mypy/semanal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,6 @@ def visit_decorator(self, dec: Decorator) -> None:
14471447
self.check_decorated_function_is_method('abstractmethod', dec)
14481448
elif refers_to_fullname(d, 'asyncio.tasks.coroutine'):
14491449
removed.append(i)
1450-
dec.func.is_coroutine = True
14511450
elif refers_to_fullname(d, 'builtins.staticmethod'):
14521451
removed.append(i)
14531452
dec.func.is_static = True

0 commit comments

Comments
 (0)