Closed jcorbett-sweater closed 3 weeks ago
could you please provide an example of some code that doesn't work? this minimal example seems to work, so pyright does support __await__
as far as i can tell so maybe there's something wrong with the types in that beanie package?
class Foo:
def __await__(self):
yield from range(10)
async def main():
await Foo()
Sure, I'll get a simple code sample together. It may take me a few days.
@jcorbett-sweater i'm going to close this issue at this time, but feel free to comment and we can reopen, or raise a new issue if you'd like 🙂
Objects with a await method are awaitable "Future like" objects according to PEP-0492
currently basedpyright doesn't recognize a method that returns a "future like" object as awaitable and generates an error saying the object is not awaitable. An example of the objects in the beanie project.