5:32 the reason why the arrows pointed to the range() function for the float parameter error is because the error is raised by range(). Wherein the prior error with the string parameter is raised by str.__add__()
Great video, just starting out learning to use Async in python. Can I ask why you have the "await asyncio.sleep(0)" at the bottom of the count function? If it is waiting for zero seconds, would you not be able to run the function with it removed?
Thank you! That's somewhat of an idiom -- it passes off to another coroutine if available (like it would of you slept for any non-zero amount of time), but makes that coroutine available to go back to immediately.
How to manage different task group, like tg1, tg2, tg3: tg1 for getting data from api tg2 for data validation tg3 : depending on tq2 response, tg3 will send another api request.
Wouldn't `await count(5); await count(10)` give a different result than the one in the video? The code proposed in the comment would print first all values from 1 to 5 *then* all values from 1 to 10. The code in the video interleaves both sequences.
I do miss the option to return the values that did succeed though, "returns_exceptions=True" was quite nice.
You can still use the old system where needed -- they may add some features to task groups to incorporate some old functionality where deemed fit.
5:32 the reason why the arrows pointed to the range() function for the float parameter error is because the error is raised by range(). Wherein the prior error with the string parameter is raised by str.__add__()
Great video, just starting out learning to use Async in python. Can I ask why you have the "await asyncio.sleep(0)" at the bottom of the count function? If it is waiting for zero seconds, would you not be able to run the function with it removed?
Thank you! That's somewhat of an idiom -- it passes off to another coroutine if available (like it would of you slept for any non-zero amount of time), but makes that coroutine available to go back to immediately.
How to manage different task group, like tg1, tg2, tg3:
tg1 for getting data from api
tg2 for data validation
tg3 : depending on tq2 response, tg3 will send another api request.
how do you get all those emojis on the terminal looks great !!!
I actually have a video which should help you out (: ruclips.net/video/4RuGK3w6Mbs/видео.html
in your example if you did await count(5); await count(10) it would achieve the same thing with fewer lines
Using semi-colons like that isn't especially Pythonic, at least in my opinion. I tend to spreading out over multiple lines.
Wouldn't `await count(5); await count(10)` give a different result than the one in the video?
The code proposed in the comment would print first all values from 1 to 5 *then* all values from 1 to 10.
The code in the video interleaves both sequences.
Nice!
What's that VSC theme?
Looks like ayu
It is indeed Ayu. There a link in the description of you wanna know more (:
raise me from None lol