Skip to content

Commit 424334a

Browse files
committed
Address CR
1 parent 6387359 commit 424334a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,7 @@ def builtin_item_type(tp: Type) -> Optional[Type]:
28762876
# This is only OK for built-in containers, where we know the behavior of __contains__.
28772877
if isinstance(tp, Instance):
28782878
if tp.type.fullname() in ['builtins.list', 'builtins.tuple', 'builtins.dict',
2879-
'builtins.set', 'builtins.frozenfet']:
2879+
'builtins.set', 'builtins.frozenset']:
28802880
if not tp.args:
28812881
# TODO: make lib-stub/builtins.pyi define generic tuple.
28822882
return None

mypy/semanal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ def visit_func_def(self, defn: FuncDef) -> None:
429429
else:
430430
# A coroutine defined as `async def foo(...) -> T: ...`
431431
# has external return type `Awaitable[T]`.
432-
defn.type = defn.type.copy_modified(
433-
ret_type = self.named_type_or_none('typing.Awaitable',
434-
[defn.type.ret_type]) or
435-
# We are running tests
436-
self.named_type('typing_full.Awaitable', [defn.type.ret_type]))
432+
ret_type = self.named_type_or_none('typing.Awaitable', [defn.type.ret_type])
433+
if ret_type is None:
434+
# We are running tests.
435+
ret_type = self.named_type('typing_full.Awaitable', [defn.type.ret_type])
436+
defn.type = defn.type.copy_modified(ret_type=ret_type)
437437
self.errors.pop_function()
438438

439439
def prepare_method_signature(self, func: FuncDef) -> None:

0 commit comments

Comments
 (0)