-
apply()will setasyncio._nest_asyncio2to help distinguish from patches made bynest_asyncio(#1) -
apply()will warn if asyncio is already patched bynest_asyncioon Python 3.12+ (#1)You can also set
error_on_mispatched=Trueto turn the warning into aRuntimeError, regardless of the Python version.