For this code:
class NotAwaitable:
__await__ = 1
async def _(na: NotAwaitable):
await na
We emit this diagnostic:
error[invalid-await]: `NotAwaitable` is not awaitable
--> main.py:5:11
|
4 | async def _(na: NotAwaitable):
5 | await na
| ^^
|
::: stdlib/builtins.pyi:348:7
|
347 | @disjoint_base
348 | class int:
| --- attribute defined here
349 | """int([x]) -> integer
350 | int(x, base=10) -> integer
|
info: `__await__` is not callable
It's kind of strange/confusing that we jump straight to highlighting int in stdlib, when the more relevant thing to highlight would be __await__ = 1.
For this code:
We emit this diagnostic:
It's kind of strange/confusing that we jump straight to highlighting
intin stdlib, when the more relevant thing to highlight would be__await__ = 1.