New submission from YoSTEALTH <rit...@stealthcentral.com>:
from asyncio import run async def true(): return True async def false(): return False async def error(): a = false() b = true() return await (a or b) # Good Error # "RuntimeWarning: coroutine 'true' was never awaited print(await error())" async def no_error(): return await (false() or true()) # False # Bad Problem # `RuntimeWarning` is not raised for 'true'. # Note # The correct syntax is `return (await false()) or (await true()) as it should return `True` # not `False` async def test(): print(await no_error()) # False print(await error()) # RuntimeWarning(...), False if __name__ == '__main__': run(test()) - Tested in Python 3.8.0b1 - Why does `error()` return `RuntimeWarning` but `no_error()` does not? ---------- components: asyncio messages: 345723 nosy: YoSTEALTH, asvetlov, yselivanov priority: normal severity: normal status: open title: RuntimeWarning is NOT raised type: behavior versions: Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37299> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com