MCPcopy Index your code
hub / github.com/python/mypy / has_coroutine_decorator

Function has_coroutine_decorator

mypy/checkexpr.py:6619–6622  ·  view source on GitHub ↗

Whether t came from a function decorated with `@coroutine`.

(t: Type)

Source from the content-addressed store, hash-verified

6617
6618
6619def has_coroutine_decorator(t: Type) -> bool:
6620 """Whether t came from a function decorated with `@coroutine`."""
6621 t = get_proper_type(t)
6622 return isinstance(t, Instance) and t.type.fullname == "typing.AwaitableGenerator"
6623
6624
6625def is_async_def(t: Type) -> bool:

Callers 1

visit_yield_from_exprMethod · 0.85

Calls 2

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…