Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 411 recorded. We got the 411 today. 411 recorded November 25th, 2024.
And I'm Brian Okken.
And I'm Michael Kennedy.
And this episode is brought to you by us.
So we have links in the show notes, but check out Talk Python Training and Pythontest.com for some courses.
And Patreon supporters, thank you for sticking it out with us.
Also, we have lots of links in the show notes for connecting with us on social media because we've got links for Fostadon on Mastodon and also Blue Sky for all of us here.
We've got Python Bytes and Brian Okken and M. Kennedy.
M. Kennedy is at mkennedy.codes.
So check that out on Blue Sky.
But all the links are in the show notes.
And thank you, everyone, for showing up for the live show.
I love having you guys here and commenting.
If you're listening later, we thank you also.
But if you'd like to listen sometimes.
It's usually 10 a.m. Pacific time, sometimes other times.
And you can go to pythonbytes.fm/live to get that.
And finally, if you are listening and you're wondering about any link that we cover in the show, you can go to our page, the notes page on pythonbytes.fm.
But you can also click on the link to get in the newsletter.
And we'll just send you those links right in your email inbox.
I have two more thoughts in there really quick, Brian.
We haven't talked about this before.
Okay.
I think the newsletter is awesome.
People seem to be really enjoying it and connecting with it, the people who are subscribers there.
But I don't even want to necessarily say this out loud to encourage it.
But if you don't listen to the show, you maybe miss one or something.
You're still going to get those in your inbox.
And you can just peruse through real quick.
Oh, look at these two interesting things that they found.
That's number one.
Number two, this is also all of the stuff.
Our show notes are super detailed.
And so people put our RSS feed for the podcast into their regular RSS reader.
It's real similar as well.
So there's reason to add this RSS feed to maybe reader or whatever feed bin or whatever you're using outside of just listening to the podcast.
That's a great hack.
I like that.
Speaking of hacking, you want to talk about hacking?
Yeah, you hacked some website.
I hacked some website hard.
I hacked it hard.
And Python Bytes is on the docket to get the same hacking.
So for as long as there has been a Talk Python and for as long as there's been a Python Bytes, they've been running on Pyramid.
The Pyramid web framework created by Chris McDonough.
Super cool framework.
I really, really love it.
But the truth is, the sad truth is, it's just not getting updates these days.
So if you want to do async programming, you have to do async programming.
Sometimes it's hard to avoid it.
It's not supported.
It doesn't support types.
It doesn't do a lot of things.
And even though it's great and simple, it felt kind of like a bit of a liability to be having all of our code written on frameworks that don't really get updates.
So I rewrote Talk Python.
First, talkpython.fm.
Not the courses.
Not Python Bytes.
Just Talk Python.
Because it's a medium-sized level of complexity.
More complex than Python Bytes.
Way less complex than the course section e-commerce website.
Just to see how would that go.
Is this a good idea or a bad idea?
Turns out it's a pretty awesome idea.
So I rewrote Talk Python.
This is the topic.
In court.
And I wrote up a long post of my thoughts on it.
Why did I do this?
What did I consider?
A lot of people are like, why didn't you consider framework X?
You're crazy not to consider that.
I'm like, I did consider that.
And I wrote it down why I didn't end up picking it.
So if people are thinking about changing frameworks, here's a nice write-up of an example.
Even if you're thinking about async flask, aka court, for now, until those get merged, if they ever get merged.
It's really cool.
Like, for example, our database layer is Beanie, which is Pydantic plus MongoDB.
Super awesome.
It only supports async code.
That's it.
Pyramid only supported synchronous code.
So I had to write this janky translation layer that would curry every request over to an async thing, wait for its response, and then turn it back into async request.
There was, like, weirdness that was there, right?
And I'm just like, could I just not do this?
You know?
And so I went to solve that technical debt issue that's been dragging around for a long time.
Chose court.
So a few things.
First of all, what did I consider?
I considered FastAPI, Litestar, as in lightstar.dev, super cool framework.
If you wanted something like FastAPI but kind of batteries included, like Django, Litestar is the winner.
Litestar was really close.
FastAPI was a real contender.
Django, you always got to consider Django, but decided not to go with that.
Hugo, actually, I consider, like, what do you think, how much of our site do you think we could rewrite in just a static site generator like Hugo?
I think a lot of it.
Yeah, I was actually thinking about doing testing code over again in Hugo at some point.
Yeah.
By the way, this site that we're looking at here with the blog post, this is a sub-Hugo site within the court site in Talk Python, by the way.
Wow.
I think it's really great.
But there's certain things, like on Talk Python, there's a guest list, and there's all the episodes, and there's the analytics of who downloaded which episode, and then who sponsors those different episodes.
And there's ad dashboard.
There's, like, a bunch of stuff that's not real obvious when you're looking at it from the outside.
Oh, it's just like a blog kind of with attachment.
Like, it's actually way more complicated on the sort of iceberg part that people don't see, and I decided not to do that.
And, of course, Flask, which is interesting.
So, anyway, I think FastAPI is awesome, but it's really focused on APIs, though you can make it work for websites.
I don't think it's primarily the thing for websites, right?
One of my goals here, by the way, was I want a super popular framework.
I want one where if you say, hey, I wrote my website in this.
What framework did you choose?
There's a real good chance somebody says, me too.
You know, and Pyramid, just as much as I love it, didn't check that box these days.
And I also would have put Cord in that category, except for the fact that it's really maintained by the Flask people now.
Yes, exactly.
I almost didn't consider Cord at all, and I ended up going with it.
And that's because I talked to David Lord about how it's been brought into the same organization as Flask.
They're working, like, they're both contributing to both.
There's attempts to sort of bring Cord into Flask properly.
So maybe one day they'll go over.
And if I change my mind, literally all I have to do is find and replace lowercase Flask and uppercase Cort with uppercase Flask.
And it's back to Flask, right?
It's a very, very small tie-in.
You know what I mean?
So for that reason, I felt like Cort was worth consideration.
Okay.
So FastAPI, awesome, obviously, but too API-focused.
Same thing for Litestar, also not as that popular.
It's more popular than Pyramid, but it's not in the, of course you're using that.
Django is awesome.
I mean, it's actually, I learned by doing this research, going through the PSF, JetBrains, Python developer survey, that if you look at the most popular framework, Flask is to a decimal point more popular than Django.
But if you look at web developers who use a web framework, Django is more than twice as popular than Flask.
That's pretty interesting, right?
Yeah.
Yeah, so a lot of machine learning models or something running there.
Anyway, I go through why I'm not a huge fan of, didn't want to adopt.
Django, you can read that up if you care to.
I think Hugo's sites will be so neat.
They're like, they can't go down.
Technically, the data center can go down, but there's no runtime reason that a static site goes down, and that's pretty glorious.
So I did the upgrade in two steps.
I first said, let's go and rewrite everything in Cort, but just keep the synchronous code there.
Because one of the big challenges is to rewrite the entire stack to be async, right?
And so let's just get it running the way it is, but on the Cort framework, aka Flask, not Pyramid.
So that took about a day, maybe like a long day, 10 hour day or something, you know?
Got that bad boy knocked out.
And then, you know, that was 2,280 lines changed, 3,000 lines of code deleted for that part.
That is a good chunk.
And then I rewrote it in async.
After I got that all tested and deployed, like immediately, that's another 1,600 lines of code, 1,700 lines of code changed.
But yeah, awesome performance.
Okay, so about a day to convert to Cort, and then you went to async.
How long to do that?
I'd say maybe eight hours, a slightly, six hours, six to eight hours, let's say six hours.
Less than a hard day, like a regular day of work.
Not a, I'm done for the day.
But yeah, we're talking, you know, five times faster performance.
That's pretty, that's pretty awesome, actually.
That's pretty good.
Yeah, it's really, really nice.
And I was able to get rid of that.
And a lot of that, like half of that speed is from this, okay, you've got a request.
Send it over to some async background thread that can async run it.
Wait for the response.
Okay, I got the response stash.
Grab the response back and then send it back over to the sync reverse version to return.
Like all of that coordination added a lot.
Not a lot of CPU pounding overhead, but just delays here and there, you know what I mean?
Yeah.
Anyway, that's it.
And finally, if you have a whole bunch of different pages, you want to make sure they're not broken.
The way that I tested that most of it wasn't broken was I just went to the sitemap, which
has a thousand pages in it.
And I just wrote a Python program to just request every single URL in the sitemap and make sure
it didn't 404 or 500 or anything like that.
The all passed, push to production.
Let's go.
So did you already have a list of all the links or did you?
Yeah.
Because you generally want a sitemap for SEO and Google and Bing and all those things because
that's what they use to discover like how much of our site can we index and what might we
miss if you're not directly linking to it, but you want to make it known basically, right?
So over here in the sitemap, we've got like, you know, check out the scroll bar.
You can just grab all the links out of there.
Exactly.
So I take each one of those.
So here's the one catch.
One person ran into an issue.
Oh man, I missed that one.
And it's when you submit forms, right?
The page that is shown when something is processed and submitted.
I got one or two errors there.
One little admin thing that only affected me, but somebody signed up for the mailing list.
The mailing list has a page that's special if you sign up successfully.
So thanks.
And here's a few other things.
Somehow I forgot to check the result of that.
And there was some kind of bug in there that was easy to fix, but hard to discover.
Ooh, links not in the sitemap.
Yeah.
Or they might even be there, but you've got to do an HTTP post with data to discover them.
Not a get because get will show the form, but it won't process the form.
You know, that was what it was.
Okay.
I forgot to await something in the resulting post handler, basically, is what it was.
Oh, nice.
You have an interactive user base so they can let you know.
Exactly.
Century sent me a little message that said, you know what?
There's a crash.
Oh, okay.
Yeah.
Anyway, very cool.
So hopefully, you know, I kind of want an extra detail because, yeah, I think it's just on its own.
It's interesting, but I think more so the reason I wanted to cover this is I think it's relevant for other people who are like,
oh, you know, we are on, you know, cherry pie and maybe we shouldn't be anymore.
Maybe we should pick another one of the top three out of the list like Michael did.
And I don't know, I'm sure it'll help some people on this journey.
Yeah, cool.
Nice.
Thanks.
Well, I want to talk about PyPI a little bit.
PyPI now supports.
You want to make an attestation about it?
I don't even know what that word means.
But PyPI now supports digital attestation.
Yeah, okay.
What does that mean?
Well, I'm not sure what it really means, but it's a supply chain thing.
So PyPI package maintainers can now publish signed digital attestations when publishing.
In order to further increase trust in the supply chain security of their projects.
That sounds cool.
Additionally, there's a new API to new APIs available for consumers and installers to verify published attestations.
Oh, my God.
This sounds like a lot of work.
Fortunately, it's not.
So if you are a package, we're going to link to the Python package index blog.
And this is written by Dustin Ingram.
Talking about this, there's some discussion about why they didn't do signed identity key pair things.
But the gist is, if you're already using GitHub Actions and trusted publishing, and you're using the GitHub Action PyPI publish, a little hook thing for GitHub Actions, it'll just work for you.
You just need to make sure that there's a...
The version is, I think it's...
Well, there's another article that I looked at.
I think it's 11.
Let's peek over there.
So this other article, there's another article, PyPI introduces digital attestation to strengthen PyPI packaging security.
This is written by Sarah Gooding.
And the gist of it here is, oh, yeah, version 1.11.0 is the one that you need to use.
Now, what if you want to use something else?
If you don't use...
If you don't like GitHub Actions, you're using something else.
Well, there is plans for other trusted publisher environments are planned.
And then if you don't even want to do that, if you want to do it manually, it's not recommended, but you can do this manually.
So you're not locked into GitHub Actions.
It's just...
I think that was a reasonable choice for them to implement first.
You got to have...
One of them has to be first.
So that's what they did.
Like I said, there's another article by Sarah Gooding.
Also very good.
It also walks through what the...
What the...
The viewing the UI for the new API for viewing what the file looks like.
And the cool thing about this is, okay, this seems sort of technical and okay, like, you know, security on supply chains and all that.
Yeah, yeah, yeah.
But really, like, who cares?
Well, we all care, really.
But also, one of the things that I realized is there's links on PyPI for projects to say where the source code is.
But we just...
You just put that there.
It's not guaranteed to be linking.
Now, this is where the attestation makes it so that PyPI can verify that the object really is from the source code.
So there is...
You're not lying.
Like, there's nobody in the middle lying about it and publishing a package that it really isn't from that source code from something else.
And that's what we want.
We want our open source projects to be available, easy to install, but also that we can find the source code really readily available.
So that's what that's all about.
There's also a cool are we PEP 740 yet that just shows you different, some of the top packages.
Let's see, the 360 most downloaded packages and whether or not they're supported yet.
And this is pretty new.
So there's not that many supported already.
But Wheel is supported, for instance.
So you can check that out.
Yeah.
Pydantic.
Good job.
Pydantic people.
Good job, Pydantic people.
Just had Samuel Colvin on the show, by the way, on Talk Python.
So people can hear from the Pydantic folks themselves very soon.
Yarl?
What's Yarl?
I got to check that out.
I've seen that in my dependencies.
I don't know what it is.
It's one of those things that comes along.
Something.
Yeah.
Something library.
Markdown library?
I don't know.
I have no idea.
I'm making this up.
And 360, because it's a wheel, there's like a visualization that is a wheel onto little
slices to show you which ones are there, which ones aren't.
Yeah.
Nice.
360 degrees.
That's pretty cool.
They picked 360.
It is.
All right.
A couple of comments.
Sean Tibor at there.
Hey, Sean.
Glad the cryptography package is there.
Do a test.
The tested status is for sure.
And Christian says, trusted publishing is great.
It's never been easier to publish on PyPI.
If you're using GitHub, that is.
Indeed.
And Brian, you said when I talked about UV build, UV publish last time, time before, whenever,
you said that you're not even doing that.
You just let GitHub do it.
Yeah.
How's that go?
How do you make that happen?
Well, we go through this thing, this, what do we call it?
The package.
Trusted package provider or something?
Yeah.
The trusted publishing.
There's a, there's, there's like a doc on how to do that.
Trusted publisher.
You have to have an API token.
You like link tokens between GitHub, your GitHub project and, and PyPI.
So they know about each other.
And then the, then kind of just add a GitHub action, PyPI publish step.
So nice.
I should set that up.
There's lots of ways to do it though.
Workflow wise.
I found personally that my, my favorite way is to, to do the publishing as part of the tag.
So I'll, I'll do another version.
That's just like, I'll, I'll publish to, I don't publish everything that I pushed up IPI,
but, but, or push to GitHub.
But when I push a, push a tag, then a build is done and the publish happens.
So it pushes off a tag.
So just tack it locally.
Push it and then magic.
Yeah.
Nice.
Awesome.
Yeah.
That's a good question though.
I think we might want to revisit that and, and put an article up, find an article on that
whole process.
Yeah.
Are you looking for a topic for a blog post?
You feel a little bit rusty.
I mean, that's what we got to talk about.
Are you feeling rusty with your blog?
Django's feeling rusty.
Django's feeling super.
I mean, a lot of Pythons feeling rusty.
That's what I was talking to Samuel Colvin about.
However, I want to highlight project that is very early in its life, but I think maybe deserves
some love, some attention anyway from Lily foot Django rusty templates.
So all of these web frameworks have some variation of templated programming.
So you've got your HTML and then you'll have some kind of expression, like loop over all of
my blog posts and like put out the title and the contents in this little wrapper deal or whatever.
Right.
They all have them.
They're all variations.
They're not as varied as you might imagine.
And I'm going to actually come back to this whole template thing at the end of the show
as well.
However, this one re-implements the Django templating one, right?
We've got Django, got Jinja, Mako, Chameleon, probably others.
There's that whole PEP 750 maybe that's bringing templating into the language itself, all this stuff.
Right.
So this one re-implements that Django variant of that in Rust with the goal of 100% compatibility
on output, not necessarily input or the way you program it, but output at least.
And then error reporting that is at least as good as Django.
And obviously, why would you do this if you weren't looking for improved performance over
Django's pure Python implementation?
These templates can be slow.
One of the things that can make your website literally suffer to startup if it's under heavy
load is to restart it and it has to reparse all the templates.
I go to the extent that I have an app that will see that I can run against the website and it will
request a representative subset of all the URLs to make sure that the template is loaded and parsed
because it's a difference of hundreds of milliseconds versus tens of milliseconds, right?
It could be up to one second to load the page the very first time it hits one of these complicated
things.
Yeah.
And you want your pages fast.
So when Google and other things hit it, they'll go, oh, that page is fast.
We'll put it a little higher in search, you know?
So anyway, this could be interesting.
So caveat for the world.
It is net ready for full release and therefore is not on PyPI yet.
You can check it out if you want to live dangerously or contribute.
Okay.
They should push it.
That's what XeroVerse for.
Exactly.
I was shipping stuff that was 0.02 on vacation.
Come on.
Yeah.
Come on.
Anyway.
No, that's fine.
People can do what they want, but.
Of course.
Sounds fine.
I guess it depends.
Do you feel like it's even anywhere close to potentially usable or is it just you're still
working on it before it even makes sense?
Yeah.
They want.
You don't want to be, you don't want a bunch of bugs saying this doesn't work yet.
I know.
And I said not to use it.
Yeah.
But also people, I think it's a cool idea.
And if you want to help out and help out.
Yeah, absolutely.
Nice.
Are we, I don't want to get too dry, but I want to talk about another pep.
So PEP it up.
Pep it up.
It's a PEP talk.
Pep talk.
So Brett Cannon announced.
So I, this is the first time I'd heard of this.
When did this post come out?
This is November 13th.
That PEP 639 is now supported by PyPI.
This pep, this is a PEP that lets you specify the license for your code using SPDX expressions.
Who can't get excited about SPDX expressions?
And it's easily, it's, and easily include all your licenses with your code.
Okay.
I have no idea what SPDX is, but let's jump in a little bit.
The why am I excited about this is because the last way to be able to do, specify your license
was you did a little license string thing to say MIT or whatever.
But then you had a link, maybe a link to license.txt file.
But there wasn't like, wasn't clear understanding what you should do.
But you really had to, in order to get the license to show up on PyPI, you had to have a
trove classifier.
And I'm not really a fan of trove classifiers.
I think they're weird.
So you don't have to do trove classifiers anymore.
So Brett linked to E Durbin's, or E's PEP 639 is now live.
So that's just the same thing, but I'll link to it anyway.
So let's look at this.
The cool thing about this, I think, is, like I said, you don't have to use the trove classifier
anymore.
I'm going to jump down to like, really, what does it look like?
So we have, there's reasons why and all that stuff.
But really, it was confusing before, and it's easier now.
So all you have to do is do something like you have license, a license field, and you can put
MIT or something.
So that's the, that's pretty easy.
And then, but there's like, and so if you have, you can do logic in here.
You can, if you've got multiple licenses in there.
And the other thing was projects really, a large project might have more than one license
because there might be, you may have vendored in part of the system that is, or part of another
library that is licensed under a different license.
What do you do there?
Well, that's one of the great things about this is that there's that logic in there, but you
can also do the license files key.
And the license files key is great because you can just, there's more than one.
You can have more than one and you specify where they all go.
And it's just a, it's just a list of strings with, with what are those wild cards and stuff
so that you can regular, with sort of regular expressions so that you can, you can find different
files through there.
And you can even have like, I like this version.
It's got a main license.txt at the top and then a licenses directory.
So you can have a directory full of licenses for sub components or something.
Wow.
It's like creating a list, a set of, set of arguments from a list.
So you say star args and it explodes it out into positional arguments.
It's like kind of like that, but for a Toml file.
That's wild.
Or is that a YAML?
I don't know.
I'm not.
Well, it's a, it's SPDX or whatever.
So this, this is a pretty exciting to me.
I asked Brett like, well, this is still, it's not like, it's not finalized.
I guess it's provisional.
PyPI supports it, but they say that it's going to be, they need, it's an implementation of the
PEP with, in two build backends.
I don't know what the two build backends.
That would be like hatchling or poetry or something like that.
I believe.
Oh, right.
Definitely hatchling would, or set up tools or something like that.
And an implementation, implementation of the PEP and PyPI, which is done.
So I'm pretty sure this is done.
Yeah.
And the first link that you clicked on the discuss, the discourse thread or whatever.
Yeah.
See that second thing?
Carolina Suma wrote the PDM backend supporting this since such and such version and hatchling
since another version.
I believe the conditions have been met.
Okay.
So I think this is going to be changed from provisional to something else.
Hopefully.
Whatever comes after provisional.
Probably accepted or whatever.
Probably accepted.
Hey, I just want to make a little to Philip and crew in Carolina as well.
Just, you know, the file that you create for this is license underscore file.
No extension.
Think of an extension, please.
So we can have a default.
So you can double click it and open it.
Rather than have to figure out an editor, go into it, drag it into it.
Right.
Because without an extension, you can't set a default editor to edit the license file in
Mac or Windows at least.
Oh, like say license.txt or something?
Yeah.
Or MD or YAML or TOML.
Or I would say YAML or TOML probably makes the most sense if it has that structure.
Because then the editors, if you open it in PyTron or VS Code, they'll apply linting to
it based on the format.
Whereas right now, it's like, well, whatever.
Good luck with that.
Right?
It's just text.
Well, so this, like this, these changes that I'm showing are, they're not, they're like YAML
or TOML or something like that because they're part of the PyProject.toml file.
Oh, are they?
Well, somewhere it talked about the license key file or the, yeah, right.
And there's a license underscore, right there.
Go back up.
Stop.
license dash files.
Oh, that's just the key in the file.
That's not actually a file.
Okay.
Then I don't know what I'm talking about.
Forget that.
That's the key.
And so I think that they're usually.
No, it's fine.
It'll be picked up by PyProject.toml.
Yeah.
But I usually, I used to just have it be raw, but I like the idea of doing a .text file.
Yeah.
Anyway.
Something that applies, that makes the tool apply the linting to it if it's reasonable,
that would already know how to do that.
Yeah.
Do it like a, like a Word doc.
As.
Come on.
I'll have an Excel.
Come on.
And not like a doc X.
Do it, do it like, you know, from like 1995.
Straight doc.
Let's go.
Okay.
Anyway.
I think that's where those are items.
Those are.
Okay.
Well, do you have any extras?
I have a couple of quick ones here.
I'll go through for us.
I'll let you do yours.
Really quickly.
Python 314.
Alva 2 was released last week, just after we did our show last week.
So kind of the most recent one we could talk about, I believe.
Anyway, it continues on with its PEP 649 deferred evaluation annotation of annotations on Python
configuration C API and no longer having PGP signatures and improved error messages, among
other things.
So check it out if you're interested in that.
You want to test against it.
Remember, there will be seven.
So it's pretty early in there.
But, you know, you'll be able to influence the direction if you so want.
Blue sky.
Brian, we have personalities.
Python personalities are invading blue sky.
And I would say I'm really happy with the engagement and how much people are participating
over there and all those kinds of things.
It seems really, really great.
Right?
Yeah.
So we have links for all of our accounts on blue sky over there.
But the thing I want to highlight is I created a starter pack.
And I think these starter packs are actually one of the magic growth hacks of blue sky.
And also a good way for people to get started.
So here's the common social problem, social network problem is you join and it's crickets.
And then you follow stuff that you don't care about because it's like you've got no followers.
So here's a bunch of horrible stuff that you don't want to see.
Oh, great.
People ranting about this or that.
I want none of this.
I want to just get back to my communities that I care about.
So for each community, you can create people can create what are called starter packs,
which is like up to 250 people.
You can just click one button and say, boom, I'm going to follow those people.
It's a quick jumpstart.
So I created a Python personality one.
I don't know.
I think it has 60 people, maybe more.
I'm not sure.
I'll be able to show you in a second.
But it's, you know, it's got whoever created it.
And then it's got who you put like Nina Zakarenko, Dr. Becky, Chris Williams, Cecil Phillips,
Savannah, Simon Wilson, Peter Wang, and so on.
So you're in here somewhere, Brian.
Brett Cannon, who were just covering his article and his PEP and so on.
See, there you are.
And so I just want to encourage people, hey, go find some of these starter packs.
Consider mine.
Give it a click and so on.
And how do you do that?
Well, Will McGugan pointed out that there's this blueskydirectory.com that has all the starter
packs.
And you can search for like Python starter packs or motorcycling starter packs or skating
or whatever you're into.
So you've got, I don't know who these people are.
There's some people who created some.
Like down here a little bit further, you can see like here's the one I created and different
folks.
Python core team by Hugo, I believe that is.
So on, right?
So there are actually 572 starter packs.
But I suspect a lot of overlap intersection here.
Yeah.
And one of the things I appreciate about checking these out is, is being able to like that.
Some people are keeping me like keeping these up a little bit, which I appreciate.
Like Luciano.
Wait, no, it wasn't Luciano.
It was, oh, Reuven Lerner has one also that he's trying to keep up.
And, and I, because I've been on Blue Sky for a while.
So I like went out and looked for Python people early on and there's a ton of Python people
jumping on the bandwagon right now.
Right.
And just yesterday, a bunch joined, you know?
Yeah.
So, so it's good to, to look like I was just looking through your list and there was probably
five or 10 that I hadn't, that I hadn't followed yet.
And there are people I want to follow.
So.
Yeah.
And I just added somebody two hours ago to it.
So it's, it's being maintained to the limit till it hits this limit.
Then I have to start to make tough decisions.
If, if someone ejects someone else, I don't really want to do that.
But right now there's 61 people in mind and this directory thing shows you how big the
list is.
Care about that.
All right.
Part, another really quick thing.
No, I'm going to save this one until next time.
Just for, for sake of time, we'll cover that one next, next week.
All right.
Well, I've got a few extras.
I didn't cover this because I didn't really, I don't know if I'm smart enough to cover this,
but I'll link to it anyway.
There's a article from Armin Roeniker titled playground wisdom threads, beat async and await.
And he's not really talking about Python threads.
He's really talking about, or, or Python async and await.
I think he is, but also just in general, like programming languages, thinking about threads
versus thinking about async and await.
And, and it's just an interesting read in a good article talking about how like we should
really be making concert concurrency really easy to the point where we don't actually talk
about concurrency.
It just works.
And that seems ludicrous in some respects, if you're used to a low level language, but
they, his example at the top just sort of like blew me away in thought process of thinking
about, about the, the scratch programming language for kids.
And if you, if you have like, he has an example of like a, a cat and a mouse sprite having code
that like just, you know, moves 200 times while, or like wild, while mouse X is less than
200 update the X position by five and sleep for 10 seconds.
And then do that or do that for a cat also.
So you got a cat and a mouse chasing each other.
Um, and the question is really, do those run at the same time or one after another?
And in scratch, it just is each of these are, are their own thread, their own thing that's
running.
And there's no async and await here.
It just is there.
And, and I'm not saying that we should all go out and write our frameworks in scratch.
Now.
Um, I'm saying it's, it's an interesting idea to, to, to realize that it can be made easy.
Um, and I, I both agree and disagree in interesting ways here.
So I, I really like what Armin's been doing on his blog lately.
He's been writing some very thoughtful posts and has me shaking my head in agreement a lot.
So well done Armin.
However, I think some of the pushback, I have not read this.
So it's so easy on me, but I'd like to read it.
It's on my reading list.
But I think part of the pushback of, ah, async's having a bit of a, it's just not quite is I
think there's foundations of async that have not been built yet.
That should be built.
Like for example.
Uh, so you're this example here, create a function called move mouse, create a function called
move cat.
If this was async and this was C# and you called run, you wrote, you wrote that
code in C#, but the word async was applied to the functions.
Basically it would just run like it is like there's nothing left to do.
And async and await handles that.
But Python doesn't have the concept of a background management thing that runs all the async stuff
and keeps it going.
Right.
You've got to go to the loop and say, Hey loop, here's another thing to run.
Start this, please.
Whereas in a lot of other languages, you, the act of calling an async function coordinates
behind the scenes in ways you don't have to think about that.
Start and run that you're given a task of a, object of a running task that's already
been handled in something you pre-configured.
Whereas in Python, you're like, I know you think you ran it because it has parentheses like
a function, but now you've got to go find a place to actually run it.
And a lot of that, that finding the place is always janky.
It's like, Oh, asyncio dot get, get event loop exception.
No event loop.
Darn it.
I'll create one some other time.
Create event loop exception.
There's already event loop.
It's like, why, what is going on here?
Why am I always battling this?
Or I, there is a loop, but it's, I need to get to it from another thread and it's thread
local.
And I, I, how do I connect these two things through variables?
And I want to use globals.
Like there's just all this stuff that makes it tricky.
Whereas there could be a little infrastructure behind the scenes that just, I don't know if it's
just, I don't know if it might be, it's too late, which would be super unfortunate, but
it could be.
I think it can be built on top of it.
Yeah.
Maybe.
Anyway, I think that that is part of the problem is the challenge is like, it's, it's your job
to connect the pieces of the plumbing more than it should be.
That's what I think.
I've also used, so I've used a, this is in C++, but a concurrency framework that had,
the default is easy.
Like the, the generic, the, the, there is a general thread pool that it's easy to use,
easy to add things to.
It's just sort of happens.
And then there's, and then there's, if you want like a separate thread pool, that's
just managed separately.
There's more, more who can go and create it and put it in sort of connecting pieces.
Yeah.
So I think that's awesome.
Right.
Rather than you always have to do the hard way.
Yeah.
We need a, at least in for simpler cases, there is an easy way that exists.
And anyway, but I'm also kind of talking out of my hat because I haven't run, I haven't
written a lot of async Python yet.
Yeah.
I'll give you a really, really, really quickly to wrap the show up.
But in court, you've got, there's an async event loop managed by the web framework, or
maybe it's even managed by the, the app server that then starts the framework.
But there's a dedicated asyncio event loop for processing requests.
It doesn't exist until after all of your startup code is done.
And so if you have any async code to call before you're actually, you're, you're just like
everything set up, all of the things have been populated, run the start processing requests.
You basically almost can't do it.
If like, for example, so for the eight, for Beanie, you have to say, initialize the database
and get all the connections and stuff going.
So if you write code to do that and then try to use it in the, in a web view, in a web
request, it'll crash and say wrong event loop.
It was initialized on this event loop, but it's running on the court event loop.
And you're like, well, but how do I start it?
How do I ask a database question before the web request to start it?
You know, like I, maybe I want to do something different if the database is initialized or
not.
Or I, I want to, I don't know.
It's just like, there's all this juggling and there are mechanisms to say, okay, well,
like you can have some startup code run in a different time, but it's just, it's just
hard.
Yeah.
Anyway, I hope I keep harping on this.
I'm hoping someone will go like, okay, we're at the core developer language summit.
Can we simplify?
Okay.
Please.
Okay.
And then I got a few more, but I'll do them quick.
The, the Python test community is now on discord that the, the, the launch happened in a couple
of days last, last week.
And it's going well.
We've got like 89 people in there so far.
If you'd like to be a part of it and you're not already, if you, if you're part of the
community, you got, would have gotten an email.
If you want to be part of the community and you didn't get the email or you haven't bought
one of my stuff things before you can head over to courses.pythontest.com.
And you don't even need one of the courses.
You can just grab the discord community.
One it's there and it's on sale.
It and everything else on the site is on a, on a black Friday sale, 20% off using Turkey
sale 2024.
And that's just right on the side.
I'm posting that.
It's not a secret.
However, there is a secret on the book.
So Python testing with pytest is a 40% off right now.
And you, you just need to use the black Friday code, which is also the same code Turkey sale
2020.
I just wanted to be easy for people to remember.
So learn pytest easily through sales.
Test your thing.
Yeah.
Enjoy the turkeys.
Yeah.
And I'm, I'm having fun with discord.
I've had to have had to embrace the, the dancing logos and stuff.
And I, I know you can turn them off, but I'm actually realizing that I kind of like them
now.
These little doohickey things.
Yeah.
It's fun.
The little giffies or whatever.
Very funny.
Yeah.
Talk Python is going to also have a black Friday sale.
I don't have it launched yet, but that is my goal for the day.
So I'll put it in the show notes.
People can check it out.
I don't, I'm not a hundred percent on the final, final details,
but I'm finalizing that today.
I can't believe November's almost over.
What even?
Exactly.
This is my problem.
I do not accept that November is almost over, but Hey, it's, it's one, one month less of
rain for us.
We're closer to sun again.
So let's go.
Yeah.
All right.
Are you ready for a joke?
Yeah.
So this joke, just everyone, Brian has not seen or heard this.
This joke.
Remember we had the AI, the sad girls, AI sing song, sing the MIT license terms.
Yeah.
This is like this, but this is a heavy metal rock band singing the verbose output of a curl
command.
So if you say curl dash V for verbose, HTPS, Google.com, there's a whole bunch of stuff that
comes out, a bunch of tech things.
So we're going to have a heavy metal jam session of this.
And I want to point out one of your volume is high.
Turn it down to, if you really hate heavy metal, hard rock, just go ahead and stop here.
There's, we're not covering anything else.
I don't want to use it.
Seriously.
This is kind of like some intense rock, but it's also pretty funny.
And I would also like to add on the videos on YouTube, the video I'm linking to the, there's
a comment that says, hi, I'm the creator of curl.
And I wholeheartedly endorse this amazing, this masterpiece.
With that said, if you hate, if you hate hard rock, you're not going to love it.
So just go ahead and skip ahead.
Everyone.
Here we go.
DLS 1.3 in DLS Handshake Certificate DLS 1.3 in DLS Handshake Certify DLS 1.3 in DLS Handshake Sinist DLS 1.3 out DLS 800 take cyphers back DLS 1.3 out DLS Handshake Sinist
Well there you have it folks the actual real song is at three and a half minutes and I couldn't I
couldn't do it I couldn't play the whole thing for you so it's a taster hit the full show um I love it
DLS Handshake hello
nice all right everyone Brian see ya