Serhiy Storchaka <[email protected]> added the comment:
The most common error is missing keyword "await" in function call. "f()"
instead of "await f()".
There is a way to detect this error at runtime with minimal false positive and
with minimal overhead. We can add a new opcode which checks if the value on the
top of the stack is awaitable and raise warning/error in that case, and add it
after every functional call whose result is ignored in asynchronous functions.
It could even be merged with POP_TOP to reduce overhead.
CALL_FUNCTION ...
WARN_IF_AWAITABLE_AND_POP_TOP
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue30491>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com