Python for the .NET Developer Transcripts
Chapter: async and await in Python
Lecture: async and await introduction

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Time to move on to asynchronous programming one of my favorite topics, actually. We'll see that asynchronous programming in Python
0:09 has a lot of similarities back to C#. Do you love the async and await keyword? Well, guess what? You can have exactly the same thing in Python.
0:19 Literally, it's the same syntax. We're going to talk about all the ways that Python asynchronous programming is amazing
0:26 and a few of the drawbacks, as well as some libraries that alleviate many of those drawbacks. So asynchronous programming in Python is really great.
0:34 I would say it is one of the areas where C# and .NET actually clearly have Python beat. There's a couple reasons for that
0:42 but nonetheless, it's still really good over here. In a lot of situations, they're pretty much the same. Fill in all those details as we go through.
0:51 When we think about performance and writing asynchronous code, we usually do that for one of two reasons.
0:57 First, we might be looking for greater scalability. Maybe we're writing a web application and the web app is talking to the database
1:04 and some external APIs, and things like that. So most of the time, it's waiting on other external things but if we do this all on just one thread
1:12 or try to just line it all up the website won't be able to do other processing while it's doing that. Threading, threading requests, do help with that
1:20 but we can actually do even better with async and await. That's one side of the story, really common the other is we want to go faster.
1:28 We want to compute things faster. And with modern hardware and modern CPUs with multi-core systems, that's truly possible.
1:36 Some of the time we'll see what requirements and limitations around Python there are but that's certainly one of the reasons you would want
1:43 to add more concurrency to your system to take advantage of the hardware you have the multi-core system that you already have.


Talk Python's Mastodon Michael Kennedy's Mastodon