4 ms·
What does this add this isn't already right there in the documentation?
by mgsk 4y ago
What does this add this isn't already right there in the documentation?
- Jtsummers 4y agoIt draws attention to a problem that a lot of people have created for themselves by not reading the documentation (or not recalling it if they read it). I guess the author could have just linked the documentation but then they couldn't have added the additional context of the github search demonstrating how common it is.
- newaccount74 4y agoI must have looked through the docs for create_task a dozen times while trying to figure out how async/await works in Python but still managed to overlook this part.
- edflsafoiewq 4y agoThat is unsurprising. It was first added as a brief note only in 3.9, and expanded to its present length only in 3.10.
- wnolens 4y agoSame.
- nkrisc 4y agoIf there was nothing to add then there wouldn’t be loads of projects on GitHub making exactly this mistake.
- klyrs 4y agoThe author doesn't go into much detail on that point: this warning should be present in documentation of many Python libraries that use create_task and return the result to the user unless that library stores those tasks in a collection as is recommended -- at which point the library author had better roll their own garbage collection!