Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 307, recorded October 26th, and I am Brian Okken.
Hey, I'm Michael Kennedy.
Yay. Well, it's pretty exciting here in Python world this week.
Oh, it's a big deal this week, absolutely.
It's a big deal. So tell us why it's a big deal.
We've talked about Python being faster and new features coming along.
But primarily, I would say there's like two ends of the spectrum that people have been really looking forward to.
One is, wouldn't it be great if you did nothing and your code ran 50% faster?
Brian, you and I are of similar age, and I remember it was just like, well, wait till next year till I get a new computer.
And that program that's a little sluggish is going to be zooming along, right?
And just like computers would just double in speed all the time.
And we don't get so much of that anymore.
But with Python, we kind of do this time around.
Yeah, I remember like also like adding more memory and trying to detect whether I could tell a difference for the $100 I spent.
Yes, exactly. Exactly. Or optimizing your low MIM versus high MIM.
I mean, that's going back always.
But the big news is Python 3.11 is out.
Woo!
Yay!
Yeah, that's...
We should have had like champagne or something.
Yeah.
Yeah, pop some corks.
So very big news.
I'm super excited about it.
I told you there's this end of the spectrum.
The other end of things that people seem to be psyched about across the board is better error messages.
Yeah.
I mean, it's very important for debugging and also for teaching people and learning Python.
Yeah, absolutely. Absolutely.
I got to pull this one up just for nostalgia's sake.
Dave in the audience says, back when we had turbo buttons, our computers, they literally had a button that said turbo.
I remember when I got my Pentium 90, it had a turbo button.
And I'm like, yes.
What it really meant is if it was off, it would run in like some weird retro slow modes.
I would like play MechWarrior.
And stuff would like zoom around insanely fast.
But if you took off turbo, you could play some of the older games because they weren't based on time.
They were based on frame rate.
Anyway, crazy, crazy memories.
So we're kind of getting that cool like doubling of speed thing here.
So there's a ton of stuff to talk about in terms of what's available here.
Before I get into the details, I want to point out on YouTube, which I'm linking to, Python Discord, Lemon over there, hosted a live stream of the release.
So this is not a party celebrating the release, but this is live broadcasting of the actions and the steps as it's being released.
Like, okay, the final one is built.
Okay, we pushed it to the Microsoft Store for Windows Store install.
Now we pushed it to, you know, Python.org.
Now it's over here.
And like, right, like the actual pushing of the deployment.
And there's a bunch of interesting things that happen there.
And along the way, they talk about some of the features.
I'm going to have a subset of the people that were there in apparently 46 hours on Friday on Talk Python to make an episode out of it there as well.
That's pretty cool.
It's neat that they do that.
Yeah.
So people can just watch the process.
Yeah, it is cool that they do that.
And I certainly, I saw a pop up and like, these guys are going live.
I'm like, oh, that's playing on the background while I'm working today.
You know, I'm going to be apparently at 80% capacity of like getting stuff done, but I'm going to enjoy it a lot.
Also, we have a logo, which is not the official Python logo, but a Python 311 logo.
And it has like little, it's like two snakes, but they're not the Python, you know, cartoon, dramatic, like sort of stylized snakes.
They just look like snakes.
And it says faster Python exception groups and accept star typing improvements.
And like literally the logo basically is the release notes.
But, and it has a lightning bolt in the middle.
I guess that means fast.
I think so.
All right.
So let's see.
Major new changes.
We've got fine grained error locations and tracebacks.
Let me see if I can get it to show us some interesting example here.
Yeah, this is super cool.
So check, there's a line.
If you just follow the PEP there, there's an example of, you know, suppose you're calling like a complicated JSON API and you get this data back and you start in a variable X.
And you've got to go to some field in the JSON document, then further down, then further down, and further down, and like either get or set a value.
So here it has X bracket of A, bracket of B, bracket of C, bracket of D.
So you're like diving from like level A, B, C, D in the JSON document.
If you get the error, none type is, or, you know, object is not subscriptable.
You know, something there was none.
Yeah, but you're four levels deep.
Which one was it?
Right.
It could have been B wasn't subscriptable, or it could have been C, or it could have been like, you don't know where.
And so what a hassle, right?
And you do print statements, and that's when you do debugging statements.
That's when you maybe make that four different lines so you see which line crashes.
Well, in 3.11 now it just says tilde, tilde, tilde, carat, carat, carat.
Look, it's, you had X of A of B of C.
It's C that was the none thing.
That's where the problem was.
Actually, I suspect that, yeah, I guess it's probably C.
We tried to get D out of none, and C was none is probably where the error was.
Yeah.
But it points like right where these problems are throughout there.
Yeah.
Really neat.
Plus a whole bunch of others.
Yeah, there's a bunch of other ways that they're highlighting where the problem is.
Yeah, if you go through, there's a bunch of cool examples here.
But basically, you end up with within complex expressions.
You know, multiple things happening on one line and so on.
You get nice details there.
Pretty cool.
So that's just one of them.
But I would say if you don't care about performance, that's probably what you might consider the highlight.
If you're an asyncio, async and await type person, async exception groups, PEP 564 and accept star are pretty interesting.
Because if I start three tasks and I wait on them and two of them have errors, well, which exception do I get?
Do I get the one from the first one or do I get the one from the second one?
So it would be great to be able to say two of the three things failed.
Here are their problems.
Right.
So you can kind of get a holistic view of what's happening.
That's great.
Yeah.
I'm actually, I'm actually, I still haven't got my head around this completely, but I'm curious to see how that this will change sort of Python style.
Because this changes how you can write exception handling.
Indeed.
Some of the higher level async frameworks like Trio and AnyIO have this concept of starting and managing a series of tasks together as a group.
So if I'm going to save and entry to the database, I'm going to call an API and I'm going to create a file.
And those are all the, all a result of like, I want to create a new user.
I want to do whatever.
Right.
You might want to be able to say, I want to start all those and wait for them to finish.
Or if I start a couple of them to decide I want to bail out, cancel all of them or if one fails and so on.
So we've got this concept of a task group in AsyncIO and changes to the task cancellation semantics.
And it's interesting.
We've got, you know, PEP 657 was the traceback enhancements.
654 was the exception groups.
But the task groups is GH 90908.
Interesting.
You know what GH stands for?
GitHub.
Okay.
Weird.
So it's news to me that this, these features get added through just a GitHub issue rather than a proper, you know, PEP.
But anyway, yeah.
Pretty neat.
Maybe you're pronouncing GH as P.
Yeah.
Like it.
Exactly.
Let's see.
Henry has some cool comments following up out there.
Henry Schreiner.
Thanks.
Catters is already using exception groups via backport exception group.
It is fantastic and really does change Python exceptions.
Cool.
Extra information there.
All right.
Let's keep going.
You've already talked about TomlLib being built in.
Like now that we have pyproject.toml.
Should we really have external libraries in order to understand them?
Yay.
Now we, now we get to do the, the if block.
If, if, if import TomlLib or, you know, the try except around it.
Because.
Exactly.
How fun.
Yeah.
It is a good thing though.
I'm glad for that.
Yep.
There's changes to regular expressions.
If you care, you know.
All right.
And then we've got basically a general statement saying the faster CPython project is already
yielding some exciting results.
That is Mark Shannon, Gita Van Rossum, and a bunch of other folks, Grant and others, all
working on this.
And it says already yielding some exciting results.
Python 3.11 is up 10 to 60% faster than just 3.10.
That is just from last year.
Right?
Hence the turbo button.
On average, we measured a 1.22 or otherwise known as 22% feed up on the benchmarks for Python
tests.
So, or Python benchmarks.
That's awesome.
You can see faster Python for details, right?
There's already some of those we're making to 3.10.
3.11 is getting more.
3.12 is getting more.
And it's, yeah, it's just a first down payment, I guess.
But it's really great to see that happening.
Yeah.
Pretty exciting.
A bunch of stuff around typing.
Those are a lot of the other highlights there.
Two things that are worth calling out here, I would say.
One is self.
It's good to be self-aware, right, Brian?
Yeah.
It is.
And so, Python classes can now understand that they too have a self, even though they
say self all over the place.
Like, no, their language, right?
Like, this in C++ and C# is a thing you can, but not must use, or you've got to say
self.
So, ironically, the typing system now also understands self.
And you can say, well, the problem was before, if I'm in a class and I have a method of that
class that returns an instance of that class, the class is not yet defined as far as Python's
concerned until you're to the end.
So, I can't say the return type is the name of the class, because until you're done, the
class is not defined, right?
It's like this weird error.
So, what you can say is it returns self.
And whatever self is, that's what it returns.
And one of the changes and difficulties was to make this work with inheritance.
Yeah.
I mean, like in C or in C++, you have to pre-declare the type ahead of time.
But then, yeah, anyway.
We don't have declarations in Python, so.
We don't.
I wonder why we don't have a two-pass compiler that like scans for types and then expands
out the details.
Do you know what variadic generics are?
Putting you on the spot.
Sorry.
You are putting me on the spot.
Let's see.
I just want to use that word more often.
I know.
It sounds like.
Yes, I do have a PhD in computer science.
It enables the creation of generics parametrized with a single type.
So this is something I don't do much of in Python types.
You can create a type variable that then defines the type of a thing and then use that variable.
It's kind of like templates a little bit.
And so this has to do with that.
Okay.
I don't think I'm smart enough to use this.
If you look at the example, you say I created an axis one is like a type.
And then I can say I have an array, which is of type, you know, of generic, of axis one,
axis one, right?
Like, I don't know.
I kind of left that kind of stuff behind in C++, like the multiple template.
Oh, good.
Somebody's helping us out.
Dean is saying, when I learned about generic, I thought maybe we've gone too far with typing.
Thanks, dude.
You know, one thing that's nice about Python is often you don't have to know or care or consume certain parts.
You know what?
That doesn't apply to me yet.
Maybe someday.
Not right now.
There's other stuff, of course.
The last one I think is noteworthy has to do with limiting the spread of little Bobby tables, let's say.
And these are arbitrary literal string types.
So the idea is if you've got, say, like a SQL query, it would be great to somehow define,
here's a string that I want to put into code, but I don't want to, it's kind of like a static string in a sense.
Like it can't be modified or added against non-literal strings.
So the example says, look, I've got select star from data where user ID equals F string curly user ID.
And if you say user 123, good.
Good.
But you also might say user 123, semicolon, drop table, data, semicolon.
Or you could do, you want to get all the records, you say user 123 or one equals one.
Right?
Like these are bad.
So what you can do with these now is you can come up with literal strings and they, in order to make the query work, you have to use database parameters.
You just put like a placeholder in the string that never changes.
And that way, basically your string in a sense is safe from injection.
Okay.
Yeah.
But you can still, you still can pass parameters in, but you just have to do it a different way.
Right.
And so in this example, they have select, select user.name, user.age from data where user ID is question mark.
That's the indicator of a SQL parameter.
And then you say connection execute given that string.
And then you pass the parameter, which has the value of the user ID.
And then the database engine knows like that can't like truncate a statement.
Right.
It can't sort of modify the command you send.
What's notable though, is you can also add on things and you can change it and combine it with other literal strings, but not with non-literal strings.
Okay.
Interesting.
Yeah.
That's what this literal string type is here.
And yeah.
Anyway, so people can check that out.
I think that's, you know, that's going to be useful in a lot of situations where you're trying to be safe with user input, basically.
Yeah.
All right.
Is that it?
I think that might be all the highlights.
Yeah.
There's a go, go get your version.
I've already brew installed my 3.11, which is cool.
You brew installed.
Okay.
I did.
Now, if you just say brew install Python 3, you'll get 3.10, 7, I think, or 8.
You won't get 3.11.
But you can brew install Python.
I think it's at 3.11 or at 3.11.
You'll have to look.
I don't remember the exact command.
But there's a way to say, no, I want the cutting edge version.
And I was already, final thought on this.
I was already given a small cut by it.
You were.
I was.
So, you know, I was.
The Python bytes.
Python bytes website is based on Beanie, the MongoDB, Pydantic combo of glory.
Because it's all async.
It's based on motor.
The async driver for Python and MongoDB from the MongoDB folks.
They built that thing in the super early days before async and await was a thing based on
tornado.
So, they don't use async def for their async functions.
They put at async.io.coroutine as a decorator onto all their async functions.
Well, that was awesome until 3.11 where that was removed from the runtime.
So, that doesn't work anymore.
And it doesn't run so well either.
So, the motor people had to rush out 3.11 yesterday after much conversation of like,
you guys realize you should have tested on 3.11 beta or RC1 or RC2 or any other release
at some point because clearly this code was never going to run and you should have known
straight away.
But at least they fixed it quickly.
Okay.
So, Henry wants to know, how did you find it?
Apparently, it's on unmerged PR.
Perhaps.
I just did brew update, brew outdated.
And it said new recipe or new whatever they call it.
Whatever it calls those things.
It said new recipe, Python 3.11.
I said, oh, cool.
Then I'll install Python 3.11.
Okay.
Yeah, that's how I know.
So, I want to stick with this install thing a little bit.
Yeah.
Because I would think that you're probably a power user.
I mean, kind of.
You know Python pretty much and you're doing, trying to be cutting edge and everything.
I think that a lot of Python bloggers and social media people that are famous in Python
are probably the power user kind of people.
And they tell people weird things, I think.
Like brew install Python 3.11.
Just brew install.
And I don't think it's a good idea.
Yeah.
I'm going to get on the soapbox a little bit and say, I wrote an article on how to install Python.
And it's installing Python 3.11 on Mac or Windows.
And we'll get to Linux in a bit.
So, the gist is, you go to python.org, you hover over downloads, and you click download.
And then the thing that gets installed, you install it.
Now you're done.
Okay.
So, why did this deserve an entire article?
Well, because I think a lot of people are teaching people to do, like saying, just brew install it.
Or do PyInv.
And PyInv, anyway, we'll get to there.
But so, I just want to tell people how long does it take?
It takes about a minute.
I timed it on both my Mac and did it on a Windows machine.
And just installing everything takes, yeah, it took about a minute.
A minute and 13 seconds on my Mac.
And this is including me having to hit stuff.
So, it's also my delay.
And then also did it, on Windows, it took like twice as long.
But I was tunneled through a VPN and firewalls and stuff.
So, it's probably all that.
It's pretty fast.
You can have, and it doesn't uninstall anything.
So, you can have multiple versions.
So, it will, like if you use that sort of download link for like the latest, like 310.8, it'll go over the top of 310.7, I think.
At least on Mac, it does that.
But that's okay.
It's kind of what I want.
I've got 310.
You can have multiple.
I've got 310, 3.7, 3.11 all on my machine just with those links.
And the 3.11 just is the default.
I think it's the newest one and the oldest.
Anyway, it modifies the Z profile, your .Z profile.
And it shows up as the latest one.
Now, if I had 310 before, what if I go back and install the update my 310?
Will it make 310 the default?
No, it doesn't.
It leaves it alone because it was already in there.
It leaves it be.
But you should check anyway if you're going to go back and install old versions.
And Tox works just great with it.
So why am I kind of ranting on this is because a lot of people try to say homebrew.
And if you're a homebrew user, you're not going to look for this blog anyway.
You're just going to try to do it with homebrew.
Great.
Go for it.
You're perfect.
And PyEnv, I think there's some places for it.
But PyEnv is about managing different versions and having multiple live at the same time and
different projects use different ones.
It's not just an easy installer.
And since it does all that other stuff, I don't think people should recommend it for newbies.
It's not the right tool for somebody new to Python.
I think it's just going to confuse the heck out of people.
So that said, I walked through the whole thing in this article.
But I also admit that it's Mac focused.
But on the Windows, I did a little blurb on Windows too.
The thing I want to tell people that I sometimes forget on the Windows install is go slow when
you're clicking through everything so that you can select the advanced features.
And you probably want add Python to environmental variables.
That makes it so that just shows up in your path.
Because you can add that to your path manually or you can let the installer do it.
And I like to have the installer do it.
So that's my rant.
I think that for most people, just use the default installer.
Yeah, I think that's totally good advice.
Let's see here real quick.
I also did that the other day before it came out in Peru.
I'm like, let me just put it over here and see.
I wanted to test some things.
And I had 3.11.
And they were both totally content next to each other from those installers.
I just decided to take 3.9 out because I didn't really need that.
I've got it from homebrew as well already.
But they do coexist.
It's fine.
And here's what the brew statement is.
It's new formulae.
And it's Python at 3.11 is what you can expect.
Okay.
Nice.
Yeah.
And as for Linux people, I think it's sort of funny that people try to tell
how to install Python articles, talk about Linux stuff.
Linux people already know how to install their stuff, don't they?
I mean.
Yes.
But although it's more complicated because Python's broken into a bunch of pieces.
You want Python?
Or do you want the Python dev bit?
Or do you need the build essentials?
Or like there's a lot of like, do you need Python 3-V and V?
Because you want to create a, like, the virtual environments don't come with Python
when you apt install it, which is like, what?
Okay.
But they do on Mac and Windows.
Yes, exactly.
At least the error message is, you don't have this.
Should you apt install Python 3-V and V?
Yes, I should.
Let me copy and paste.
Hold on.
Yeah.
Okay.
All right.
I see Roman out in the audience there.
Roman, I've got some shout outs for you in a little bit.
And in the past, if you weren't here.
But before we get to those, I want to tell you about this week's sponsor,
Microsoft Founders Hub.
Microsoft for Startups Founders Hub.
Has, they have been recently big supporters of the show.
We really appreciate it.
And if you're out there either starting a business or want to start a business,
got to know that it's, it's not easy, right?
Within the first year, 90% of startups go out of business.
That's not amazing.
So the folks over at Microsoft for Startups set out to understand what are the problems
that people are running into and how could they help?
So they came up with Microsoft for Startups Founders Hub.
And the idea is that you get at any stage of your startup free resources to grow and thrive.
So you get thousands of dollars of cloud credits for things like Azure and GitHub and DeepMind.
So look, OpenAI, sorry.
For those types of things.
And as your startup grows and progresses, you get many, many more of those.
But you also get support in the form of mentorship and connections.
Brian, you're not in Silicon Valley, are you?
No.
Neither am I.
By choice, by the way.
And most people out there listening are not either.
But having the connections of like, hey, let's meet up with so-and-so for coffee and talk
about this new project and see if there's a connection there, right?
Like those, those kinds of things are incredibly powerful.
And they've given people in locations like that huge advantages.
So the other thing you get with this is access to a mentorship network, the ability to book
one-on-ones with meetings, one-on-one meetings with mentors, many of whom are founders themselves.
You can talk about things like marketing or fundraising or whatever you need.
So if you want to get started, make your dream, your company a reality today with the critical
support you get from Microsoft for Startups Founders Hub.
You don't have to be third-party validated.
You don't have to be venture-backed or part of some kind of accelerator.
Just go and apply for free.
PythonBuy.fm slash Founders Hub 2022.
Link is in your show notes.
Check them out.
Very cool program.
Very cool.
Indeed.
All right.
Ready for some awards?
Got the red carpet out.
The champagne.
More champagne.
There's some kind of theme with that here.
Celebration.
Yes.
Let's talk about the Bossies.
So the Bossies, this is InfoWorld's 2022 Bossie Awards.
Celebrate the most important and innovative solution for application developments, DevOps, analytics,
and what year.
So let's go.
These are open source.
Best open source software.
I was like, where does Boss come from?
Okay.
Exactly.
There's a bunch that are interesting, but we'll go through.
You can't go through very fast.
There's like a delay.
Yeah, I guess.
So you pay attention and you actually take it in.
So maybe really quick, just because it's the first one, is there's Alma Linux, which is a free Linux OS for the community, by the community, that is like an enterprise Linux distribution focused on stability.
So that might be cool checking out.
I know a lot of people do things there.
You have to bear with me as I make my way through this thing, is it won't let me go any faster.
Well, let's do the first one.
There's a lot of Java in here, actually, which we'll get back to in a joke later.
That'll be fun.
Like Jhipster.
I mean, greetings, Java hipster.
That's a pretty awesome project.
Java hipster.
That seems sort of anachronistic.
You know, you got to, this is part of that self-talk thing where you like try to talk yourself up a little.
All right.
Maybe number one that I want to give a shout out to, number one, as in number 10 in the list, is WASM time.
A fast and secure runtime for WebAssembly outside of the browser.
So if you think about what Node.js did for JavaScript, like JavaScript used to be this thing you did on web front ends.
And then somebody said, if we rip that engine out, it could be a server-side technology or a client-side technology that is not in a browser at all.
But just, it becomes a programming language, as long as we have a runtime that everyone likes and works with.
Well, this is like that, but for WebAssembly, right?
And so what's interesting is if you want to go and run a Python code and you don't want to worry about making sure Python is set up and all those things, you could just get, say, something like PyScript and ship it to run on top of WASM time.
And there you go.
So you just say WASM time and then some WASM output, which could be, you know, your code.
And let's see if they have over here on PyPI, we have WASM time 2.0, which is the Python embedding of WASM time.
So there you go.
Take your Python code and off it goes.
That's pretty cool.
So, Michael, what time is it?
It's WASM time.
It's WASM.
I'm like, wait, what?
It's WASM time.
It is.
Oh, awesome.
Yeah, so you just write your code in Python and then you could go and run it, which would be pretty excellent.
Also, something interesting about WASM is it allows for interoperability.
So if I wanted to do C, .NET, Python, and Rust, have those all talk together because, I don't know, I couldn't decide or I don't know, whatever reason, right?
You could have them all converted to WASM and then integrate there as well.
So there's some pretty interesting runtime and deployment things here.
Anyway, so that was one of the winners.
Right behind it, one of the biggest winners in our world has got to be PyScript, right?
Yeah.
Let's go look at it on the list.
Yeah, it is.
There's a bunch of stuff here that I don't care about.
But number 14, Sentry.
Nice.
Error monitoring.
I was just using this to track down some errors that I introduced with trying to run Python 3.11 and Beanie before it was time.
But it told me exactly what was going on and I figured, okay, that's a motor problem.
I was able to track that down, which is pretty excellent.
Let's see a few more here that are fun.
In BDEV, if you're doing notebook stuff and you want to be able to test your notebooks or clean them up before you check them in, or you want to turn notebooks into a Python package where certain actions in a cell become functions in your Python package and deploy it to PyBI.
All those crazy things in BDEV.
So those are pretty interesting.
Accelerate.
I think this is from Hugging Face, but I can't quite tell.
Yeah, it is Hugging Face.
That's what it is.
It's a way to build, train, and deploy state-of-the-art models powered by open source.
Yeah.
So anyway, it looks interesting if you're into that.
Stable diffusion.
Do you need to have a bear that has just landed on the moon?
Well, go in there.
You can create those funky AI art things.
Anyway, there's a bunch of fun projects in this 2022 Bossies Award list.
Yeah, that's pretty great.
Yep.
All right.
Yeah.
Well, Scott, it's wasm time.
It's wasm time.
Yeah.
We talk about Will McCoogan a lot and textural and stuff.
And Will's in the audience.
Hey, Will.
So one of the things that if you follow Will on Twitter, he shows a whole bunch of cool
examples of stuff he's working on, but you haven't been able to play with it because he's
been sneaky about it.
And it's been on a, well, it's not sneaky, but it's been on a CSS branch, different branch
of their code base on textualize or textual.
So now we can play with it because as of what, October 22nd, textual 0.2.0.
Wow.
Big jump in numbers there, guys.
But it released and it has all of the CSS branch stuff merged in.
So all the really cool, fun things that you can do that looked like web development and,
but they're in a CLI.
Now I can start playing with them because they merged in.
One of the things that I'm glad that they waited a little while for because they were looking
for API stability, but also they wanted to finalize the documentation at the same time
before they released it to everybody officially.
So they've got a tutorial written, which is really kind of nice.
It's a little stopwatch application that kind of walks through and it walks through all the
different pieces of, of how you, how you use textualize and with their CSS.
And it's got going through writing through the CSS, the dynamicness of it, reactive attributes.
This, this really looks great.
I haven't gone through it yet, but it looks awesome.
And then, and then they went through and updated the textualize guide, which has, you know, it goes,
goes through all the different examples.
And I've got my screen shrink up too far, so it doesn't show everything.
But anyway, really great stuff in this, in this, this manual.
Good job guys.
Yeah, that looks awesome.
So I can't wait to play with it.
Yeah.
Who knew that we could treat, treat terminals as high refresh rate, general rendering engines.
It's, I feel like the stuff that Will and crew are highlighting here is a little bit like
what you could do with JavaScript canvases, right?
You're like, oh, guess what you could actually do, which is, you know,
like our software here, StreamYard, that we're using to live stream this, right?
It's like, who would have ever thought you could have done this with just a web browser
without plugins, right?
And here we are.
And I also just heard Will talking about this on ChangeLog just recently.
One of the more recent ChangeLogs was talking about this release, which is pretty cool.
Although, Will, I got to say I'm a little disappointed.
Because they asked how you became rich and textual have gained so much popularity so quickly.
And you didn't even mention us.
Just come on.
Anyway.
Cool.
Anyway, that's it for our items.
And since I've been kind of under the weather, I don't have any extras.
Do you have any extras for us?
You know that I do.
I've got a bunch of things.
I'll go quick through them.
So I recently did a fun video.
I know that guy.
Yeah.
I did a video where I added, I did the live coding on Talk Python Training, actually adding
the feature for the search over here.
So I rewrote the search.
You pointed out that pytest is a fun thing to type in there, right?
pytest is good.
You might search for Postman, Ingrok, and you get your search results there.
Got this cool hierarchy thing.
But when I first wrote that, it was super slow.
And the techniques that I used to debug that, figure out what's going on, make it faster.
The video says 17, but in an extreme case, it was actually 80 times faster.
There's just some really cool techniques of walking through like, oh, how could you like
use logging in the database to figure out what's happening?
How could you use the profiling?
How do we use dictionaries so that we can convert like 100 database calls into one, even though
there's like a, not a natural join story going on.
So if people want to follow, go check out that video.
That's lots of fun in the show notes.
From, let me get the name right here.
Also from Ryan Scheftel.
If you're into stock markets and so on and you want to use Pandas, here's a project called
Pandas Market Calendars.
It's the market calendars used with Pandas for trading applications.
So it has things like, when are the markets opening and closing?
Is there a holiday?
Is there some other weird event that's changing the start to close time?
Right.
So just a cool little library to bring that into your Pandas code.
And I believe Pandas came out of New York and the whole trading industry over there.
So that's good.
Shout out for Roman Wright, who is out in the audience.
Hey, Roman.
We recently, so when Beanie came out, Beanie's fantastic.
MongoDB library, you know, what FastAPI did for APIs, Beanie does for MongoDB, right?
It takes Pydantic and turns it into a really cool API that then you use instead of creating
just classes or whatever, right?
So all the benefits of having Pydantic plus MongoDB.
And when it came out, it was only async, which is awesome when you're doing async stuff,
right?
Without it, you can't do all the really high scale, high concurrency things.
But there's plenty of times where you're like, I don't want that.
I just want to call this function.
And I'm in the middle of a script that has no business being async, but you gave me an
async only function.
So now I got to figure out how to like spin up a loop and run this thing and wait for it
when I just want to call the function.
So in addition to the standard async model, Roman added a Beanie.sync submodule where you
can get async document and you get a, you can initialize a synchronous database,
connection.
And then all of your queries and everything become just straight up synchronous calls,
like on more traditional database engines or database ORMs, ODMs.
Okay.
Yeah.
So excellent work out there.
It's a good job keeping up on that.
It's a cool product.
Yeah.
It's super cool.
Yeah.
I love it.
DuckDuckGo has released a web browser.
Just when you thought Chrome has taken over everything, DuckDuckGo says no, or they quacked
no, or whatever DuckDuck does when they communicate.
And right now it's Mac only, but it's coming out for Windows pretty soon as well.
And it's a privacy focused database.
Web browser.
Yeah.
Yes.
Sorry.
I said database.
Yeah.
Web browser.
But let me, let me show you.
I can even show you real quick.
Here it is.
But did you install it?
Oh, of course I did.
Why wouldn't I do that?
Here it is.
So we go over here.
We can go to pythonbytes.fm.
And if you pull this up, why not?
Didn't add to stream.
There we go.
But come over here to Python Bytes.
And you can click on this.
It'll show you where all the tracking is.
Like notice, no Google Analytics, no other tracking.
But where shall we go?
We have somewhere super egregious.
We could go to CNN.com.
And remember, this is using already NextDNS and other blocking.
So a lot of the blocking happens before it gets here.
But if you pull it up, it'll still say, look at all these different things we blocked.
And here's the tracking.
Here's the advertising.
Again, many of these are already blocked before it gets to the network.
So it'd be 30 or 40 easy.
So that's pretty cool.
But I don't know.
I'm not switching over to it yet.
Hopefully they can do better.
You can't do things like set your DNS servers for, say, DNS over HTTPS.
So you can have more control over that.
There's a lot of things that are not there.
It has a really cool way to play YouTube videos in a private window.
So if you go over to YouTube and you hit play, it'll, would you like to play this in a non-tracking,
non-algorithmic feeding sort of way?
Which is great.
But you know what you have over on YouTube?
Hotkeys.
I can type F for full screen or T to like go wide theater mode or I for mini player.
It doesn't have any of those types of things.
Right.
And so it's like super, super early.
But in that regard, I'm not really liked or recommending it.
But it's awesome that they're trying.
I like DuckDuckGo.
I'd like to see them make progress here.
And they have the fire button, which you can just clear all the stuff up and get a cool animation.
What does that do?
Just close it up?
It erases like all history and closes all tabs and everything.
Oh, cool.
Yeah.
Anyway, there you go.
I think I've got one more thing to share, but I've got to share my screen back because of that.
Nabbed it.
Yeah.
Last one here before we get to a joke.
So I want to give credit here.
This one comes from Will Shanks.
Remember when we talked about int, like I-N-T parentheses, some string, like quote, one, two, three, close quote.
Okay.
That had a security patch in Python 3.10.7 because if you send it right, malicious, huge number string, it can get into like some denial of service where it like works for an insane amount of time trying to figure out what that number is by parsing it.
Not just a big number, but like a specifically bad big number, I think was the problem.
So in 3.10.7, they said, you know what?
We're going to limit the size of int to, I don't know, like 94 with 100 zeros or something after it, right?
At the time, you and I spoke about, remember when we did C and C++ and C# and we had to think about shorts and, you know, 32-bit integers and 64-bit integers?
And would it be bigger or smaller than 32,000?
Do we need to worry?
And like that number is so huge, like we probably don't think about it.
Well, some people do, in particular, the scientific folks.
So over on CondoForge, there's a big conversation about what to do here.
Like, should we adopt this?
Should we say this is like too much of a problem?
I mean, I don't really know how they're going to avoid eventually adopting it.
Because like every version of Python going forward is going to have this in it, right?
They don't want to eventually like permanently be held back.
But on the other side, the, what's it, Ubuntu?
Let me look.
Yeah, Ubuntu has decided to patch out that int limit.
So basically unravel that security fix and preserve the behavior, previous behavior, thinking that the risk is low of getting an integer like that.
And it's not worth breaking compatibility for.
Okay.
So apparently, int, open parenthesis, string, close parenthesis is still controversial.
Who knew?
Not me.
Yeah.
Not me.
Yeah.
All right.
Let's see.
Robert Robertson asks, in Python Bytes episode 311, is that going to be a special episode covering Python 311?
I don't know, but we got five weeks to figure it out and it's a great idea, Robert.
Thank you.
Sure.
Good idea.
I didn't see that coming.
Yeah, we should have coordinated with the Python folks.
We could have just released like five really short episodes.
Like, still waiting.
No, skip to the next one.
All right.
Well, that's all I got.
That's all I got for extras.
Well, one of the things I want to extra from the audience.
is Dean Langs.
I did a T-L-V.
Tel Aviv.
It's on December 13th.
And they have tickets.
They have tickets up for sale.
And there's a code.
So if you use discount code BYTES, you get a discount, I guess.
So that's nice.
Awesome.
Yeah.
Good luck with the conference there, Dean.
And how about-
Lovely city to visit if you get a chance to.
Okay.
Cool.
How about something funny?
Yes.
All right.
Besides my voice.
Here we go.
See if I can open the image.
It's own glorious.
So, Brian, I was thinking about getting a new monitor.
I have a fine monitor.
It's like a 32-inch 4K monitor.
But I want something kind of widescreen.
There was this cool, like, horizontal resolution equivalent in 4K.
But it was 40.
It was either 40 or 49 inches wide.
It was epic.
But I didn't get it.
So I didn't get it because I thought the curved monitor might be like parabolic echoes
for all the work that we do here.
And I also didn't get it because, well, it's expensive.
And I don't know if I can get it into the resolutions I want for recordings and things like that.
But here's somebody who posted a picture.
It says, develop in Java, be like.
And it's got, I think, that's a 49-inch curved widescreen monitor.
Small font.
And it's edge to edge code.
There's no PEP 8 ideas on this, right?
Look at that.
Is that nuts?
That is nuts.
Yeah.
And the subtitles be like, I heard you like getters.
Which apparently, you know, no properties and all that.
Yeah.
But anyway, I just thought you all might enjoy just checking out this picture of an insane
bit of code.
Like, something's gone wrong.
When you need, you actually need the full width of a 49-inch monitor.
I was thinking of putting a couple windows side by side.
I don't know.
Call me crazy.
I didn't have measured mine.
I think mine's like, I'll have to measure it.
I think it's like 30-something.
I don't know.
But it's got a bit of a curve.
Nice.
I have to.
I, it's painful to watch that.
And I'm not going to throw rocks at this glass house because I'm a C++ developer.
And we've got a few pieces of gnarly code that have big long lines.
Yeah.
For the multiple inheritance, multiple template.
Oh, yeah.
And also just bad naming sometimes.
And that happens in Java too.
You've got big long names.
Well, the problem is you've got to get a name something.
And then you've got to have a factory something.
And you've got to have an iFactory interface of that something.
And you've got to mock it out.
Anyway, it gets complicated and the names get long.
I understand.
And you have to get a mock factory and a name factory and a factory factory.
That's right.
If it's not, the audience has identified the coding style here as a PEP infinity instead of PEP 8.
That's PEP infinity code.
PEP infinity.
Yeah.
Well, this was infinitely fun.
Thank you, Brian.
And thanks, everyone, for being here.
Thank you.
I'll talk to you later.