2 ms·
Python also has it. You can call async code with `asyncio.run` but it is extremely limited by the fact that nested event loops are prohibited. Any function that
by enragedcacti 2y ago
Python also has it. You can call async code with `asyncio.run` but it is extremely limited by the fact that nested event loops are prohibited. Any function that uses it becomes extremely brittle because it can't be called from async functions unlike all other synchronous code.
This is for the most part an intentional design decision to "make sure that when the user is already in async code they don't call the sync form out of laziness." [1]
[1] https://github.com/python/cpython/issues/66435#issuecomment-1531879319 https://github.com/python/cpython/issues/66435#issuecomment-...