You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect uasyncio behaviour: tasks are not correctly terminated #7471
By default uasyncio retains state, as discussed here. Arguably in the interests of CPython compatibility it shouldn't, but on occasion this behaviour can be useful. Currently the user has the choice of whether to allow retained state.
I did look through your docs to see if this was covered but missed this; I knew you'd be aware of this @peterhinch!
Arguably in the interests of CPython compatibility it shouldn't, but on occasion this behaviour can be useful. Currently the user has the choice of whether to allow retained state.
That behaviour was very unexpected to me; not just because it was different to CPython but because it didn't make any logical sense. I'd strongly prefer to see CPython compatibility in this case. I'm also concerned that there will be subtle issues porting CPython libraries that may inadvertently stumble on this problem...
Related: It would be worth considering making asyncio.run() detect that it's been (incorrectly) called recursively (or worse, from an interrupt handler).
Activity
peterhinch commentedon Jun 29, 2021
By default uasyncio retains state, as discussed here. Arguably in the interests of CPython compatibility it shouldn't, but on occasion this behaviour can be useful. Currently the user has the choice of whether to allow retained state.
mattytrentini commentedon Jun 29, 2021
I did look through your docs to see if this was covered but missed this; I knew you'd be aware of this @peterhinch!
That behaviour was very unexpected to me; not just because it was different to CPython but because it didn't make any logical sense. I'd strongly prefer to see CPython compatibility in this case. I'm also concerned that there will be subtle issues porting CPython libraries that may inadvertently stumble on this problem...
jimmo commentedon Jul 5, 2021
Related: It would be worth considering making asyncio.run() detect that it's been (incorrectly) called recursively (or worse, from an interrupt handler).
Merge pull request micropython#7471 from matemaciek/main