WEBVTT

00:00:00.001 --> 00:00:04.780
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:00:04.780 --> 00:00:12.640
This is episode 345, recorded July 26th. Is that right? July 26th, 2023. I am Brian Okken.

00:00:12.640 --> 00:00:13.900
I'm Michael Kennedy.

00:00:13.900 --> 00:00:19.360
And you know, 345 episodes, you'd think I wouldn't have to read that, but I still do because I messed up.

00:00:19.360 --> 00:00:23.700
Anyway, a lot of fun topics today.

00:00:23.700 --> 00:00:26.980
Our sponsors today are us.

00:00:27.600 --> 00:00:30.200
The courses that Talk Python Training, we'll talk about those.

00:00:30.200 --> 00:00:34.320
And the new Python People podcast and our Patreon supporters, of course.

00:00:34.320 --> 00:00:36.920
Thank you, everybody, for continuing to support us.

00:00:36.920 --> 00:00:48.480
And everybody that's listening to this, usually, so this is a Wednesday morning, but usually it's Tuesday at 11 Pacific is when we're recording.

00:00:48.480 --> 00:00:52.180
And if you are around at that time, we'd love to have you join the show.

00:00:52.320 --> 00:00:58.140
Just go to pythonbytes.fm/live, and you can see when the next episode is going to get recorded.

00:00:58.140 --> 00:01:00.120
Yeah, Brian, I usually try to.

00:01:00.120 --> 00:01:01.360
I'm not always successful.

00:01:01.360 --> 00:01:03.160
Also, sometimes I just don't know.

00:01:03.160 --> 00:01:09.100
I usually try to schedule the next live stream soon as we're done with this one.

00:01:09.100 --> 00:01:09.520
Yeah.

00:01:09.680 --> 00:01:15.960
And so if you go to YouTube, you can click notify me for just that event if you want to come to the next week's one or something.

00:01:15.960 --> 00:01:19.000
So that's kind of the best way to know when the next live stream is.

00:01:19.000 --> 00:01:19.560
Yeah.

00:01:19.560 --> 00:01:20.020
Yeah.

00:01:20.020 --> 00:01:23.120
And I appreciate people to show up and add comments.

00:01:23.120 --> 00:01:23.600
It's nice.

00:01:23.600 --> 00:01:26.620
So, Michael, why don't you kick us off with the first topic?

00:01:26.620 --> 00:01:27.540
Yes, indeed.

00:01:27.540 --> 00:01:29.300
This is a very, very exciting one.

00:01:29.300 --> 00:01:36.480
So the next topic, the first topic is the third version of Cython, not CPython.

00:01:36.480 --> 00:01:38.720
I didn't drop a P on accident.

00:01:38.720 --> 00:01:39.240
Cython.

00:01:39.240 --> 00:01:46.080
Many people know what Cython is, but I suspect sufficiently many don't that it justifies me saying what the heck it is.

00:01:46.080 --> 00:01:50.000
So Cython, let's do a throwback, Brian.

00:01:50.000 --> 00:01:50.700
This will be fun.

00:01:51.400 --> 00:01:53.220
You've done plenty of C.

00:01:53.220 --> 00:02:00.220
Do you remember inline assembler when like little sections of C code had to be like really close to the metal?

00:02:00.220 --> 00:02:09.800
And so you would write like a little bit of assembly inside of a C function or make a function in assembly and call it something crazy like that.

00:02:09.800 --> 00:02:11.000
We're talking like 90s.

00:02:11.000 --> 00:02:11.440
Yeah.

00:02:11.440 --> 00:02:13.560
Well, Cython is kind of like that for Python.

00:02:13.560 --> 00:02:26.760
If you've got some part of your code that's not fast enough, well, one of the options is to do what a lot of people are doing is go like, well, I'm going to go learn Rust and I'm going to write this section in Rust and then I'm going to import it into Python.

00:02:26.760 --> 00:02:30.140
And there are certainly tools for doing so.

00:02:30.140 --> 00:02:35.100
But what if you could write Python and make it as fast as C almost?

00:02:35.100 --> 00:02:36.500
And that's what Cython is.

00:02:36.500 --> 00:02:49.640
And it's kind of like this inline bit, like this function or this module, I need to be in closer to C speed farther from Python speed, especially in the math type of scenario.

00:02:49.640 --> 00:02:51.600
So that's what Cython is.

00:02:51.600 --> 00:02:59.640
It lets you write Python code that gets compiled to C and use very, very slight variations in the Python syntax.

00:02:59.640 --> 00:03:01.500
It used to be way different.

00:03:01.500 --> 00:03:05.640
You'd have to have your own types and they were imported from Cython.

00:03:06.380 --> 00:03:17.820
So instead of having a traditional PyObject derived integer type, you would actually have a Cython int, which was like a local int, and you would express that in different ways.

00:03:17.820 --> 00:03:29.720
And they've been moving towards what they call pure Python mode, where the code that you write for Cython is actually still valid Python if you wanted to just run it that way.

00:03:29.720 --> 00:03:30.840
And that's pretty cool, right?

00:03:30.840 --> 00:03:31.380
Yeah.

00:03:31.380 --> 00:03:33.280
That involves things like type int.

00:03:33.360 --> 00:03:40.840
So if you want to say, oh, here's a thing that's an int, instead of importing some specialized int type from Cython, you would just say x colon int.

00:03:40.840 --> 00:03:41.760
And guess what?

00:03:41.760 --> 00:03:43.640
That's how it works in modern Python.

00:03:43.640 --> 00:03:47.840
So the news for this week is that Cython goes 3.0.

00:03:47.840 --> 00:03:52.180
And this news comes to us from, let's see.

00:03:52.180 --> 00:03:54.960
Oh, no, I ran across this with other ones sent over.

00:03:54.960 --> 00:03:57.000
They're both new releases with lots of details.

00:03:57.000 --> 00:03:57.420
So sorry.

00:03:57.420 --> 00:03:57.860
Yeah.

00:03:57.860 --> 00:04:01.380
So anyway, this one, the headline here is this is long in development.

00:04:01.380 --> 00:04:03.240
That's in like five years.

00:04:03.240 --> 00:04:04.500
It's been working on this.

00:04:04.500 --> 00:04:08.000
And so it sheds legacy Python support.

00:04:08.000 --> 00:04:09.560
That is Python 2.

00:04:09.560 --> 00:04:11.540
Look, see that legacy Python.

00:04:11.540 --> 00:04:14.380
People are starting to adopt our term.

00:04:14.380 --> 00:04:19.320
I don't know if we have anything to do with it, but we should have tried to popularize that view of Python 2, didn't we?

00:04:19.320 --> 00:04:19.760
Yep.

00:04:20.120 --> 00:04:25.080
And it has a lot of boost for this pure Python mode that I talked about.

00:04:25.080 --> 00:04:30.900
So you might say, okay, well, that's interesting that you have this pure Python mode, but why would I really care?

00:04:30.900 --> 00:04:35.360
Because if the goal is to make it faster, I don't want to run it in pure Python.

00:04:35.360 --> 00:04:37.660
I want to run it in Cython.

00:04:37.660 --> 00:04:42.900
So compile it to see and then, you know, behind the scenes is part of your building of the wheel and all that.

00:04:42.900 --> 00:04:43.320
Yeah.

00:04:43.320 --> 00:04:58.340
The reason you might want to do that is what if you care about mypy or you care about Rough or you care about Black or all these other tools that are Python tooling to understand the Python code or even PyCharm or VS Code.

00:04:58.340 --> 00:04:58.740
Right.

00:04:58.740 --> 00:05:03.000
You want it to look at that and be able to lint it and format it and understand it.

00:05:03.000 --> 00:05:03.400
Right.

00:05:03.400 --> 00:05:08.180
So the pure Python mode allows you to do things like keep your linting tools.

00:05:08.180 --> 00:05:08.460
Right.

00:05:08.660 --> 00:05:20.740
So yeah, and also just there's been discussions basically that if we had type hints when Cython started, they probably would have used them to start with instead of their own thing.

00:05:20.740 --> 00:05:21.300
Yeah.

00:05:21.300 --> 00:05:21.400
Yeah.

00:05:21.400 --> 00:05:22.480
They had no alternative.

00:05:22.480 --> 00:05:23.900
So they came up with something.

00:05:23.900 --> 00:05:26.020
It's just interesting that it kind of came.

00:05:26.020 --> 00:05:27.880
I mean, I guess it compiles to see.

00:05:27.880 --> 00:05:31.880
So it makes sense that it had like a really strong C flavor in the way that you wrote it.

00:05:31.880 --> 00:05:32.100
Yeah.

00:05:32.100 --> 00:05:32.520
Yeah.

00:05:32.520 --> 00:05:35.280
So what else is notable here?

00:05:35.660 --> 00:05:39.120
It said there's major NumPy support improvements.

00:05:39.120 --> 00:05:46.540
So Cython's have worked well with NumPy, but now with Cython 3, it gives you the ability to write NumPy ufunks.

00:05:46.540 --> 00:05:52.860
Don't do enough NumPy to know the why I care about ufunks, but you can write them directly in Cython.

00:05:53.300 --> 00:06:03.060
So my understanding is basically that instead of going through the Python API and layer to work with NumPy, it drops down to the C layer.

00:06:03.060 --> 00:06:07.860
And so it's like C to C interoperability when you're doing NumPy within Cython.

00:06:07.860 --> 00:06:08.760
That's pretty cool.

00:06:08.760 --> 00:06:18.060
Another thing that's not mentioned in this article that I'm linking to on InfoWorld that's really cool about NumPy, about Cython, is you can remove the GIL.

00:06:18.060 --> 00:06:19.480
You can go no GIL.

00:06:19.480 --> 00:06:22.520
There's a context manager that's just called no GIL.

00:06:22.520 --> 00:06:31.360
So I can say, like, with this section, I'm going to do a bunch of code, and I want to release the GIL for other parallel processing stuff.

00:06:31.360 --> 00:06:42.080
So if multiple bits of code call that into that function, and they're being done within threads, they can run truly in parallel on hardware right on the cores, right?

00:06:42.080 --> 00:06:44.800
True OS thread parallelism, which is pretty excellent.

00:06:44.800 --> 00:06:52.060
Now, the limitation there is that you can't be working directly with the Python API, right?

00:06:52.060 --> 00:06:57.040
Like, say, list or something, because those assume that they're thread safe because of the gill, right?

00:06:57.080 --> 00:07:01.460
But if you're just doing, like, your own algorithm, right, then you can, which is pretty cool.

00:07:01.460 --> 00:07:04.180
And, yeah, that's pretty much it.

00:07:04.180 --> 00:07:06.700
So well done, folks, on that.

00:07:06.700 --> 00:07:09.320
It sounds like a ton of work, but, yeah.

00:07:09.320 --> 00:07:12.240
If you are interested in Cython, check this out.

00:07:12.240 --> 00:07:12.740
Bye-bye.

00:07:12.740 --> 00:07:18.680
Cero in the audience says Cython is great for waiting for HPY output.

00:07:18.680 --> 00:07:19.160
Nice.

00:07:19.160 --> 00:07:19.960
Mm-hmm.

00:07:19.960 --> 00:07:21.080
All right.

00:07:21.080 --> 00:07:21.840
Well, that's number one.

00:07:21.840 --> 00:07:22.440
Okay.

00:07:22.440 --> 00:07:23.940
Which is actually number three.

00:07:25.460 --> 00:07:27.820
Oh, yeah, because it's Cython 3.

00:07:27.820 --> 00:07:28.560
Exactly.

00:07:28.560 --> 00:07:31.240
So I want to talk about reading code.

00:07:31.240 --> 00:07:33.740
And I kind of agree.

00:07:33.740 --> 00:07:39.440
So this is an article by Eric Mathis, and he's the dude that wrote Python Crash Course.

00:07:39.440 --> 00:07:42.680
And it's on its third edition now.

00:07:42.680 --> 00:07:43.360
It's a pretty good book.

00:07:43.360 --> 00:07:47.880
Anyway, reading code, an important but seldom discussed skill.

00:07:47.880 --> 00:07:49.040
And I have to agree with that.

00:07:49.040 --> 00:07:56.960
I've had many discussions in the past about coding standards within teams.

00:07:56.960 --> 00:07:59.740
And I try to have them be lightweight.

00:07:59.740 --> 00:08:02.340
It's better to just teach people how to read code.

00:08:02.340 --> 00:08:09.560
And so I'm mostly bringing this up because I definitely agree that we need to talk about it more,

00:08:09.760 --> 00:08:13.040
especially when teaching people, reading code and reading.

00:08:13.040 --> 00:08:20.320
Like, we often tell people go out and read the source code for some popular third-party libraries or packages

00:08:20.320 --> 00:08:26.060
or even the internal Python, standard Python library.

00:08:26.060 --> 00:08:29.340
But it does take some skill to read code.

00:08:29.600 --> 00:08:35.200
So anyway, he takes an example of a lottery example or something.

00:08:35.200 --> 00:08:36.600
It doesn't really matter.

00:08:36.600 --> 00:08:41.180
But there's a few techniques, a couple techniques that he lists that I really like.

00:08:41.180 --> 00:08:45.300
So if you just look at code, you've got a whole bunch of comments.

00:08:45.300 --> 00:08:47.200
You've got a whole bunch of stuff going on often.

00:08:47.200 --> 00:08:53.680
And one of the things he says to start with is ignore the function definitions, which is interesting

00:08:53.680 --> 00:08:56.320
because the function definition is where the name of the function is.

00:08:56.600 --> 00:08:58.720
But just sort of ignore that for now.

00:08:58.720 --> 00:09:04.000
And he doesn't say this, but in his example, he said, ignore all the comments.

00:09:04.000 --> 00:09:06.620
I mean, he took out all the comments and the function definition.

00:09:06.620 --> 00:09:10.420
And just so that you can just see the code and not everything else.

00:09:10.420 --> 00:09:16.600
And I actually, I had a code base once where I had, there were so many comments that I wrote a little script

00:09:16.600 --> 00:09:19.180
that would strip the comments out so that I could read the code better.

00:09:19.180 --> 00:09:23.960
Anyway, it does, it's a, you can mentally do it when you, when you're kind of have a,

00:09:23.960 --> 00:09:25.960
when you get used to doing this.

00:09:25.960 --> 00:09:31.180
And also IDs help, but that's a great way to just sort of simplify what you're looking at

00:09:31.180 --> 00:09:33.520
so that you can mentally see what's going on.

00:09:33.520 --> 00:09:37.020
The second technique is to simplify repetitive blocks.

00:09:37.020 --> 00:09:41.320
Like in the example we're showing, there's a couple big print blocks.

00:09:41.320 --> 00:09:47.900
And he, his example says, mentally, you can just lump this into print a message.

00:09:48.520 --> 00:09:50.040
And, and that helps you.

00:09:50.040 --> 00:09:53.420
And then there's really not that much code left when you're looking at it.

00:09:53.420 --> 00:09:57.100
And so that, that he talks about trying to make sense of it.

00:09:57.100 --> 00:10:04.020
I'm not going to throw any, I'm not going to discuss really what I think of the quality of the code he's showing.

00:10:04.020 --> 00:10:04.520
It's fine.

00:10:04.740 --> 00:10:13.200
But, and then the last thing, or one of the next to the last is to talk about using an IDE.

00:10:13.200 --> 00:10:17.060
And so the, I do this a lot with many IDs.

00:10:17.060 --> 00:10:18.480
I think all of them now.

00:10:18.800 --> 00:10:27.980
You can, like, just instead of hiding the function definition, you can hide everything but the function definition on the, on a lot of functions.

00:10:27.980 --> 00:10:37.360
And if, especially if you're, if you've got a whole bunch of helper functions that are cluttering up the, your workspace, you can, or in weird places, you can just hide them so that you can see.

00:10:37.360 --> 00:10:42.060
So like in this example, we've got get winning ticket, check ticket, and make random ticket.

00:10:42.700 --> 00:10:49.560
And then you, you can kind of see a part of one of the functions, but maybe I also want to see like one other function.

00:10:49.560 --> 00:10:52.700
So if, especially if you're looking at two functions, you can hide the rest of them.

00:10:52.700 --> 00:10:53.560
It makes it nice.

00:10:53.560 --> 00:10:54.540
Yeah.

00:10:54.540 --> 00:10:57.080
It usually goes under the term of code folding.

00:10:57.080 --> 00:10:57.680
Yeah.

00:10:57.680 --> 00:10:58.300
Code folding.

00:10:58.300 --> 00:10:58.760
That's it.

00:10:58.760 --> 00:10:59.080
Yeah.

00:10:59.080 --> 00:11:04.040
But then off a great discussion of, think about this.

00:11:04.040 --> 00:11:04.720
Think about that.

00:11:04.720 --> 00:11:07.340
People are going to read your code and try to understand it.

00:11:07.340 --> 00:11:09.420
So think about that when you're writing code.

00:11:09.420 --> 00:11:11.360
So writing, writing readable code.

00:11:11.620 --> 00:11:17.840
One of the things he didn't bring up that I want to make sure about is, so this technique of like hiding the function definition.

00:11:17.840 --> 00:11:30.780
One of the things, one of the powerful things about this is because we have mentally, when we're reading code, at least when I am, and I think this applies to a lot of people, we believe the function name.

00:11:30.780 --> 00:11:34.280
And we believe the variable name because somebody chose it.

00:11:34.280 --> 00:11:37.300
But, so therefore it really needs to be accurate.

00:11:37.480 --> 00:11:42.880
It should be, it's hard to name functions and variables, but sometimes they drift.

00:11:42.880 --> 00:11:48.320
Sometimes the, like, it'll say like set name or something, but it does a whole bunch of other stuff.

00:11:48.320 --> 00:11:51.980
So if it does a whole bunch of other stuff, you're going to have to change the name of the function.

00:11:52.180 --> 00:11:58.180
Because if the function's name is not accurate, people are going to fold it up and just assume that's what it does.

00:11:58.180 --> 00:12:09.280
So I would say, I would add to this, make sure your function and variable names are descriptive and change them when the body of the function changes.

00:12:09.280 --> 00:12:10.100
So, yeah.

00:12:10.100 --> 00:12:11.240
And it's interesting.

00:12:11.240 --> 00:12:14.300
I just had Eric on Talk Python, which is not yet out.

00:12:14.300 --> 00:12:16.180
So, you know, time travel podcast.

00:12:16.180 --> 00:12:18.220
He was both there and is not there.

00:12:18.300 --> 00:12:21.400
It's sort of an Heisen Eric sort of thing going on there.

00:12:21.400 --> 00:12:23.380
But a couple thoughts on this.

00:12:23.380 --> 00:12:29.240
I think if, it's kind of a big if in the comments or hinting towards this in the live stream as well.

00:12:29.240 --> 00:12:36.540
If the naming is super good, I kind of prefer the second way, like collapse all the functions and then expand them.

00:12:36.540 --> 00:12:38.800
As you're like, that's not clear what this is doing.

00:12:38.800 --> 00:12:39.920
Like, let me dive into that.

00:12:39.920 --> 00:12:41.860
Like, you know, print header.

00:12:41.860 --> 00:12:49.740
Like, okay, well, we're going to assume that that prints the header and just go on, you know, or things like that, right, where it's pretty straightforward.

00:12:49.740 --> 00:12:52.380
There's not a lot of, I wonder what the algorithm does there.

00:12:52.380 --> 00:12:53.700
It's like, eh, not too much.

00:12:53.700 --> 00:12:56.480
So then I like to kind of fold it down.

00:12:56.480 --> 00:13:00.680
But if, I'm not sure that I would take away the function names.

00:13:00.680 --> 00:13:07.400
I guess it would be like a unique IDE plugin where you could say like inline everything.

00:13:07.400 --> 00:13:12.680
And even if there's repetition, just inline it and just like, you know, and then work backwards as a way to understand.

00:13:12.680 --> 00:13:13.940
Don't do that in the main branch.

00:13:13.940 --> 00:13:15.720
But that'd be interesting to do.

00:13:15.720 --> 00:13:23.780
But kind of in the reverse, a lot of times what you'll end up with is a function that's like super long and poorly structured if you're trying to understand it.

00:13:23.780 --> 00:13:28.880
If just reading the function name doesn't work, it's usually because it's a big glob of a mess, right?

00:13:28.880 --> 00:13:29.920
Not always, but often.

00:13:29.920 --> 00:13:40.100
And so the part where he says, comment out this, instead of having all the steps of like print the winning thing, and here's like the seven things it does, you just like have a comment, print the winning thing.

00:13:40.100 --> 00:13:47.720
What I like to do for that is as I'm trying to understand it, I'll grab like that section and refactor to a function and say print the winner.

00:13:47.720 --> 00:13:54.060
Grab the other part, refactor, print, print loser or something along those lines, right?

00:13:54.060 --> 00:14:04.100
And it actually will start to have the same effect as like replace it with a comment, but you end up with running code that is still like understandable and consistent as you kind of like play with it.

00:14:04.140 --> 00:14:09.140
So I'll go through something like big and go, okay, this section, this should be its own little thing with a name.

00:14:09.140 --> 00:14:15.200
Hey, how about I can make a function that has that name and the IDE just a highlight, right click, you know, control T or whatever.

00:14:16.460 --> 00:14:19.120
Do it and give it the name that you were going to make the comment.

00:14:19.120 --> 00:14:26.340
And that works a little bit better for me because it doesn't destroy the running code in case you're like, well, but now I need to run it to see what this other part does.

00:14:27.080 --> 00:14:27.260
Yeah.

00:14:27.260 --> 00:14:27.860
Yeah.

00:14:27.860 --> 00:14:43.960
Another thing that you're, I was thinking of other tips when I, so I learned to program mostly doing a lot of C code and in there you've got to, you've got to have, if you're writing helper functions, they need to go ahead above the normal, the other function.

00:14:43.960 --> 00:14:50.560
So that like, because it's not declared when it has to be visible to the function, that's not true with Python.

00:14:50.560 --> 00:14:54.040
And, and so I've liked to have the reverse.

00:14:54.040 --> 00:15:01.660
So if I've like, one of the suggestions is to break out, if you've got a bunch of helper functions and it's confusing you to put them in another file.

00:15:01.660 --> 00:15:10.220
I don't actually like to do that, especially if it's only one file using it, I'd rather put it, put them below the function that they're helping.

00:15:10.220 --> 00:15:23.240
and especially if there's just a couple main, functions that are used in this module that are the, that are used externally, but those I'd like to put those at the top and then all the helpers at the bottom or something like that.

00:15:23.240 --> 00:15:34.080
I used to have a coding style to do the reverse and I think it was inherited from C code style, but, Python's different.

00:15:34.080 --> 00:15:44.340
and I don't necessarily, I guess I, I'm not sure what I feel about the, hiding the function name, but I guess maybe don't trust the function name.

00:15:44.340 --> 00:15:45.040
Yeah.

00:15:45.040 --> 00:15:46.420
Verify.

00:15:46.420 --> 00:15:49.120
yeah, there's a couple of comments like that.

00:15:49.120 --> 00:15:53.480
David pool says a quote I once read is if the code and comments disagree, both are wrong.

00:15:53.480 --> 00:16:00.560
That's kind of similar to the function names as well as given sufficient times, the code and the comments, maybe function names as well.

00:16:00.560 --> 00:16:02.800
We'll start to lie, which is interesting there.

00:16:02.800 --> 00:16:03.060
What?

00:16:03.060 --> 00:16:08.600
And I also see that people are like more reluctant to change somebody else's comment than they are to change their code.

00:16:08.780 --> 00:16:11.400
And I'm like, you gotta get over that.

00:16:11.400 --> 00:16:13.980
If the comments are on, go feel free to change it.

00:16:13.980 --> 00:16:16.040
That's, that's a perfectly fine refactoring.

00:16:16.040 --> 00:16:18.620
So anyway, yeah, let's move to the next.

00:16:18.620 --> 00:16:18.740
Absolutely.

00:16:18.740 --> 00:16:24.720
I, I totally agree with you about putting the most sort of the organizing, coordinating high level stuff first.

00:16:24.720 --> 00:16:32.920
you know, maybe what would be in the dunder, if, if name, dunder name equals dunder main, whatever that is, make that a function and put it at the top.

00:16:32.920 --> 00:16:35.000
I, I totally agree that that's the way to go.

00:16:35.000 --> 00:16:35.400
Yeah.

00:16:35.400 --> 00:16:36.140
Cool.

00:16:36.200 --> 00:16:39.080
All right, next, how about another release this time?

00:16:39.080 --> 00:16:42.840
Something very small with lots of, lots of effort.

00:16:42.840 --> 00:16:49.240
So this is the one that I was thinking that comes from Matt Trentini and let me pull it up.

00:16:49.240 --> 00:16:50.620
Cause that's some good stats in it.

00:16:50.620 --> 00:16:55.440
It says after 10 months, a thousand mainline commits and a hunt over a hundred contributors.

00:16:55.440 --> 00:16:58.500
We have a new version of micro Python.

00:16:58.500 --> 00:17:00.760
So thank you, Matt, for sending that into us.

00:17:00.760 --> 00:17:03.480
That's a pretty big release, a hundred contributors.

00:17:03.480 --> 00:17:13.320
And so the reason I brought that up is that the GitHub announcement for the release doesn't point out like how big of a release this was like almost a year's worth of work.

00:17:13.320 --> 00:17:22.400
So micro Python, the one that runs on embedded devices, not, not phones, but like incredibly small and cheap devices, you know, like five, $10 chips.

00:17:22.400 --> 00:17:22.940
Yeah.

00:17:22.940 --> 00:17:23.680
It's awesome.

00:17:23.680 --> 00:17:26.220
It's awesome that you can run Python there.

00:17:26.220 --> 00:17:26.420
Right.

00:17:26.460 --> 00:17:35.400
And so micro Python and circuit Python are, you know, similar projects, one fork from the other, I believe, but they've deviated a little bit.

00:17:35.400 --> 00:17:45.640
Circuit Python being more beginner, educational friendly, micro Python being more production device, you know, creating devices to do actual jobs type of friendly.

00:17:46.040 --> 00:17:47.040
But I think they're working a lot together.

00:17:47.040 --> 00:17:47.800
But I think they're working a lot together.

00:17:47.800 --> 00:17:49.200
There's been a lot of merging back.

00:17:49.200 --> 00:17:50.120
So that's, that's pretty cool.

00:17:50.120 --> 00:17:56.940
So this release of micro Python introduces a lightweight package manager called MIP instead of pip.

00:17:56.940 --> 00:17:57.960
You've got MIP.

00:17:57.960 --> 00:18:03.800
It uses a custom protocol, the query install packages that's optimized for embedded systems.

00:18:03.800 --> 00:18:04.920
So that's pretty cool.

00:18:04.920 --> 00:18:07.040
It's easier to get packages involved.

00:18:07.780 --> 00:18:12.340
It's like if you've done micro Python stuff before, it's not as easy as just pip install this thing.

00:18:12.340 --> 00:18:14.720
It's a little bit, a little bit trickier than that.

00:18:14.720 --> 00:18:25.560
Also, the core runtime and built-in types have been compressed to only including C-level type structs for as much as possible.

00:18:25.560 --> 00:18:27.540
So that's shrunken the size of it.

00:18:27.540 --> 00:18:35.100
Not by a lot, but it's so small that, you know, losing kilobytes actually makes a difference, which is a pretty interesting way to think about it.

00:18:35.120 --> 00:18:38.780
Because we don't worry about the size varying by kilobytes in CPython.

00:18:38.780 --> 00:18:39.800
Right.

00:18:39.800 --> 00:18:46.360
And then there's a bunch of like small changes like Bluetooth low energy changes, SSL settings.

00:18:46.360 --> 00:18:50.180
By the way, SSL is way harder over there than you would imagine it would be.

00:18:50.180 --> 00:18:54.740
There's a bunch of different ports, like the ESP32 is the one that I've worked with.

00:18:54.740 --> 00:19:00.960
And so for each of the different ports that it goes through, there's sort of a summary of like, how has it changed for that one?

00:19:00.960 --> 00:19:10.480
And I'd also like to just remind people, like, while this is awesome for embedded devices, you might think, ah, I don't do, you know, small chip programming.

00:19:10.480 --> 00:19:11.480
So it doesn't matter to me.

00:19:11.480 --> 00:19:14.480
You also might be interested in PyScript, right?

00:19:14.480 --> 00:19:26.760
And so one of the things that they're trying to do is work to get MicroPython to be one of the possible foundations, the runtimes and WebAssembly for PyScript.

00:19:26.760 --> 00:19:36.800
And when this thing is 100K or 75K, whatever it is, all of a sudden you can run PyScript in the browser nearly on par with JavaScript, right?

00:19:36.800 --> 00:19:45.320
Traditional PyScript used the full CPython, at least as much as you can get into WebAssembly, which has meant a 10 meg download.

00:19:45.320 --> 00:19:48.040
And then in the browser, I had to parse and start up that whole thing.

00:19:48.040 --> 00:19:53.360
If that goes to MicroPython, that becomes incredibly fast to download 75K.

00:19:53.360 --> 00:19:55.700
That's like JavaScript size.

00:19:55.700 --> 00:20:03.660
Right. So all these changes are not just like, I don't think, oh, I don't do this embedded device programming, so it's not for me.

00:20:03.660 --> 00:20:08.120
It may well be for all of us soon instead of JavaScript, which is very exciting.

00:20:08.120 --> 00:20:13.060
So there are many changes, like, Ryan, see the scroll bar size as I'm going through this list?

00:20:13.060 --> 00:20:19.000
I am not going to go through them, but if you care, I just want to point out, like, there's a massive new release of MicroPython.

00:20:19.000 --> 00:20:21.940
You can go and see what's changed for the different ports.

00:20:21.940 --> 00:20:28.000
And then in the core, right, like there's just, you know, almost, I don't know how many pages that is, but it's many, many, many pages.

00:20:28.000 --> 00:20:31.180
So check out the linked release notes from the MicroPython team.

00:20:31.180 --> 00:20:32.220
Congrats to them as well.

00:20:32.220 --> 00:20:33.720
Damien George and others.

00:20:34.200 --> 00:20:35.400
Yeah, this is really cool.

00:20:35.400 --> 00:20:47.020
I love to see that basically also that the project is continuing and we all benefit from Python-enabled devices and stuff, and people can invent new things better.

00:20:47.020 --> 00:20:53.140
And yeah, the Internet of Things being in Python is better than having a different language.

00:20:53.920 --> 00:20:54.360
Absolutely.

00:20:54.360 --> 00:20:58.920
Also, just want to, you know, sort of a time travel sort of thing as well.

00:20:58.920 --> 00:21:02.980
I think Matt sent this over quite a while ago, and it's been sort of on our list.

00:21:02.980 --> 00:21:04.920
I finally pulled it off our list and made it a topic.

00:21:04.920 --> 00:21:06.540
So this is from the end of April.

00:21:06.540 --> 00:21:13.460
It's a couple months old, but still, you know, almost a year's worth of work is worth celebrating, even if it's, you know, a couple months later.

00:21:13.460 --> 00:21:15.200
Yeah, pretty cool.

00:21:15.200 --> 00:21:16.680
All right.

00:21:16.680 --> 00:21:19.540
Are we ready for the last, our last topic?

00:21:19.540 --> 00:21:20.980
Yeah, bring it on.

00:21:20.980 --> 00:21:27.240
I wanted to just, so I'm, you know, I shouldn't even qualify this.

00:21:27.240 --> 00:21:30.940
I am, I was going to say I'm not a sucker for listicles, but I kind of am.

00:21:30.940 --> 00:21:35.200
So this is an article called Advanced Python Tips for Development.

00:21:35.200 --> 00:21:39.840
But when I was reading it, so this is by Schofield Idahen.

00:21:39.840 --> 00:21:45.300
And when I was reading it, there's 15 tips, and some of them don't really seem that advanced.

00:21:45.300 --> 00:21:47.440
Like the top one, use list comprehensions.

00:21:47.440 --> 00:21:49.200
Okay, you should do that.

00:21:49.200 --> 00:21:55.420
But there's a few that I wanted to point out that I thought were that I just wanted reminders of to use more often.

00:21:55.420 --> 00:21:58.400
So list comprehensions are awesome.

00:21:58.400 --> 00:22:04.480
And I kind of forget that they aren't obvious to people now because I've been using them for so long.

00:22:04.480 --> 00:22:05.480
So they're great.

00:22:05.480 --> 00:22:09.920
But one of the things, the next step, so tip one is use list comprehensions.

00:22:09.920 --> 00:22:14.360
Tip two is leverage generator expressions for memory efficiency.

00:22:14.660 --> 00:22:18.200
And I don't use generator expressions enough, and I think I should.

00:22:18.200 --> 00:22:24.680
And one of the cool things about this article is it shows side by side a list comprehension and a generator expression.

00:22:24.880 --> 00:22:30.500
And they look identical except for there's brackets versus parentheses.

00:22:30.500 --> 00:22:31.700
So parentheses?

00:22:31.700 --> 00:22:32.580
Yeah, parens.

00:22:32.580 --> 00:22:37.000
And I kind of forget about generator expressions.

00:22:37.000 --> 00:22:40.920
So generator expressions, are list comprehensions not generators?

00:22:40.920 --> 00:22:42.020
I thought they were.

00:22:42.340 --> 00:22:43.220
No, no.

00:22:43.220 --> 00:22:43.440
No.

00:22:43.440 --> 00:22:43.900
Okay.

00:22:43.900 --> 00:22:47.780
Well, the list comprehension executes it all into memory.

00:22:47.780 --> 00:22:55.120
And then the generator one, you have to start iterating through it to create it, which it's cool that they're so similar.

00:22:55.560 --> 00:23:03.640
I'm sure it's caused untold amounts of challenges for people to go, they look the same.

00:23:03.640 --> 00:23:04.700
You can do both.

00:23:04.700 --> 00:23:07.640
It doesn't seem to matter until it really matters, you know?

00:23:07.640 --> 00:23:08.220
Yeah.

00:23:08.220 --> 00:23:16.600
And also, it's not, I mean, when you get used to list comprehensions, generator expressions kind of looks like a tuple expression.

00:23:16.600 --> 00:23:17.400
Yeah.

00:23:17.940 --> 00:23:21.460
Well, and then you put curly braces on it and it becomes a set comprehension.

00:23:21.460 --> 00:23:22.260
Yeah.

00:23:22.260 --> 00:23:24.560
The grant reminded us that.

00:23:24.560 --> 00:23:25.940
Don't forget set comprehensions.

00:23:25.940 --> 00:23:27.120
Yeah, yeah, yeah.

00:23:27.120 --> 00:23:28.200
Okay.

00:23:28.200 --> 00:23:29.080
So let's hop down.

00:23:29.080 --> 00:23:33.740
The enumerate function, this is just take advantage of enumerate function.

00:23:33.740 --> 00:23:42.800
This is just remember to teach people that are coming from C or other for I equals 1 to 10 sort of languages that enumerates around.

00:23:42.800 --> 00:23:45.200
So if you need the index, also use enumerate.

00:23:45.560 --> 00:23:48.240
Don't be a dork and get the length of a list.

00:23:48.240 --> 00:23:50.220
Counter equals 1.

00:23:50.220 --> 00:23:52.000
For I equals 1 to length of a list.

00:23:52.000 --> 00:23:52.900
Yeah, yeah.

00:23:52.900 --> 00:23:53.400
Don't do that.

00:23:53.400 --> 00:23:59.540
Also, enumerate can, if you need it to be a, so enumerate does 0 through whatever.

00:23:59.540 --> 00:24:03.860
If you need it to be 1 through whatever, you can give it a start.

00:24:03.860 --> 00:24:08.000
Enumerate takes a starting point, so you can make it start at 1 if you need it.

00:24:08.000 --> 00:24:08.380
Right.

00:24:08.380 --> 00:24:10.980
If you're working with indexes, the default is good.

00:24:10.980 --> 00:24:15.820
But if you're trying to print thing 1, thing 2, thing 3, then start equals 1 is the way to go.

00:24:15.820 --> 00:24:16.360
Yeah.

00:24:16.360 --> 00:24:19.940
Or if you're using it to get into some other data structure or something.

00:24:19.940 --> 00:24:24.460
Anyway, I'm going to hop down to, so that's true.

00:24:24.460 --> 00:24:27.200
Hop down to 5, which is the zip function.

00:24:27.660 --> 00:24:33.280
And I just, so zip is great for parallel, iterating through parallel lists.

00:24:33.280 --> 00:24:40.140
And you can do more than, this is showing name and age as two different lists and going through them.

00:24:40.560 --> 00:24:47.020
My tip is just practice this several times and unfrequently if you need it.

00:24:47.020 --> 00:24:52.720
Because this was a hard one to pound into my brain, is to remember how zip works.

00:24:52.720 --> 00:24:56.520
Because it's not that confusing, but it's tripped me up for some reason.

00:24:56.520 --> 00:25:04.620
And it's not, so you'll take several lists and it just makes, if you zip them, you end up with a, what is it, a list of tuples?

00:25:04.620 --> 00:25:11.900
Or some sort of iterable, I don't know if it's an actual list, an iterable of tuples that you can pull out different parts of it or something.

00:25:11.900 --> 00:25:15.860
And then you can, in this example, it says for name, last age.

00:25:15.860 --> 00:25:18.580
So that's unpacking it after you get it.

00:25:18.580 --> 00:25:19.880
And it works great.

00:25:19.880 --> 00:25:21.340
I just always forget to use it.

00:25:21.340 --> 00:25:22.680
So a good reminder.

00:25:22.680 --> 00:25:31.000
And then now I'm going to jump down to my 12, one of the things, 12, but 8 is kind of funny because it's a formatting problem.

00:25:31.000 --> 00:25:32.440
But anyway, use counters.

00:25:32.440 --> 00:25:33.220
Counters are good.

00:25:34.160 --> 00:25:36.580
12 is, what is 12?

00:25:36.580 --> 00:25:43.780
Oh, one of the things, 11 is decorate, use decorate, decorate functions with static method and class method.

00:25:43.780 --> 00:25:45.880
I just hardly ever do this.

00:25:45.880 --> 00:25:50.120
Do you use static method or class method that much, Michael?

00:25:50.120 --> 00:25:51.820
Yeah, quite a bit, actually.

00:25:51.820 --> 00:25:52.560
Oh, really?

00:25:52.560 --> 00:25:53.000
Okay.

00:25:53.000 --> 00:25:53.540
Yeah.

00:25:53.540 --> 00:25:59.760
And I guess one of the neat things, yeah, anyway, I just don't use it much.

00:25:59.760 --> 00:26:03.320
Maybe I'll try to explore where I can use it more often.

00:26:03.700 --> 00:26:07.200
The number 12 is use slots to reduce memory usage.

00:26:07.200 --> 00:26:10.260
And I kind of forget to do this, too.

00:26:10.260 --> 00:26:13.680
So this is a good reminder to use slots when you're...

00:26:13.680 --> 00:26:22.920
And this is great, especially if you know ahead of time what, you know, your classes aren't going to add new data as it goes on.

00:26:22.920 --> 00:26:26.360
It's not going to be dynamically generating new fields, yeah.

00:26:26.620 --> 00:26:29.740
And I guess here I just use the attrs.

00:26:29.740 --> 00:26:33.040
So anyway.

00:26:33.040 --> 00:26:37.200
Yeah, it's worth pointing out that slots don't just reduce memory.

00:26:37.200 --> 00:26:40.060
They also make attribute access faster.

00:26:40.060 --> 00:26:45.740
So like thing.field, getting and setting that value is also faster with slots.

00:26:45.740 --> 00:26:46.340
Okay.

00:26:46.340 --> 00:26:48.720
Yeah, that is good to remember.

00:26:49.060 --> 00:26:51.220
Anyway, some fun tips.

00:26:51.220 --> 00:26:53.580
14.

00:26:53.580 --> 00:26:54.500
Use pytest.

00:26:54.500 --> 00:26:56.540
It says use unit test or pytest.

00:26:56.540 --> 00:26:57.680
Ignore the first part.

00:26:57.680 --> 00:26:58.520
Use pytest.

00:26:58.520 --> 00:27:01.440
There's a typo there.

00:27:01.440 --> 00:27:02.000
Is that what you're saying?

00:27:02.000 --> 00:27:03.120
There's some typos.

00:27:03.300 --> 00:27:05.960
So use unit test or take out the unit test or.

00:27:05.960 --> 00:27:12.300
And also it says for unit testing, just automated testing, just for all your automated testing, not just unit testing.

00:27:12.300 --> 00:27:12.740
Yeah.

00:27:12.740 --> 00:27:16.300
Well, those are our topics.

00:27:16.300 --> 00:27:19.720
Do you want to talk about some extras, Michael?

00:27:19.720 --> 00:27:21.120
I do have some.

00:27:21.120 --> 00:27:26.760
So I feel like, Brian, it's not time for a joke yet, but there is a pretty good joke on that page we might have to come back to.

00:27:26.760 --> 00:27:28.500
Well, do you want to explore it now?

00:27:28.500 --> 00:27:30.020
Oh, not yet.

00:27:30.020 --> 00:27:30.400
Not yet.

00:27:30.400 --> 00:27:31.160
We can do it later.

00:27:31.160 --> 00:27:31.560
Okay.

00:27:31.560 --> 00:27:32.380
Let's do it later.

00:27:32.380 --> 00:27:32.640
All right.

00:27:32.920 --> 00:27:36.180
So, you know, people have different faces, Brian.

00:27:36.180 --> 00:27:39.300
You know, sometimes you got your sort of like neutral face.

00:27:39.300 --> 00:27:40.580
You got your happy face.

00:27:40.580 --> 00:27:41.520
You got your sad face.

00:27:41.520 --> 00:27:42.980
How about your hugging face?

00:27:42.980 --> 00:27:44.960
What's your hugging face look like?

00:27:44.960 --> 00:27:49.700
So there's this project created by Agustin.

00:27:49.700 --> 00:27:51.020
Let me pull it up here.

00:27:51.020 --> 00:27:52.420
The source code's linked at the bottom.

00:27:52.420 --> 00:27:56.860
By Agustin Pekiris or Agus, as his friends call him.

00:27:56.860 --> 00:28:00.760
Sent in, hey, I was looking to play with the hugging face API.

00:28:00.760 --> 00:28:02.680
And so I'm like, well, what could I work with?

00:28:02.800 --> 00:28:10.820
What if I turn a large language model or semantic search loose on Talk Python To Me and their transcripts?

00:28:10.820 --> 00:28:11.580
That's cool, huh?

00:28:11.580 --> 00:28:12.020
Yeah.

00:28:12.020 --> 00:28:14.060
So he created this project.

00:28:14.060 --> 00:28:18.680
You got to go and get a free hugging face API token because it uses hugging face.

00:28:18.680 --> 00:28:19.660
I was joking around.

00:28:19.660 --> 00:28:21.380
But then it says you can ask a question.

00:28:21.380 --> 00:28:23.680
For example, what's my advanced options?

00:28:23.680 --> 00:28:24.100
Oh, yeah.

00:28:24.100 --> 00:28:25.980
I can see how many things I could get back.

00:28:25.980 --> 00:28:27.440
Let's make that 10.

00:28:27.440 --> 00:28:28.380
Focus, folks.

00:28:28.380 --> 00:28:28.680
Come on.

00:28:28.900 --> 00:28:35.440
So you can go things and say, who uses MicroPython in production, for example.

00:28:35.440 --> 00:28:36.080
All right.

00:28:36.080 --> 00:28:37.480
I can type that into the search field.

00:28:37.480 --> 00:28:38.600
And then I can say submit.

00:28:38.600 --> 00:28:40.740
And sometimes it takes a second.

00:28:40.740 --> 00:28:41.820
Sometimes it's pretty quick.

00:28:41.820 --> 00:28:42.820
But we're going to see what we get.

00:28:42.820 --> 00:28:44.340
There's a little running character.

00:28:44.640 --> 00:28:46.200
Although they can't choose their sport.

00:28:46.200 --> 00:28:49.880
It's like rowing and then swimming and then it's running and then it's biking.

00:28:49.880 --> 00:28:51.000
That's what the like on.

00:28:51.000 --> 00:28:51.460
Here we go.

00:28:51.460 --> 00:28:52.460
It's like a decathlon.

00:28:52.460 --> 00:28:53.560
I guess you're right.

00:28:53.560 --> 00:28:55.320
And so here comes the answer back.

00:28:55.320 --> 00:28:58.800
It says over on Talk Python, you should check out PyScript powered by MicroPython.

00:28:58.800 --> 00:29:01.420
And MicroPython plus CircuitPython.

00:29:01.420 --> 00:29:03.100
You might be thinking, well, it's just searching titles.

00:29:03.100 --> 00:29:07.620
But then empowering developers by embedding Python by Nina Zakarenko.

00:29:07.980 --> 00:29:12.160
And then there's a weird one by Brian called 30 Amazing Python Projects and so on.

00:29:12.160 --> 00:29:13.320
Or even the year in review.

00:29:13.320 --> 00:29:13.980
Isn't that cool?

00:29:13.980 --> 00:29:14.820
That is neat.

00:29:14.820 --> 00:29:18.720
So if you want to play with this stuff, either because you want to build a thing like this

00:29:18.720 --> 00:29:23.940
for something else, or you want to just go ask questions about Talk Python, you can go

00:29:23.940 --> 00:29:25.020
and check out this app.

00:29:25.020 --> 00:29:26.860
The source code is linked at the bottom.

00:29:26.860 --> 00:29:34.020
I guess another comment that maybe it's a good idea to have transcripts for people to be

00:29:34.020 --> 00:29:35.440
able to use is search.

00:29:35.440 --> 00:29:36.340
Exactly.

00:29:37.140 --> 00:29:39.080
We didn't have transcripts.

00:29:39.080 --> 00:29:41.220
We weren't able to do this cool project, right?

00:29:41.220 --> 00:29:42.100
So yeah.

00:29:42.100 --> 00:29:42.640
Excellent.

00:29:42.640 --> 00:29:43.560
So that's one.

00:29:43.560 --> 00:29:46.120
And yeah, that's it for me for my extras.

00:29:46.120 --> 00:29:46.560
You got any?

00:29:46.560 --> 00:29:47.380
Yeah.

00:29:47.380 --> 00:29:52.760
One, I just wanted to, I guess, remind people that Python People is a thing.

00:29:52.760 --> 00:29:54.700
Python People is a new podcast.

00:29:54.700 --> 00:29:57.660
And episode three is out with Brett Cannon.

00:29:57.660 --> 00:30:04.900
And one of the quotes from him is, I came for the language, but I stayed for the community.

00:30:05.220 --> 00:30:09.820
We explored that and what was the situation when he talked about that.

00:30:09.820 --> 00:30:15.100
And we talked about a whole bunch of stuff, like what is the meaning of backbaking and toque,

00:30:15.100 --> 00:30:16.420
things like that.

00:30:16.420 --> 00:30:17.780
So check it out.

00:30:17.780 --> 00:30:20.820
Oh, nice.

00:30:22.200 --> 00:30:28.720
I had forgotten to, for people listening, I had forgotten to actually show the episode on the screen.

00:30:28.720 --> 00:30:32.100
I could go back and search Talk Python again for this and see if we find Python people.

00:30:32.100 --> 00:30:34.060
You would find a ton of Brett Cannon over there.

00:30:34.060 --> 00:30:36.060
And we have an episode for him coming up very soon.

00:30:36.060 --> 00:30:36.460
Yeah.

00:30:36.660 --> 00:30:37.820
But no.

00:30:37.820 --> 00:30:39.000
I switched it over to yours.

00:30:39.000 --> 00:30:41.340
Next, I didn't.

00:30:41.340 --> 00:30:43.920
There's a, oh, that's the wrong thing.

00:30:43.920 --> 00:30:44.500
Oh.

00:30:44.500 --> 00:30:45.740
Oh.

00:30:45.740 --> 00:30:48.400
I deleted the thing I wanted to talk about.

00:30:48.400 --> 00:30:51.020
So I guess that's it from extras for me.

00:30:51.020 --> 00:30:52.000
It's gone from the internet.

00:30:52.000 --> 00:30:52.820
It is gone.

00:30:52.820 --> 00:30:53.260
So.

00:30:53.260 --> 00:30:56.260
I'll have a joke for us.

00:30:56.260 --> 00:30:56.900
Okay.

00:30:57.220 --> 00:31:00.820
Well, let's, before we do the joke, we didn't do any sponsors.

00:31:00.820 --> 00:31:04.280
One of the sponsors, of course, is Python people, or it's us.

00:31:04.280 --> 00:31:06.280
But I'd like people to check it out.

00:31:06.280 --> 00:31:08.560
We have like maybe three listeners so far.

00:31:08.560 --> 00:31:10.160
No, it's bigger than that.

00:31:10.160 --> 00:31:11.120
But I'd like it to grow.

00:31:11.120 --> 00:31:15.820
I also wanted to give a shout out to everybody on Patreon.

00:31:15.820 --> 00:31:22.940
So if you go to any of Python Bytes pages, especially ones without any advertising, like

00:31:22.940 --> 00:31:27.560
today's or episode 343, you can see Become a Patreon.

00:31:27.560 --> 00:31:33.220
And you can click on it and become a member and help support the show for a buck.

00:31:33.220 --> 00:31:33.920
That's great.

00:31:33.920 --> 00:31:37.860
I also wanted to give a shout out to all of the amazing courses at Talk Python Training.

00:31:37.860 --> 00:31:39.440
Michael has done a great job.

00:31:39.440 --> 00:31:46.120
Plus, pulling in amazing other people to teach courses like me at Talk Python Training.

00:31:46.120 --> 00:31:47.100
There's some great stuff.

00:31:47.100 --> 00:31:47.820
So check it out.

00:31:47.820 --> 00:31:48.800
Now we can do a joke.

00:31:49.300 --> 00:31:53.180
Yeah, I've got some new courses coming from some really awesome people.

00:31:53.180 --> 00:31:54.600
All right, on to the joke.

00:31:54.600 --> 00:31:55.600
On to the joke.

00:31:55.600 --> 00:31:59.000
So this one is a meme somebody put together.

00:31:59.000 --> 00:32:04.080
I have two jokes here that we can even do the third joke that you had on screen a little

00:32:04.080 --> 00:32:04.460
bit ago.

00:32:04.460 --> 00:32:06.240
So HTMX.

00:32:06.240 --> 00:32:10.620
If you all are familiar with HTMX, if you're not, you should definitely check out our HTMX

00:32:10.620 --> 00:32:11.300
and Flask course.

00:32:11.300 --> 00:32:13.100
This thing is so awesome.

00:32:13.100 --> 00:32:14.580
I had so much fun learning it.

00:32:14.580 --> 00:32:17.800
And I'm like, where is the next project I can use HTMX on?

00:32:17.800 --> 00:32:18.480
Because it's great.

00:32:18.480 --> 00:32:22.540
The idea with HTMX is instead of doing JavaScript, you just write attributes.

00:32:22.540 --> 00:32:25.940
And then that magically through HTMX gets turned into server calls.

00:32:25.940 --> 00:32:31.420
Like if I need to rebuild a table, as somebody interacts with some other part of the page,

00:32:31.420 --> 00:32:35.020
that could just be done on the server and just send little fragments back.

00:32:35.020 --> 00:32:36.260
It's incredible, right?

00:32:36.260 --> 00:32:37.660
So it means you don't have to write JavaScript.

00:32:37.880 --> 00:32:42.240
So the joke is, there's a guy that's back in dev.

00:32:42.240 --> 00:32:45.060
And then this other dude, that's HTMX.

00:32:45.060 --> 00:32:46.880
HTMX says, look at me.

00:32:46.880 --> 00:32:48.040
Look at me back in dev.

00:32:48.040 --> 00:32:49.180
You're full stack now.

00:32:49.180 --> 00:32:50.040
You're full stack.

00:32:50.040 --> 00:32:51.300
Stand up for yourself, man.

00:32:51.300 --> 00:32:51.840
Don't let those.

00:32:51.840 --> 00:32:54.060
Don't feel like you can only write it back in code.

00:32:54.060 --> 00:32:55.180
You're full stack now.

00:32:55.180 --> 00:32:55.940
HTMX.

00:32:56.420 --> 00:32:57.080
Isn't that good?

00:32:57.080 --> 00:32:57.600
Yeah.

00:32:57.600 --> 00:33:03.680
The other joke, before we get to the one that you had on the page, is what is happening to Twitter?

00:33:04.260 --> 00:33:08.420
Did a child try to rebrand this?

00:33:08.420 --> 00:33:11.480
It is so incredibly bad.

00:33:11.480 --> 00:33:14.780
No, it's like branded by a high school band.

00:33:14.780 --> 00:33:16.000
It's so bad.

00:33:16.000 --> 00:33:18.000
Let's call ourselves X.

00:33:18.000 --> 00:33:19.980
That'd be so cool, man.

00:33:19.980 --> 00:33:20.980
Yeah, man.

00:33:20.980 --> 00:33:24.800
And so like, for example, people might be thinking, I go, you're overreacting.

00:33:24.800 --> 00:33:29.140
They tried to take the Twitter logo down and replace it with an X.

00:33:29.140 --> 00:33:34.040
And then the police came and stopped them because they didn't have the Twitter employees doing it.

00:33:34.040 --> 00:33:38.380
Didn't have a permit to drive a crane around downtown San Francisco.

00:33:38.380 --> 00:33:42.400
So it was like half the Twitter logo is like half removed.

00:33:42.400 --> 00:33:44.760
There's no X, nor is there Twitter.

00:33:44.760 --> 00:33:46.520
It says tweet.

00:33:46.520 --> 00:33:48.780
I'm on Twitter.com, but there's an X.

00:33:48.780 --> 00:33:54.100
But, you know, sometimes like, what do you call these?

00:33:54.100 --> 00:33:55.820
Are there supposed to be X's?

00:33:55.820 --> 00:33:59.100
You know, usually X's is kind of a bad.

00:33:59.100 --> 00:33:59.900
I mean, it's just like.

00:33:59.900 --> 00:34:02.760
And if you share another one, is it a re-X?

00:34:02.760 --> 00:34:04.080
Yes, exactly.

00:34:04.080 --> 00:34:09.480
And there's some random person who has X as a handle on Twitter.

00:34:09.480 --> 00:34:11.320
And they're like, what's going on?

00:34:11.320 --> 00:34:12.660
Am I going to be like Twitter?

00:34:12.660 --> 00:34:18.900
I heard that they don't, I don't know for sure on this one, but they don't seem to have

00:34:18.900 --> 00:34:23.160
the intellectual property rights to like trademark the letter X.

00:34:23.160 --> 00:34:24.460
Well, you can't.

00:34:24.460 --> 00:34:25.860
I know.

00:34:25.860 --> 00:34:30.400
And this X looks like, I think the X11 logo.

00:34:30.400 --> 00:34:33.380
If you go look at that, I think that was the one.

00:34:33.380 --> 00:34:41.800
It's like, it's like a thick right slanty versus a thin left slanty, which is, you know, one's

00:34:41.800 --> 00:34:43.220
hollow, one's solid.

00:34:43.220 --> 00:34:44.200
Other than that, they're kind of.

00:34:44.200 --> 00:34:45.680
Anyway, there's.

00:34:45.680 --> 00:34:47.540
Well, that's sort of a meta joke.

00:34:47.660 --> 00:34:53.800
On the good side, current employees and those that are laid off are all X employees now.

00:34:53.800 --> 00:34:54.740
Exactly.

00:34:54.740 --> 00:34:56.640
Look at all the people that work for Twitter now.

00:34:56.640 --> 00:34:58.340
They're all X employees.

00:34:58.340 --> 00:35:00.040
All right.

00:35:00.040 --> 00:35:02.260
So that was just because this came from Twitter.

00:35:02.260 --> 00:35:03.380
I'm going to open up like, wow.

00:35:03.380 --> 00:35:04.220
This is getting.

00:35:04.220 --> 00:35:05.120
This is getting janky.

00:35:05.120 --> 00:35:05.620
It's X news.

00:35:05.620 --> 00:35:07.500
So it has to be part of our extras.

00:35:07.500 --> 00:35:09.360
It absolutely does.

00:35:09.360 --> 00:35:09.640
All right.

00:35:09.640 --> 00:35:12.400
Do you want to just give a quick shout out to what was on that page before?

00:35:13.120 --> 00:35:14.900
So what were you referring to?

00:35:14.900 --> 00:35:17.500
The only valid measurement of code quality.

00:35:17.500 --> 00:35:18.220
Oh, yeah.

00:35:18.220 --> 00:35:19.000
The WTFs per minute.

00:35:19.000 --> 00:35:19.720
Okay.

00:35:19.720 --> 00:35:20.380
Yeah.

00:35:20.380 --> 00:35:21.720
WTFs per minute.

00:35:21.720 --> 00:35:22.360
It's true.

00:35:22.360 --> 00:35:23.400
Oh, that's the.

00:35:23.400 --> 00:35:23.680
Yeah.

00:35:23.680 --> 00:35:24.620
You need the full one.

00:35:24.620 --> 00:35:25.220
Oh, wow.

00:35:25.220 --> 00:35:25.960
You lost it now.

00:35:25.960 --> 00:35:26.800
That was an ad.

00:35:26.800 --> 00:35:27.420
It was an ad.

00:35:27.420 --> 00:35:27.920
Yeah.

00:35:27.920 --> 00:35:29.080
It was a code review.

00:35:29.080 --> 00:35:31.860
And behind the door, you could just hear WTF.

00:35:31.860 --> 00:35:32.780
What WTF?

00:35:32.780 --> 00:35:35.540
And the good code only had a couple.

00:35:35.540 --> 00:35:38.500
The bad code was just like overwhelmed with them.

00:35:38.500 --> 00:35:39.180
That was the joke.

00:35:39.180 --> 00:35:40.200
Yeah.

00:35:40.200 --> 00:35:40.600
All right.

00:35:40.600 --> 00:35:41.740
Well, this episode was no joke.

00:35:41.740 --> 00:35:42.280
It was a lot of fun.

00:35:42.600 --> 00:35:43.140
Thanks, Brian.

00:35:43.140 --> 00:35:43.820
Thank you.

00:35:43.820 --> 00:35:46.520
And thanks, everybody, for showing up at a weird time.

00:35:46.520 --> 00:35:47.720
I really appreciate it.

00:35:47.720 --> 00:35:48.760
It's great.

00:35:48.760 --> 00:35:49.300
So.

00:35:49.300 --> 00:35:49.700
Yeah.

00:35:49.700 --> 00:35:50.260
See you later.

