Can Someone Review My Blog Post on Async/Await in Python?

0
0
Asked By TechExplorer123 On

I've recently noticed that many of my colleagues struggle to grasp the concepts surrounding `async` and `await` in Python, so I took some time to write a blog post explaining the topic in detail. However, since Python isn't my primary programming language, I'm looking for someone who has a deep understanding of async/await, Awaitable, and coroutines in Python to review my post for accuracy. You can check it out here: [my blog post](https://yoric.github.io/post/quite-a-few-words-about-async/). I appreciate any feedback!

2 Answers

Answered By CodeGuru99 On

I didn't spot any major factual mistakes, but it's worth mentioning that your post could clarify the core reasons behind using async/await better. You initially talk about reactivity, which is great, but you might want to dive deeper into the overhead of OS threads later on. Also, it would help to include a comparison of the pros and cons for different concurrency methods, including processes and OS threads. It's interesting that you discussed how Golang handles it; maybe look into greenthreading too, as it’s been used in other languages for a while.

WriteOnWizard -

Totally agree! Exploring more on the different threading models would lend your post a lot of depth.

Answered By PythonNerd101 On

Overall, the content is solid, but I noted a couple of little tweaks:

1. You're missing a function return type hint in your code — `def fibonacci(n: int): int` should be updated to `def fibonacci(n: int) -> int:`.

2. When creating threads, use `start()` instead of `run()`. Just a small thing, but important to ensure new threads spawn correctly.

3. One more thing, I noticed you referenced `parent` instead of `parent_id` in a part of your code. Just a heads up!

TechExplorer123 -

Thanks for catching those! I’ll make the adjustments.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.