WEBVTT

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

00:00:05.700 --> 00:00:11.800
This is episode 275, recorded March 15th, and I am Brian Okken.

00:00:11.800 --> 00:00:13.040
I am Michael Kennedy.

00:00:13.040 --> 00:00:14.580
And I'm Emily Morehouse.

00:00:14.580 --> 00:00:16.300
Yay, thanks for coming.

00:00:16.300 --> 00:00:25.560
I also want to give a shout out to Microsoft for Startup Founders Hub, and we'll learn more about them later in the show.

00:00:25.560 --> 00:00:26.820
So welcome, Emily.

00:00:27.640 --> 00:00:30.300
And if people aren't familiar with who you are, who are you?

00:00:30.300 --> 00:00:31.640
Yeah, of course.

00:00:31.640 --> 00:00:32.480
So I'm Emily.

00:00:32.480 --> 00:00:36.740
I am the Director of Engineering and one of the co-founders of Cuddlesoft.

00:00:36.740 --> 00:00:43.040
So we are a creative product development agency focused on web, mobile, IoT, and the cloud.

00:00:43.040 --> 00:00:49.400
I'm also a Python core developer and the Python conference chair for this year.

00:00:49.400 --> 00:00:50.140
Awesome.

00:00:50.140 --> 00:00:51.160
That is awesome.

00:00:51.160 --> 00:00:52.660
Said another way, you're quite busy.

00:00:52.660 --> 00:00:53.980
Yeah.

00:00:53.980 --> 00:00:57.080
I also have a 10-month-old, so, you know, not a lot going on in my life.

00:00:57.700 --> 00:00:59.920
Yeah, no, a lot of time to binge watch Netflix.

00:00:59.920 --> 00:01:01.000
10 months.

00:01:01.000 --> 00:01:04.560
So are you pretty busy for PyCon already?

00:01:05.340 --> 00:01:09.580
So interestingly enough, this is kind of a time that goes into autopilot in a way.

00:01:09.580 --> 00:01:13.000
You know, like most things are already set in motion that need to be set in motion.

00:01:13.000 --> 00:01:19.920
So it's really, we're working on the fun stuff right now, like, you know, speaker and staff gifts and stuff like that.

00:01:19.980 --> 00:01:28.760
But otherwise, it's pretty smooth sailing and just sitting back and watching COVID numbers and hoping that we don't get another spike before April 9th.

00:01:28.760 --> 00:01:29.960
Yeah.

00:01:29.960 --> 00:01:30.680
Fingers crossed.

00:01:30.680 --> 00:01:34.120
This will be the first PyCon after COVID hit.

00:01:34.120 --> 00:01:35.640
So hopefully everything goes great.

00:01:35.640 --> 00:01:36.520
I know people are excited.

00:01:36.520 --> 00:01:36.880
Yeah.

00:01:36.880 --> 00:01:37.240
Yeah.

00:01:37.640 --> 00:01:38.900
Well, Brian, do I have the first one?

00:01:38.900 --> 00:01:39.120
You do.

00:01:39.120 --> 00:01:39.580
Do we have to wait?

00:01:39.580 --> 00:01:42.060
Do we have to wait for me or can I talk about this?

00:01:42.060 --> 00:01:42.620
Yes.

00:01:42.620 --> 00:01:43.340
I'll wait.

00:01:43.340 --> 00:01:45.800
Well, let's wait.

00:01:45.800 --> 00:01:47.880
I'm very excited to talk about this one, actually.

00:01:47.880 --> 00:01:49.800
This one comes from Frederick Aberpil.

00:01:50.260 --> 00:01:51.640
I believe listens to the show a lot.

00:01:51.640 --> 00:01:52.340
So hello, Frederick.

00:01:52.340 --> 00:01:53.440
Nice work on this.

00:01:53.440 --> 00:02:04.460
I was working on the Python Bytes website of all things, and I wanted to do some stuff with like uploading MP3s and having a bunch of automation happen behind the scenes.

00:02:04.460 --> 00:02:09.920
And one of the things I did not too long ago is switch over to an async database.

00:02:09.920 --> 00:02:15.480
I think we talked about moving to Beanie and some of the cool stuff I'm doing to like halfway move to async, but not all the way yet.

00:02:15.480 --> 00:02:16.820
Not until we're quite ready.

00:02:17.300 --> 00:02:21.580
But as part of that, I'm like, well, all this file stuff, this is kind of slow.

00:02:21.580 --> 00:02:22.720
Like, this is a couple of seconds.

00:02:22.720 --> 00:02:27.720
Is there a way to sort of set the web server free while we're doing this work?

00:02:27.720 --> 00:02:28.340
Right.

00:02:28.340 --> 00:02:31.200
And some of that involved calling subprocesses.

00:02:31.200 --> 00:02:43.240
I thought, well, maybe there's some third-party package like aiofiles that I could use that would allow me to asynchronously do subprocesses instead of the subprocess module.

00:02:43.520 --> 00:02:46.840
So I did a quick Google search and I came across Frederick's article here.

00:02:46.840 --> 00:02:55.440
And much to my surprise, I don't know if you all are aware of this, but built-in, asyncio has async subprocess management already.

00:02:55.440 --> 00:02:56.180
That's pretty cool.

00:02:56.180 --> 00:02:56.580
Isn't that cool?

00:02:56.580 --> 00:02:56.900
Yeah.

00:02:56.900 --> 00:02:57.520
Yeah.

00:02:57.520 --> 00:02:59.520
Emily, have you played with this any?

00:02:59.520 --> 00:03:00.480
Yeah.

00:03:00.480 --> 00:03:04.540
You know, I actually think I've used this exact blog post, which is super funny.

00:03:05.220 --> 00:03:11.060
I was actually just recently writing, like, CLI regression test and pytest.

00:03:11.060 --> 00:03:14.240
And you basically, like, test running two different servers.

00:03:14.240 --> 00:03:16.980
And I was, like, fighting with subprocess to get it to work.

00:03:16.980 --> 00:03:22.940
I don't think they were using a new enough version that I could use async await, but I definitely remember referencing this.

00:03:22.940 --> 00:03:23.860
So, yeah.

00:03:23.860 --> 00:03:24.280
Yeah.

00:03:24.280 --> 00:03:24.880
Very cool.

00:03:24.880 --> 00:03:31.120
So, you can just say asyncio, the module, dot create subprocess exec for just running it.

00:03:31.120 --> 00:03:41.160
Or if you need to sort of follow along and see what's going on, you can use even the shell one that requires shell commands like a CD or an LS type of thing.

00:03:41.700 --> 00:03:49.360
And then you can just grab the standard out from set that to be asyncio subprocess dot pipe and so on.

00:03:49.360 --> 00:03:51.640
You can get the results out of it and everything.

00:03:51.640 --> 00:03:58.300
So, you just do things like await creating a subprocess with a shell or execing it and so on.

00:03:58.300 --> 00:04:03.420
And then you can await communicating with it, which I think is pretty cool and so on.

00:04:03.880 --> 00:04:13.640
So, not a whole lot more to say other than if you're doing stuff with subprocess and you're moving already into other areas where async and await are very doable.

00:04:13.640 --> 00:04:22.160
Think FastAPI, SQL model, the SQLAlchemy 1.4 or later, where you're already doing a bunch of other async stuff.

00:04:22.160 --> 00:04:26.620
You know, go ahead and write this in the async way so it just sort of flows into the rest of what you're doing.

00:04:26.620 --> 00:04:27.740
That's pretty cool.

00:04:27.740 --> 00:04:30.780
This is from like 2017.

00:04:30.780 --> 00:04:32.800
It's an older article, isn't it?

00:04:32.800 --> 00:04:33.760
Yeah, it looks like it.

00:04:33.900 --> 00:04:34.280
Yeah, I mean.

00:04:34.280 --> 00:04:34.660
Yeah.

00:04:34.660 --> 00:04:37.740
It's news to me, maybe not news to the world.

00:04:37.740 --> 00:04:40.900
Like Emily said, she was already working with it previously.

00:04:40.900 --> 00:04:42.120
But yeah, I think it's great.

00:04:42.120 --> 00:04:42.340
Right.

00:04:42.340 --> 00:04:48.080
Well, the subprocess communicate is sort of people often shifted over to just run.

00:04:48.080 --> 00:04:50.880
So, I'm hoping there's a run version of that too.

00:04:50.880 --> 00:04:52.780
Yeah, probably is.

00:04:52.780 --> 00:04:54.020
Anyway.

00:04:54.020 --> 00:04:54.540
Cool.

00:04:54.540 --> 00:04:55.280
Indeed.

00:04:55.280 --> 00:04:55.720
All right.

00:04:55.720 --> 00:04:58.340
Well, I'm going to explain some stuff to us, Brian.

00:04:58.340 --> 00:04:58.720
I must.

00:04:58.720 --> 00:05:02.960
I see the author of what you're about to talk about out in the audience as well.

00:05:03.160 --> 00:05:04.160
Yeah, that's also.

00:05:04.160 --> 00:05:05.300
That's very cool.

00:05:05.300 --> 00:05:06.600
Well, this is pretty fun.

00:05:06.600 --> 00:05:07.440
Definitely an exciting one.

00:05:07.440 --> 00:05:07.580
Yeah.

00:05:07.580 --> 00:05:07.920
Yeah.

00:05:07.920 --> 00:05:08.860
So, this comes from.

00:05:08.860 --> 00:05:10.100
This is TypeSplainer.

00:05:10.100 --> 00:05:11.800
And let me explain it to you.

00:05:11.800 --> 00:05:14.740
So, I don't know.

00:05:14.740 --> 00:05:16.180
It's just this cool thing.

00:05:16.180 --> 00:05:17.280
It popped up last week.

00:05:17.480 --> 00:05:18.200
We saw it.

00:05:18.200 --> 00:05:20.340
This is from Arian.

00:05:20.340 --> 00:05:21.380
Sorry.

00:05:21.380 --> 00:05:22.980
Arian Malik Wasi.

00:05:22.980 --> 00:05:26.100
It's a pretty cool name, by the way.

00:05:26.100 --> 00:05:31.980
But so, this is this little neat Heroku app that has you.

00:05:31.980 --> 00:05:33.260
It's pretty simple.

00:05:33.260 --> 00:05:33.540
You.

00:05:33.900 --> 00:05:35.920
Well, I don't know how simple it is behind the scenes.

00:05:35.920 --> 00:05:36.240
But.

00:05:36.240 --> 00:05:37.220
Simple to use.

00:05:37.220 --> 00:05:37.640
To use.

00:05:37.640 --> 00:05:38.300
It's very simple.

00:05:38.300 --> 00:05:42.860
You pop in any sort of Python code that has type hints in it.

00:05:42.860 --> 00:05:47.920
And so, this one has like, for instance, we've got an example up that the default with

00:05:47.920 --> 00:05:52.340
like a callable that takes a stir and an int and a generator.

00:05:52.340 --> 00:05:54.460
And yeah.

00:05:54.460 --> 00:05:56.240
So, there's a bunch of type hints in here.

00:05:56.240 --> 00:05:59.820
This is even like kind of more than most people use all the time.

00:05:59.820 --> 00:06:00.100
But.

00:06:00.100 --> 00:06:01.460
And then you hit TypeSplain.

00:06:01.460 --> 00:06:08.640
And it will show you what the different type hints mean and translate them into English for

00:06:08.640 --> 00:06:08.860
you.

00:06:08.860 --> 00:06:13.220
And it's just pretty, pretty cool.

00:06:13.220 --> 00:06:14.120
I like it.

00:06:14.740 --> 00:06:20.980
One of the things that Wasi said that he was also, when he was developing this, he was

00:06:20.980 --> 00:06:25.540
on his way to developing a Visual Studio code plugin.

00:06:25.540 --> 00:06:33.720
And so, there is a, if you search for TypeSplainer as a VS Code plugin, that functionality is available

00:06:33.720 --> 00:06:35.680
to you right in your editor as well.

00:06:35.680 --> 00:06:37.020
So, this is pretty neat.

00:06:37.020 --> 00:06:37.460
Yeah.

00:06:37.460 --> 00:06:38.020
This is really cool.

00:06:38.020 --> 00:06:43.160
This explanation you have there, like dictionary of list of set of frozen set of, like, oh my

00:06:43.160 --> 00:06:49.280
gosh, the description is something like a dictionary that maps a list of sets of frozen

00:06:49.280 --> 00:06:50.580
sets of integers onto a string.

00:06:50.580 --> 00:06:54.360
Like, that's way more legible and internalizable than.

00:06:54.360 --> 00:06:55.320
Yeah.

00:06:55.320 --> 00:06:57.000
How many brackets deeper we were?

00:06:57.000 --> 00:07:00.720
Four brackets deep in that type information there?

00:07:00.720 --> 00:07:01.160
Yeah.

00:07:01.520 --> 00:07:08.980
It's interesting on Twitter with the announcement of it, or we heard about it through Will McGugan,

00:07:08.980 --> 00:07:09.820
or at least I did.

00:07:09.820 --> 00:07:16.460
And some of the comments were like, not that this isn't cool.

00:07:16.460 --> 00:07:18.000
It was like, oh yeah, this is cool.

00:07:18.000 --> 00:07:21.540
But maybe Python shouldn't be this complicated if you have to explain it.

00:07:21.540 --> 00:07:22.640
But it's...

00:07:22.640 --> 00:07:24.680
Have these people done C++?

00:07:24.680 --> 00:07:25.760
Let me just ask them.

00:07:25.760 --> 00:07:26.200
I know.

00:07:26.200 --> 00:07:32.100
You don't have to use types if you don't want to, but there's a lot of places where types

00:07:32.100 --> 00:07:33.260
are helping out a lot.

00:07:33.260 --> 00:07:37.580
And if you're running into somebody else's code that has some types on there that you're

00:07:37.580 --> 00:07:42.300
not quite sure what that's going on, throw it in TypeSplainer and you'll be able to figure

00:07:42.300 --> 00:07:42.740
it out.

00:07:42.740 --> 00:07:44.280
Absolutely.

00:07:44.280 --> 00:07:45.340
Yeah.

00:07:45.340 --> 00:07:46.260
And I did actually take a look.

00:07:46.260 --> 00:07:46.660
What do you think about this?

00:07:47.100 --> 00:07:47.940
Oh, I think this is awesome.

00:07:47.940 --> 00:07:49.560
I think I absolutely agree.

00:07:49.560 --> 00:07:53.140
Like, you know, mypy has allowed us to do gradual typing and all that.

00:07:53.140 --> 00:07:57.140
But a lot of times you do jump into somebody else's code base and you're like, whoa, these

00:07:57.140 --> 00:07:58.440
are more types than I've ever seen.

00:07:58.440 --> 00:08:01.740
And so being able to kind of convert it really easily is nice.

00:08:01.740 --> 00:08:04.460
And I did actually take a look at how it works under the hood.

00:08:04.460 --> 00:08:08.780
There's a really big if statement of like serialization.

00:08:08.780 --> 00:08:13.360
But then it also, I'm a nerd for anything AST related.

00:08:13.960 --> 00:08:19.580
And so it uses like the mypyParse under the hood, which is actually relatively complex

00:08:19.580 --> 00:08:23.120
for what it needs to handle based on, you know, different Python versions and whatnot.

00:08:23.120 --> 00:08:24.640
Wow, that's pretty awesome.

00:08:24.640 --> 00:08:25.020
Nice.

00:08:25.020 --> 00:08:25.640
Yeah.

00:08:25.640 --> 00:08:30.120
The very first time you were on TalkByth enemy was to talk about the AST, the abstract syntax

00:08:30.120 --> 00:08:30.600
tree, right?

00:08:30.600 --> 00:08:31.120
Yeah.

00:08:31.120 --> 00:08:35.440
It was right around my first conference talk back in the day.

00:08:35.440 --> 00:08:35.800
Yeah.

00:08:35.800 --> 00:08:36.080
Awesome.

00:08:36.080 --> 00:08:36.660
Yeah.

00:08:36.660 --> 00:08:37.440
Way back in the day.

00:08:37.440 --> 00:08:39.480
I think we met in Vancouver to set that up or something.

00:08:39.480 --> 00:08:41.360
When you were up, you know, we met at PyCascades there.

00:08:41.520 --> 00:08:48.080
I generally think of myself as a smart person, but people that can handle doing AST work in

00:08:48.080 --> 00:08:53.640
Python, I'm like, oh my gosh, you know, it's over my head.

00:08:53.640 --> 00:08:55.080
Yeah, that's pretty awesome.

00:08:55.080 --> 00:09:00.040
One thing really quick before we move on, Brian, if you go to the homepage of the typesplainer,

00:09:00.040 --> 00:09:01.160
which is basically the back one.

00:09:01.580 --> 00:09:06.540
So it's got this fairly pathological insane example to show you, like you can take crazy

00:09:06.540 --> 00:09:08.080
stuff and explain it.

00:09:08.080 --> 00:09:08.260
Yeah.

00:09:08.260 --> 00:09:08.460
Yeah.

00:09:08.460 --> 00:09:11.720
But you can type in there, like you can take that code away and put whatever you want in

00:09:11.720 --> 00:09:13.220
there and then hit typesplain.

00:09:13.220 --> 00:09:18.340
So if you just made like a function that just took, you know, yeah, exactly.

00:09:18.340 --> 00:09:20.060
Give it a name and do a dot, dot, dot.

00:09:20.060 --> 00:09:20.320
Yeah.

00:09:20.320 --> 00:09:21.420
Give the function name.

00:09:21.420 --> 00:09:21.860
You'll be good.

00:09:22.620 --> 00:09:23.820
And then you hit typesplain.

00:09:23.820 --> 00:09:27.000
Oh, it needs a function name.

00:09:27.000 --> 00:09:28.360
Oh, I didn't.

00:09:28.360 --> 00:09:29.340
It's not JavaScript.

00:09:29.340 --> 00:09:29.960
Come on.

00:09:29.960 --> 00:09:32.180
Brian knows.

00:09:32.180 --> 00:09:32.580
Yeah.

00:09:34.580 --> 00:09:34.740
Wasi.

00:09:34.740 --> 00:09:38.500
I mean, it's not a super huge explanation of what an integer is, but like you can take

00:09:38.500 --> 00:09:41.360
some random code and drop it and then go explain it to me.

00:09:41.360 --> 00:09:41.600
Yeah.

00:09:41.600 --> 00:09:44.800
I guess now you can also use the VS Code extension, which I haven't seen with.

00:09:44.800 --> 00:09:49.000
Anyway, I thought, I thought this was cool as well and certainly saw a lot of people talking

00:09:49.000 --> 00:09:50.520
about it on Twitter when it came out.

00:09:50.520 --> 00:09:54.040
So, but final thing, I think this is noteworthy as well.

00:09:54.040 --> 00:09:55.340
And I think it's worth mentioning.

00:09:55.340 --> 00:09:57.240
Wasi is just 14.

00:09:57.240 --> 00:10:02.380
So speaking of people like Emily, who can do like AST stuff like crazy, like also, if you

00:10:02.380 --> 00:10:04.260
write this when you're 14, well done.

00:10:04.700 --> 00:10:05.340
You're on your way.

00:10:05.340 --> 00:10:10.120
Plus it's, it's really good looking for something right out of the gate.

00:10:10.120 --> 00:10:11.360
So it looks nice.

00:10:11.360 --> 00:10:11.520
Yeah.

00:10:11.520 --> 00:10:11.900
Awesome.

00:10:11.900 --> 00:10:12.600
Yeah.

00:10:12.600 --> 00:10:16.000
I also think the like architecture of it's really great too.

00:10:16.000 --> 00:10:22.140
So I really like that he embraced sort of building out the tool itself and then building a CLI

00:10:22.140 --> 00:10:25.440
and a web interface and a VS Code extension.

00:10:25.440 --> 00:10:30.840
So I think that is a really great example of how to structure a project like this too.

00:10:30.840 --> 00:10:31.440
Nice.

00:10:31.440 --> 00:10:31.840
Yeah.

00:10:31.840 --> 00:10:32.240
That's awesome.

00:10:33.060 --> 00:10:35.120
Hey, Emily, we lost your screen.

00:10:35.120 --> 00:10:39.900
If you want to share it back or I can just add in while you're working on that.

00:10:39.900 --> 00:10:44.420
Let me just follow up with Sam real quick who pointed out, be super aware of the limitations

00:10:44.420 --> 00:10:45.240
of your hardware.

00:10:45.240 --> 00:10:49.660
When you try to write files in async environments at this project that ground to a halt because

00:10:49.660 --> 00:10:51.440
too many workers are trying to run at once.

00:10:51.440 --> 00:10:52.980
Yes, absolutely.

00:10:52.980 --> 00:10:53.880
Good point, Sam.

00:10:53.980 --> 00:10:59.760
That is generally true for any limited resource that you point async things at, right?

00:10:59.760 --> 00:11:04.220
If you're going like async against a database and a couple of queries will max it out.

00:11:04.220 --> 00:11:07.120
And if you end up hitting it with a hundred queries at the same time, it's not going to

00:11:07.120 --> 00:11:08.060
go faster.

00:11:08.060 --> 00:11:12.560
It's only going to get worse as it like fights for contention and resources and stuff.

00:11:12.900 --> 00:11:18.100
And then on this one, on the typesplainer, Brian Skin says, agreed.

00:11:18.100 --> 00:11:19.200
Very nice work.

00:11:19.200 --> 00:11:20.080
So awesome.

00:11:20.080 --> 00:11:21.420
All right.

00:11:21.420 --> 00:11:22.700
So this is another...

00:11:22.700 --> 00:11:23.300
Emily, you're up for the first one.

00:11:23.300 --> 00:11:23.840
Yeah.

00:11:23.940 --> 00:11:26.340
So this is another one of those like new to me things.

00:11:26.340 --> 00:11:30.460
But Marlene's article just came out and that's how I actually found out about it.

00:11:30.460 --> 00:11:35.480
So Marlene wrote this really excellent introduction to using IBIS for Python programmers.

00:11:35.480 --> 00:11:38.940
IBIS itself has been around for like seven years or so.

00:11:38.940 --> 00:11:42.280
It's a project I think that was started by Wes McKinney.

00:11:42.280 --> 00:11:49.540
But they are a productivity-centered Python data analysis framework for SQL engines and Hadoop.

00:11:49.540 --> 00:11:52.340
So you get a ton of different backends.

00:11:52.500 --> 00:11:58.500
It's going to compile to, you know, basically any flavor of SQL database and then a bunch

00:11:58.500 --> 00:12:00.860
of like more data science focused backends.

00:12:00.860 --> 00:12:06.880
But this popped up on my Twitter feed from Marlene and it's just a really great introduction.

00:12:06.880 --> 00:12:09.920
Also just a really interesting sort of application.

00:12:09.920 --> 00:12:16.640
So she went through and wanted to pull some like art information about a city that she was

00:12:16.640 --> 00:12:19.300
going to visit because she likes to experience the culture of a new city.

00:12:19.300 --> 00:12:25.960
So it just walks through like how to get data into it and then how to interact with it with IBIS.

00:12:25.960 --> 00:12:30.040
So I'll actually switch over to the IBIS documentation.

00:12:31.540 --> 00:12:34.320
Oh, and this is now just different because it's small.

00:12:34.320 --> 00:12:42.880
But yeah, I think I was really interested in it because we have like a pseudo legacy system

00:12:42.880 --> 00:12:49.160
that we're moving all the migrations out of Django and we're actually managing it with a tool

00:12:49.160 --> 00:12:49.860
called Hesura.

00:12:50.540 --> 00:12:56.160
So we're so used to having, you know, Django that's going to use SQLAlchemy and ORM and

00:12:56.160 --> 00:12:58.000
everything just kind of is magic from there.

00:12:58.000 --> 00:13:01.580
And you give it a YAML file and you get seed data, right?

00:13:01.580 --> 00:13:02.680
Right.

00:13:03.020 --> 00:13:07.260
So we're trying to figure out how to manage seed data in like a wildly different environment

00:13:07.260 --> 00:13:10.960
where you have to load it in via like the Hesura CLI tool.

00:13:10.960 --> 00:13:12.860
And you need SQL.

00:13:12.860 --> 00:13:17.040
And I don't want to write SQL, like anything I can possibly do to avoid that.

00:13:17.040 --> 00:13:23.540
So this was a really neat way for getting around needing that modeling.

00:13:24.600 --> 00:13:26.400
So let's see if I can get to this.

00:13:26.400 --> 00:13:26.760
Super cool.

00:13:26.760 --> 00:13:27.740
Yeah.

00:13:27.740 --> 00:13:31.880
It also looks like it integrates with Hadoop and other things that maybe are not direct

00:13:31.880 --> 00:13:33.280
SQL compatible.

00:13:33.280 --> 00:13:35.620
It might need a slightly different query language anyway, right?

00:13:35.620 --> 00:13:36.260
Yeah.

00:13:36.260 --> 00:13:37.080
And it's super interesting.

00:13:37.080 --> 00:13:39.240
So they have a few different ways that it works.

00:13:39.240 --> 00:13:45.500
So it directly will execute pandas and then it compiled in a few different ways to either,

00:13:45.500 --> 00:13:51.660
you know, those SQL databases, Dask, Hadoop, BigQuery, like a bunch of different stuff.

00:13:51.660 --> 00:13:54.400
But yeah, it's not necessarily just going to be straight SQL, but it's going to

00:13:54.400 --> 00:13:55.260
handle that for you.

00:13:55.260 --> 00:14:00.240
So you're really sort of, you know, future proofing yourself away from that.

00:14:00.240 --> 00:14:06.520
But yeah, they just got a ton of like really intelligent ways to filter data and interact

00:14:06.520 --> 00:14:08.340
with data in a really performant way.

00:14:08.340 --> 00:14:13.400
I'm actually going to go back to Marlene's blog post real quick and do some quick scrolls.

00:14:13.400 --> 00:14:19.340
It's also like one of the most hystonic like tools to integrate with SQL that I've seen.

00:14:19.340 --> 00:14:23.240
So she gets to the point where she has this database table.

00:14:23.440 --> 00:14:28.420
So you just tell it, you know, your table name and you set the variable and then you

00:14:28.420 --> 00:14:31.740
can interact with it as if it's just a dictionary.

00:14:31.740 --> 00:14:37.280
So you've got your art table and you want to just pull these columns and you've got it and

00:14:37.280 --> 00:14:37.800
it's there.

00:14:38.480 --> 00:14:45.480
So you would say something like a db.table of quote art and then you say art, you know,

00:14:45.480 --> 00:14:50.840
art equals the art bracket for artists and display and then boom, you get those back.

00:14:50.840 --> 00:14:51.100
Right.

00:14:51.100 --> 00:14:51.320
Yeah.

00:14:51.320 --> 00:14:51.840
That's awesome.

00:14:51.840 --> 00:14:54.280
As a dictionary, I guess or something like that.

00:14:54.280 --> 00:14:54.420
Yeah.

00:14:54.420 --> 00:14:54.780
That's cool.

00:14:55.620 --> 00:14:58.420
So there's a ton of different things that you can do with it.

00:14:58.420 --> 00:15:01.220
I highly recommend checking out their tutorials.

00:15:01.220 --> 00:15:02.920
They've got a ton of different options.

00:15:02.920 --> 00:15:05.720
My favorite one is the geospatial analysis.

00:15:06.840 --> 00:15:11.300
So if you check out their example, they're going to show you how to pull information out

00:15:11.300 --> 00:15:18.380
of a geospatial database and then a really quick way of actually like mapping out the data.

00:15:19.140 --> 00:15:23.180
So if you check out these examples, I know it's not going to come through necessarily on audio,

00:15:23.180 --> 00:15:30.180
but you can, you know, pull information out of these like land plots and then tell it to graph it.

00:15:30.180 --> 00:15:35.900
And it gives you, you know, a really nice looking graph with all the data there in like a whopping

00:15:35.900 --> 00:15:37.200
10 lines of code.

00:15:37.200 --> 00:15:38.180
Wow.

00:15:38.180 --> 00:15:38.840
Yeah.

00:15:38.840 --> 00:15:40.660
Generating that picture in 10 lines of code.

00:15:40.660 --> 00:15:42.540
That's, that's awesome.

00:15:42.540 --> 00:15:43.320
Yeah.

00:15:43.320 --> 00:15:44.040
It's pretty neat.

00:15:44.040 --> 00:15:46.900
It makes me think I should be doing more with geospatial stuff.

00:15:46.900 --> 00:15:49.840
Like I don't do very much because I'm always afraid like, ah, how am I going to graph it?

00:15:49.840 --> 00:15:50.580
What am I going to do?

00:15:50.580 --> 00:15:53.760
Like, but there's a lot of cool layers in that graph and everything.

00:15:53.760 --> 00:15:54.200
That's neat.

00:15:54.200 --> 00:15:54.760
Yep.

00:15:54.760 --> 00:15:55.240
Yeah.

00:15:55.240 --> 00:16:00.800
The API reminds me a little bit of PyMongo actually, where you kind of just say, you know,

00:16:00.800 --> 00:16:02.940
dot and give it the name of things.

00:16:02.940 --> 00:16:05.320
And it's really kind of dynamic in that sense.

00:16:05.320 --> 00:16:06.800
And you get dictionaries back and stuff.

00:16:06.800 --> 00:16:08.180
So yeah.

00:16:08.180 --> 00:16:10.260
But it's different databases, right?

00:16:10.260 --> 00:16:11.000
Right.

00:16:11.000 --> 00:16:11.280
Yeah.

00:16:11.280 --> 00:16:12.820
But I do like that perspective.

00:16:12.820 --> 00:16:19.120
Like it really is kind of taking any database, but especially taking a relational database

00:16:19.120 --> 00:16:24.300
and giving it more of a document oriented interface to it, which is pretty cool.

00:16:24.300 --> 00:16:24.900
Yeah.

00:16:24.900 --> 00:16:25.580
This is cool.

00:16:25.580 --> 00:16:28.920
I definitely want to check this out for, especially for exploration.

00:16:28.920 --> 00:16:32.580
It feels like it's really got a lot of advantages for data scientists.

00:16:32.580 --> 00:16:35.660
Like they're going to fire up a notebook and they're like, I just need to start looking at

00:16:35.660 --> 00:16:36.440
this and playing with it.

00:16:36.440 --> 00:16:38.980
And they don't really want to write queries and then convert that.

00:16:38.980 --> 00:16:39.200
Right.

00:16:39.500 --> 00:16:44.200
Well, it also looks like, as far as I can tell, it looks like both in this article and

00:16:44.200 --> 00:16:53.080
in one of the tutorials on the main webpage is that there's a good relation, almost a one

00:16:53.080 --> 00:16:56.620
to one relationship between SQL, things you can do in SQL and things you can do here.

00:16:56.620 --> 00:17:03.800
So that people already familiar with SQL can transfer over pretty easily.

00:17:03.800 --> 00:17:05.260
So that's pretty neat.

00:17:05.260 --> 00:17:05.600
Absolutely.

00:17:05.600 --> 00:17:06.660
Yeah.

00:17:06.660 --> 00:17:07.360
This is a nice find.

00:17:07.940 --> 00:17:10.860
All right, Brian, before we move on, can I take a second and tell you about our sponsor?

00:17:10.860 --> 00:17:11.120
Yes.

00:17:11.120 --> 00:17:11.860
Very excited about this.

00:17:11.860 --> 00:17:14.180
I think it's a big opportunity for people.

00:17:14.180 --> 00:17:17.120
So let me tell you about Microsoft for Startups Founders Hub.

00:17:17.120 --> 00:17:22.260
This episode of Python Bytes is brought to you by Microsoft for Startups Founders Hub.

00:17:22.260 --> 00:17:24.200
Starting a business is hard.

00:17:24.200 --> 00:17:29.120
By some estimates, over 90% of startups will go out of business in just their first year.

00:17:29.120 --> 00:17:34.720
With that in mind, Microsoft for Startups set out to understand what startups need to be successful

00:17:34.720 --> 00:17:38.500
and to create a digital platform to help them overcome those challenges.

00:17:38.500 --> 00:17:41.180
Microsoft for Startups Founders Hub was born.

00:17:41.180 --> 00:17:47.840
Founders Hub provides all founders at any stage with free resources to solve their startup challenges.

00:17:47.840 --> 00:17:56.440
The platform provides technology benefits, access to expert guidance and skilled resources, mentorship and networking connections, and much more.

00:17:56.440 --> 00:18:05.840
Unlike others in the industry, Microsoft for Startups Founders Hub doesn't require startups to be investor-backed or third-party validated to participate.

00:18:05.840 --> 00:18:08.540
Founders Hub is truly open to all.

00:18:08.540 --> 00:18:10.020
So what do you get if you join them?

00:18:10.020 --> 00:18:18.280
You speed up your development with free access to GitHub and Microsoft Cloud computing resources and the ability to unlock more credits over time.

00:18:18.280 --> 00:18:28.000
To help your startup innovate, Founders Hub is partnering with innovative companies like OpenAI, a global leader in AI research and development, to provide exclusive benefits and discounts.

00:18:28.000 --> 00:18:33.160
Through Microsoft for Startups Founders Hub, becoming a founder is no longer about who you know.

00:18:33.160 --> 00:18:46.720
You'll have access to their mentorship network, giving you a pool of hundreds of mentors across a range of disciplines and areas like idea validation, fundraising, management and coaching, sales and marketing, as well as specific technical stress points.

00:18:46.720 --> 00:18:51.920
You'll be able to book a one-on-one meeting with the mentors, many of whom are former founders themselves.

00:18:51.920 --> 00:18:57.060
Make your idea a reality today with the critical support you'll get from Founders Hub.

00:18:57.160 --> 00:19:03.480
To join the program, just visit pythonbytes.fm/foundershub, all one word, no links in your show notes.

00:19:03.480 --> 00:19:05.700
Thank you to Microsoft for supporting the show.

00:19:05.700 --> 00:19:08.780
Yeah, so $150,000 credit people get.

00:19:08.780 --> 00:19:12.700
So if you're doing a startup, you know, that would have been awesome when I was trying to do a startup.

00:19:12.700 --> 00:19:18.000
Now, this next thing I want to tell you about, I think, I think this kind of lives in your wheelhouse as well.

00:19:18.000 --> 00:19:22.720
And keeping with the theme of the show, this one is recommended by Will McGugan.

00:19:22.720 --> 00:19:24.880
So thank you, Will, for all the good ideas.

00:19:25.300 --> 00:19:31.460
I know you're out there scouring the internet for all sorts of cool things to use on textual and rich and whatnot.

00:19:31.460 --> 00:19:35.280
And this is one of the ones they said they are going to start testing on.

00:19:35.280 --> 00:19:37.460
And that has to do with performance.

00:19:37.460 --> 00:19:44.180
So the topic or the library is airspeed, velocity or ASV and the pip nomenclature.

00:19:44.720 --> 00:19:54.760
And the idea is basically setting up profiling and performance as a thing that you can measure over the lifetime of your project rather than a thing that you measure when you feel like,

00:19:54.760 --> 00:19:55.480
oh, it's slow.

00:19:55.480 --> 00:19:57.440
I need to go figure out why it's slow for now.

00:19:57.700 --> 00:20:02.400
So as you automatically do, as you do check-ins, as you know, like CI runs and stuff like that.

00:20:02.400 --> 00:20:06.960
So probably the best way to see this is to just like pick on an example.

00:20:06.960 --> 00:20:14.360
So if you go to the link in the show notes, airspeed, velocity, there's a thing that says, see examples for AstroPy, NumPy, SciPy.

00:20:14.360 --> 00:20:15.480
I'll pick up AstroPy.

00:20:16.000 --> 00:20:17.360
And you get all these graphs.

00:20:17.360 --> 00:20:24.220
So each one of these graphs here is the performance of some aspect of AstroPy over time.

00:20:24.220 --> 00:20:25.360
How cool is this?

00:20:25.360 --> 00:20:26.040
Look at that.

00:20:26.040 --> 00:20:27.120
That's pretty cool.

00:20:27.120 --> 00:20:31.120
And if you hover over it, it shows you the code that runs that scenario.

00:20:31.120 --> 00:20:31.980
Wow.

00:20:31.980 --> 00:20:32.600
Yeah.

00:20:32.600 --> 00:20:36.220
And, you know, this is a sample, this is a sample.

00:20:36.220 --> 00:20:37.540
And then they did a huge improvement.

00:20:37.540 --> 00:20:44.020
You can see there are like two massive refactorings on the sky coordinate benchmarks, you know, scalar, whatever this is.

00:20:44.020 --> 00:20:44.480
Right.

00:20:44.540 --> 00:20:47.520
This particular test they did there, it goes along pretty steady state.

00:20:47.520 --> 00:20:52.540
And then there's a big drop and a little spike up and then another big drop and then steady state for a long time.

00:20:52.540 --> 00:20:58.400
So wouldn't it be cool to have these different views into your system about like how it's performing over time?

00:20:58.400 --> 00:20:59.360
Yeah.

00:20:59.360 --> 00:21:00.660
So lower is better, right?

00:21:00.660 --> 00:21:02.300
I believe lower is better.

00:21:02.300 --> 00:21:02.580
Yeah.

00:21:02.580 --> 00:21:03.600
I think lower is better.

00:21:03.600 --> 00:21:05.440
You can pull up regressions.

00:21:05.440 --> 00:21:07.440
You can say, okay, well, what got worse?

00:21:07.440 --> 00:21:12.860
Like, for example, timetable outputter got 35 times slower.

00:21:13.060 --> 00:21:14.780
So that might want some attention.

00:21:14.780 --> 00:21:22.680
And it lists the GitHub commit or really technically, I suppose it just lists the git commit, which is probably on GitHub, which is on GitHub.

00:21:23.220 --> 00:21:28.420
So that you can actually say, this is the code that changed that made it go 35 times slower.

00:21:28.420 --> 00:21:29.080
Wow.

00:21:29.080 --> 00:21:30.100
That's neat, I think.

00:21:31.360 --> 00:21:41.600
I think one of the other challenges here is what about, what if you wanted this information, but you're only now learning about this project, right?

00:21:41.600 --> 00:21:46.680
You're only like now realizing, wouldn't it be great to have these graphs?

00:21:46.680 --> 00:21:48.860
How do you get those graphs back in history?

00:21:49.080 --> 00:21:57.460
So Will pointed out that you can actually connect it with your git repository and it will check out older versions and run it.

00:21:57.460 --> 00:22:06.840
It'll like roll back in time and go across different versions and different versions of Python and generate those graphs for you, even if you just pick it up now.

00:22:06.920 --> 00:22:07.600
That's awesome.

00:22:07.600 --> 00:22:11.440
Any idea of if it's like restricted to packages or if you can also apply this to general projects?

00:22:11.440 --> 00:22:13.380
I think you can apply it to general projects.

00:22:13.380 --> 00:22:15.920
I don't remember where I saw it.

00:22:15.920 --> 00:22:17.060
I got to pull it back up here.

00:22:17.060 --> 00:22:19.380
Somehow I've escaped the main part.

00:22:19.960 --> 00:22:32.380
But yeah, I think if you look at the using airspeed, you basically come up with a configuration file that says, you know, this particular project with these settings.

00:22:32.380 --> 00:22:34.180
And then here's like the run command.

00:22:34.180 --> 00:22:35.620
You come up with one of these test suites.

00:22:35.620 --> 00:22:41.860
I don't think it has any tie into packages per se because I think it goes against git, not against PyPI.

00:22:41.860 --> 00:22:42.580
Yeah.

00:22:42.580 --> 00:22:43.240
Yeah.

00:22:43.240 --> 00:22:44.360
So pretty neat.

00:22:44.360 --> 00:22:45.480
People can check that out.

00:22:45.480 --> 00:22:49.900
But like here you can specify like which versions of Python or is this 2.7 stuff?

00:22:49.900 --> 00:22:50.980
I don't know.

00:22:50.980 --> 00:22:54.040
But yeah, so you can run it against all those old versions.

00:22:54.040 --> 00:22:55.700
You can configure how it runs and so on.

00:22:55.700 --> 00:22:56.280
Okay.

00:22:56.280 --> 00:23:09.140
So you can even you can set up like since you're defining what's being timed, you can you can time large things like a particular workflow through lots of bits of code first.

00:23:09.140 --> 00:23:10.200
Things like that.

00:23:10.200 --> 00:23:10.820
Yeah, exactly.

00:23:10.820 --> 00:23:15.780
So you basically come up with a couple of scenarios of what you would want to do that you're going to run against.

00:23:15.780 --> 00:23:21.820
Here you can see like you can benchmark against like tags and things like that and git or branches.

00:23:21.820 --> 00:23:22.480
Yeah.

00:23:22.480 --> 00:23:22.980
Yeah.

00:23:22.980 --> 00:23:24.640
So Will says he ran it.

00:23:24.640 --> 00:23:27.020
Let's pop his up.

00:23:27.020 --> 00:23:30.680
Ran it against two years worth of rich releases.

00:23:30.680 --> 00:23:31.760
That's cool.

00:23:31.760 --> 00:23:33.440
And found a performance regression.

00:23:33.440 --> 00:23:34.160
Nice work.

00:23:34.160 --> 00:23:36.520
I love it.

00:23:36.520 --> 00:23:38.580
Optimizations that made rich slower.

00:23:38.580 --> 00:23:39.320
Isn't that true?

00:23:39.320 --> 00:23:40.620
Like this is going to make it better.

00:23:40.620 --> 00:23:40.920
No.

00:23:40.920 --> 00:23:42.960
Yeah.

00:23:42.960 --> 00:23:44.660
So pretty cool.

00:23:44.660 --> 00:23:50.920
And have to give a nice shout out to the full embracing of the my Python reference.

00:23:50.920 --> 00:23:57.820
If you go back to the AstroPy version in the top left corner, it says airspeed velocity even unladen.

00:23:57.820 --> 00:23:58.560
Oh, yeah.

00:23:58.560 --> 00:23:59.320
I did notice that.

00:23:59.320 --> 00:23:59.920
That's awesome.

00:23:59.920 --> 00:24:00.800
It's nice.

00:24:00.800 --> 00:24:02.100
Yeah.

00:24:02.100 --> 00:24:02.640
Very cool.

00:24:02.640 --> 00:24:04.240
Well, yeah.

00:24:04.240 --> 00:24:05.020
Thanks for sending that over.

00:24:05.020 --> 00:24:07.240
Well, yeah, I got some projects.

00:24:07.240 --> 00:24:08.080
I'd like to do that on.

00:24:08.080 --> 00:24:13.200
But speaking of testing things, this one comes from Anthony Shaw.

00:24:13.200 --> 00:24:14.580
This is Perflint.

00:24:14.580 --> 00:24:22.540
So this is a this is a pilot extension to check for performance anti patterns.

00:24:22.540 --> 00:24:25.760
And it's Tony somewhere.

00:24:25.760 --> 00:24:26.300
Anthony.

00:24:26.300 --> 00:24:29.060
Some guy named Anthony Shaw.

00:24:29.060 --> 00:24:29.680
Anthony Shaw.

00:24:29.680 --> 00:24:30.660
I thought we mentioned him.

00:24:30.660 --> 00:24:31.300
Tony Baloney.

00:24:31.300 --> 00:24:32.780
Says.

00:24:32.780 --> 00:24:33.480
Oh, here it is.

00:24:33.480 --> 00:24:35.200
Project is an early beta.

00:24:35.200 --> 00:24:38.160
It will likely raise many false positives.

00:24:38.880 --> 00:24:50.760
So I'm thinking that might be why he went went with an extension to pilot instead of like an extension to PyFlix because or flicate because pilot gives lots of false positives.

00:24:50.760 --> 00:24:55.260
No, at least in my experience with pilot.

00:24:55.260 --> 00:25:02.500
It is takes some configuration to get happy with it because it will show you things that maybe you're OK with.

00:25:02.500 --> 00:25:08.180
Like I threw pilot against some demo code that I have for like teaching people stuff.

00:25:08.460 --> 00:25:13.820
And I'm using short variable names like, you know, X and Y and things like that.

00:25:13.820 --> 00:25:20.080
And one of the one of the restrictions for pilot is you have to have almost most everything has to be three characters or longer.

00:25:20.760 --> 00:25:23.880
And, you know, for production code, that's probably fine.

00:25:23.880 --> 00:25:26.500
But if you have different rules, you can change that.

00:25:26.500 --> 00:25:27.740
But back to this.

00:25:27.740 --> 00:25:39.640
I really like I like the idea of having something look over my shoulder and look at performance problems because I I'm an advocate for don't solve performance problems unless you find that there's a performance problem.

00:25:39.640 --> 00:25:42.080
So don't do premature optimization.

00:25:42.720 --> 00:25:56.480
However, having some things are just kind of slow that you should get out of the habit of doing like when using list in a for loop, if the thing that you're using a list of already is an iterable.

00:25:56.480 --> 00:26:07.420
That's that's a big performance hit if it's a huge thing, if it's because that turns an iterate iterable or a generator into an entire list.

00:26:07.420 --> 00:26:08.320
It creates the list.

00:26:08.320 --> 00:26:09.260
You don't need to do that.

00:26:09.260 --> 00:26:10.840
So that's a that's a big one.

00:26:10.840 --> 00:26:13.940
Anyway, there's a whole bunch of different things that checks for.

00:26:13.940 --> 00:26:24.480
And I like the idea of just as you're writing code and as you're test, you know, running this and and trying to figure out if, you know, there's problems with it.

00:26:24.480 --> 00:26:27.100
You can kind of get out of the habit of doing some of these things.

00:26:27.100 --> 00:26:28.640
So, yeah, these are nice.

00:26:28.640 --> 00:26:32.320
It'll catch just some of the things you might think you need to do.

00:26:32.320 --> 00:26:35.480
You're not super experienced with or whatever.

00:26:35.480 --> 00:26:35.840
Right.

00:26:35.840 --> 00:26:36.080
Yeah.

00:26:36.080 --> 00:26:42.500
Like one of the things here is a error W201 8201, which is loop invariant statement.

00:26:43.040 --> 00:26:50.880
And this is one of that's kind of interesting is like there is an example of taking the length of something within a loop.

00:26:50.880 --> 00:26:55.740
And if that never changes within the loop, don't do the length in the loop.

00:26:55.740 --> 00:26:56.760
Take it out of the loop.

00:26:56.960 --> 00:26:57.520
Those are.

00:26:57.520 --> 00:26:58.360
Yeah, there are.

00:26:58.360 --> 00:26:58.760
Exactly.

00:26:58.760 --> 00:27:12.440
There's a few examples that you like you might not notice right away, especially if you've taken something that was a linear some linear code that you kind of added it inside of a loop and indented it over.

00:27:12.440 --> 00:27:13.500
And now it's in a loop.

00:27:13.900 --> 00:27:18.340
You might forget that some of the stuff inside might not might maybe shouldn't be in the loop.

00:27:18.340 --> 00:27:21.200
So, yeah, this example here, you're doing it 10,000.

00:27:21.200 --> 00:27:22.780
You're doing a loop 10,000 times.

00:27:22.780 --> 00:27:27.340
And every time you're asking the length of this thing that is defined outside the loop and is unchanging.

00:27:27.340 --> 00:27:32.860
So you're basically doing it 10,000, 9,999 times more than necessary.

00:27:32.860 --> 00:27:33.280
Yeah.

00:27:33.280 --> 00:27:33.660
Yeah.

00:27:33.660 --> 00:27:35.440
So kind of fun.

00:27:35.440 --> 00:27:36.500
I'm going to give it a shot.

00:27:36.500 --> 00:27:39.340
See what I think in as using it.

00:27:39.340 --> 00:27:40.640
So, yeah, definitely.

00:27:40.860 --> 00:27:46.120
Emily, do you use some of these linters or anything like this that give you warnings?

00:27:46.120 --> 00:27:47.260
Yeah.

00:27:47.260 --> 00:27:48.000
Yeah.

00:27:48.000 --> 00:27:51.680
I mean, I think we mostly use Playgate, but I'm definitely curious to try this out, too.

00:27:51.680 --> 00:27:58.280
I can see how this would be tricky to get really consistent errors for these things.

00:27:58.280 --> 00:28:01.920
So props to Tony Bologna for taking it out.

00:28:01.920 --> 00:28:02.300
Well done.

00:28:02.300 --> 00:28:03.060
Yeah, this is exciting.

00:28:03.060 --> 00:28:04.320
I'm glad to see this coming out.

00:28:04.320 --> 00:28:09.120
I know he was talking about it, but I didn't see actually anything on GitHub yet or anything.

00:28:09.120 --> 00:28:10.420
So, yeah, very well done.

00:28:11.280 --> 00:28:12.020
Yeah, this is cool.

00:28:12.020 --> 00:28:19.100
I like stuff like this that really takes you to that next level of like, this is something that somebody would hopefully notice in a code review.

00:28:19.100 --> 00:28:20.620
But if you can automate it.

00:28:20.620 --> 00:28:21.600
Yeah, I think that's a great point.

00:28:21.600 --> 00:28:35.460
I think a lot of these things that would have to be a discussion during a code review, if they could be automated and you could save the code review for meaningful stuff like security or, you know, like, how are we going to version this over time?

00:28:35.460 --> 00:28:36.240
And it's going to be tricky.

00:28:36.240 --> 00:28:39.260
Like, are you really storing pickles in the database?

00:28:39.260 --> 00:28:40.920
Let's not, you know, stuff like that.

00:28:40.920 --> 00:28:41.160
Yeah.

00:28:41.160 --> 00:28:42.040
All right.

00:28:42.040 --> 00:28:47.260
Pep 594 has been accepted, which is super exciting.

00:28:47.420 --> 00:28:48.380
So, Pep 594.

00:28:48.380 --> 00:28:53.040
If you don't know what that is, it's a Python enhancement proposal.

00:28:53.040 --> 00:28:57.260
So, a proposed change to the Python language itself.

00:28:57.260 --> 00:29:00.920
And so, this one is removing dead batteries from the standard library.

00:29:01.160 --> 00:29:04.780
It was written by Christian Himes and Brett Cannon.

00:29:04.780 --> 00:29:09.380
I think I saw a tweet from Brett saying that it had been accepted.

00:29:09.380 --> 00:29:15.760
So, this is just really exciting for anyone who's followed along with any of this discussion.

00:29:15.760 --> 00:29:17.840
It's been a long time coming.

00:29:17.840 --> 00:29:23.780
I think there was a major discussion about it at PyCon US 2019.

00:29:23.780 --> 00:29:25.040
It must have been.

00:29:25.540 --> 00:29:27.460
And shortly after that, there was a PEP.

00:29:27.460 --> 00:29:39.840
But it's been since then that it's kind of been off and on in discussion and finally figuring out what is going to be the thing that really works for everyone and for the future of the language.

00:29:40.700 --> 00:29:44.080
So, this is going to be targeting version 3.11.

00:29:44.080 --> 00:29:48.740
So, just a quick recap of the release plan for that.

00:29:48.740 --> 00:29:52.560
Development on 3.11 will start this May.

00:29:52.560 --> 00:29:53.380
So, May 2021.

00:29:53.380 --> 00:29:59.300
The final release, even for 3.11, is not until October 2022.

00:29:59.300 --> 00:30:02.220
And even then, this is just going to be deprecating modules.

00:30:02.220 --> 00:30:05.540
So, it'll be deprecations in 3.11 and 3.12.

00:30:05.700 --> 00:30:12.140
And it's not until 3.13 that it will actually be fully removed from the language itself.

00:30:12.140 --> 00:30:21.320
So, you can kind of get a glimpse into how long of a process this is and how big of a decision it was to get everyone on board.

00:30:21.320 --> 00:30:23.840
Yeah, it didn't look at all like anything rushed.

00:30:23.840 --> 00:30:29.600
When I went through and read this, it was like, here's the things that we think we can take out.

00:30:29.600 --> 00:30:30.480
Here's why.

00:30:30.480 --> 00:30:36.400
There's a table in there that shows third-party alternatives to certain things.

00:30:36.400 --> 00:30:38.340
Mostly, yeah, that's the one.

00:30:38.340 --> 00:30:40.700
So, there's certain things in here.

00:30:40.700 --> 00:30:45.440
You're just like, you know, that probably isn't needed or it's really superseded.

00:30:45.440 --> 00:30:46.360
So, there's pipes.

00:30:46.360 --> 00:30:50.280
But then we also have subprocess, which will take care of that.

00:30:50.280 --> 00:30:51.440
And that's a built-in one.

00:30:51.440 --> 00:30:54.080
And then async core.

00:30:54.080 --> 00:30:55.760
Just use async.io.

00:30:55.940 --> 00:30:57.060
But then there's other ones.

00:30:57.060 --> 00:31:00.020
There's a bunch in here I've never even heard of.

00:31:00.020 --> 00:31:01.440
Yeah, that's the thing, right?

00:31:01.440 --> 00:31:03.140
There's one called Crypt.

00:31:03.140 --> 00:31:08.220
And it's like, look, just use Passlib or Argon or Hashlib or anything that is better and modern.

00:31:08.220 --> 00:31:10.040
You know, this was from 1994.

00:31:10.040 --> 00:31:14.520
Cryptography is not exactly the same as it was then.

00:31:14.520 --> 00:31:17.380
So, you know, maybe it makes sense to take it out, right?

00:31:17.380 --> 00:31:18.140
Yeah.

00:31:18.140 --> 00:31:19.840
I guess.

00:31:19.840 --> 00:31:20.620
Yeah.

00:31:20.620 --> 00:31:24.180
Yeah, I think it's a really like, it's a thin line to walk, right?

00:31:24.300 --> 00:31:31.300
Like, some people are using these and some of these modules maybe didn't have a lot of like maintenance over time.

00:31:31.300 --> 00:31:37.240
But that also meant that there wasn't somebody watching it for bugs or security vulnerabilities or anything like that.

00:31:37.240 --> 00:31:47.580
So, the balance of is it worth pulling it out if somebody was relying on it versus the maintenance cost or the lack of maintenance that could really.

00:31:47.580 --> 00:31:48.840
Yeah, it's a liability, right?

00:31:48.880 --> 00:31:50.380
There's a CGI library.

00:31:50.380 --> 00:31:52.360
That's something else.

00:31:52.360 --> 00:31:54.260
That takes you back from 95.

00:31:54.260 --> 00:31:55.880
Yeah, that's how I started.

00:31:55.880 --> 00:31:57.600
But not with Python.

00:31:57.600 --> 00:32:00.060
I was doing CGI with Perl way back in 95.

00:32:00.060 --> 00:32:01.960
Yeah, that does go back.

00:32:01.960 --> 00:32:07.760
It also talks about whether that bit of code has a maintainer and whether that maintainer is active.

00:32:07.760 --> 00:32:09.940
For example, CGI has no maintainer.

00:32:09.940 --> 00:32:10.940
Like, no one wants that.

00:32:11.480 --> 00:32:15.500
One of the things that's interesting here is you could take this code and you could still use it.

00:32:15.500 --> 00:32:18.240
You could vendor it into your code, right?

00:32:18.240 --> 00:32:19.880
Yeah, now you're the maintainer.

00:32:19.880 --> 00:32:20.660
Yeah.

00:32:20.660 --> 00:32:21.400
Yeah, exactly.

00:32:21.400 --> 00:32:22.220
It's all yours.

00:32:22.220 --> 00:32:22.800
You can have that.

00:32:22.800 --> 00:32:30.660
But you could just go to CPython on GitHub, get that module, copy it over, and now you kind of still have that functionality.

00:32:30.900 --> 00:32:32.220
Just, you're taking it on.

00:32:32.220 --> 00:32:38.740
I expect maybe one or two of these might end up in their own GitHub repository as a package that is maintained.

00:32:38.740 --> 00:32:40.320
They did talk about that, right, Emily?

00:32:40.320 --> 00:32:43.700
About that being one of the possible paths they decided against.

00:32:43.700 --> 00:33:02.480
Yeah, that was like the big conversation back at the Language Summit in 2019 was, you know, could we get libraries on a, you know, more independent release schedule and pull them out of the standard library entirely and just have them be sort of their own standalone thing?

00:33:02.920 --> 00:33:12.360
Which, as I have briefly outlined since the release schedule for 3.11, you can see that it is on like a very long scale timeframe.

00:33:12.360 --> 00:33:14.180
So, I definitely agree.

00:33:14.180 --> 00:33:21.960
I think that some of these that people are still using, people are either going to go in there and grab the code and hopefully grab the license with it as well.

00:33:21.960 --> 00:33:28.180
Or they're just going to become, you know, modules that enough people care about that live on their own in PyPI.

00:33:28.180 --> 00:33:32.940
I don't see anything here that I would miss, but that doesn't mean that there's not people using them, you know.

00:33:32.940 --> 00:33:43.960
So, on the good side, I mean, it totally makes sense to like remove things, especially stuff that's not getting maintained and there's no maintainer and that possibly has bugs in it now.

00:33:43.960 --> 00:33:44.940
Nobody knows.

00:33:44.940 --> 00:33:50.760
But, like, what are some of the good aspects, other good aspects?

00:33:50.760 --> 00:33:56.240
Is it going to make the library or the Python standard or the install smaller?

00:33:56.240 --> 00:34:00.560
Or, I mean, you'd think, anybody know the numbers on that?

00:34:00.560 --> 00:34:01.180
Okay.

00:34:01.180 --> 00:34:03.060
I don't know the numbers on that.

00:34:03.060 --> 00:34:04.380
But that is something interesting to look at.

00:34:04.380 --> 00:34:06.460
I would say the biggest change is, like, maintenance.

00:34:06.460 --> 00:34:12.660
Just no one has to worry about whether there's a bug in CGI that someone discovers because it's just not there.

00:34:12.660 --> 00:34:13.200
Yeah.

00:34:13.200 --> 00:34:14.120
Yeah.

00:34:14.460 --> 00:34:14.860
Yeah.

00:34:14.860 --> 00:34:20.540
And especially with CPython, there's often a very big, like, barrier to entry.

00:34:20.540 --> 00:34:27.800
So, like, if a CGI bug was even filed by somebody, where would you start to debug it and reproduce it sort of thing?

00:34:27.800 --> 00:34:29.200
Right.

00:34:29.200 --> 00:34:33.500
And then the other thing, too, is maybe somebody else goes through the effort to fix it.

00:34:33.900 --> 00:34:38.160
But it always takes a core dev to review that PR and get it merged in.

00:34:38.160 --> 00:34:43.140
And so a lot of times, if you don't have an owner of a module, it's just not going to get a lot of attention.

00:34:43.140 --> 00:34:51.820
So as a whole, it should be hopefully an impact on how we interpret core developer time.

00:34:51.820 --> 00:34:55.700
Because right now, I think we're at, like, over 1,000 PRs open on GitHub.

00:34:56.820 --> 00:35:00.940
So a lot of times, you know, it's not just core developers writing code.

00:35:00.940 --> 00:35:07.700
And a lot of times, you can have even more of an impact being that person that, you know, tries to review PRs and keep that number down.

00:35:07.700 --> 00:35:13.100
Brian, out in the audience, points out that the comment threads on discuss.python and elsewhere are really interesting.

00:35:13.100 --> 00:35:16.440
If you want to see examples of these old modules still in use.

00:35:16.440 --> 00:35:17.060
Yeah.

00:35:17.060 --> 00:35:17.920
Yeah.

00:35:17.920 --> 00:35:18.960
I've got a couple of them here.

00:35:18.960 --> 00:35:21.040
I think I linked them in the show notes.

00:35:21.040 --> 00:35:22.660
But if they're not there, I'll make sure it's in there.

00:35:22.660 --> 00:35:22.980
Nice.

00:35:22.980 --> 00:35:23.160
Yeah.

00:35:23.160 --> 00:35:25.660
You got a link to Brett's discussion there.

00:35:25.660 --> 00:35:26.020
That's cool.

00:35:26.280 --> 00:35:27.400
No, I think this is good.

00:35:27.400 --> 00:35:27.900
I think this is good.

00:35:27.900 --> 00:35:29.720
And quick shout out to a new theme, right?

00:35:29.720 --> 00:35:31.040
Yeah.

00:35:31.040 --> 00:35:33.160
So it's a brand new PEP site.

00:35:33.160 --> 00:35:34.920
So it's PEP.python.org.

00:35:34.920 --> 00:35:37.180
And there's this really lovely theme on it.

00:35:37.180 --> 00:35:38.260
It's really clean and modern.

00:35:38.260 --> 00:35:40.940
You've got a nice dark theme here as well.

00:35:40.940 --> 00:35:41.060
Cool.

00:35:41.060 --> 00:35:42.580
Yeah, I noticed the dark theme.

00:35:42.580 --> 00:35:42.940
That was cool.

00:35:42.940 --> 00:35:45.800
And I think it even auto adapts to the time of day, which is great.

00:35:45.800 --> 00:35:47.600
Brian, is that it for all of our main items?

00:35:47.600 --> 00:35:48.520
I think it is.

00:35:48.520 --> 00:35:49.840
It is.

00:35:49.840 --> 00:35:51.380
Do you have anything extra for us?

00:35:51.380 --> 00:35:53.580
Would it surprise you if I said no?

00:35:53.580 --> 00:35:54.280
Yeah, it would.

00:35:54.280 --> 00:35:54.740
Nothing extra.

00:35:54.740 --> 00:35:55.340
I know.

00:35:55.340 --> 00:35:56.800
I always have like 10 extra things.

00:35:56.800 --> 00:35:58.520
No, I don't have anything extra this week.

00:35:58.520 --> 00:35:58.900
Oh, really?

00:35:58.900 --> 00:35:59.820
Yeah.

00:35:59.820 --> 00:36:00.660
Nice.

00:36:00.660 --> 00:36:01.020
Nice.

00:36:01.020 --> 00:36:01.340
Okay.

00:36:01.340 --> 00:36:02.280
How about you, Emily?

00:36:02.280 --> 00:36:02.980
Cool.

00:36:02.980 --> 00:36:05.280
Yeah, I've got a couple of extra things.

00:36:05.720 --> 00:36:10.240
So as I was prepping for this, I looked at, I think it was just the most recent episode

00:36:10.240 --> 00:36:10.920
before this one.

00:36:10.920 --> 00:36:19.340
There was a blog post that I think Brian shared on like a better get flow that basically was

00:36:19.340 --> 00:36:25.000
saying like, commit all your stuff, reset everything, and then recommit everything once

00:36:25.000 --> 00:36:26.980
you're like ready to make a clean PR.

00:36:27.640 --> 00:36:29.420
And so I wanted to share this as well.

00:36:29.420 --> 00:36:33.740
This is one of my favorite tools that I learned about probably a few months ago.

00:36:33.740 --> 00:36:35.440
Again, it's 2015.

00:36:35.440 --> 00:36:38.120
Not a new thing, but new to me.

00:36:38.960 --> 00:36:44.380
So you can do auto squashing of git commits when you're interactive rebasing.

00:36:44.740 --> 00:36:50.280
So essentially, if you've got a ton of different commits, and you realize, oh, like, I had

00:36:50.280 --> 00:36:55.140
a style commit, commit for styling all my new stuff, a few commits back, but like, I want

00:36:55.140 --> 00:36:56.340
to make this one more change.

00:36:56.340 --> 00:37:02.300
Instead of needing to, you know, rebase immediately or remember to, you know, stage it in a certain

00:37:02.300 --> 00:37:06.340
way in the future, you can actually go ahead and just commit one more time.

00:37:06.340 --> 00:37:10.620
And then you flag that commit that you're making with the fix up flag.

00:37:10.620 --> 00:37:16.360
So it's just dash, dash, fix up, and then you tell it the commit that you're wanting

00:37:16.360 --> 00:37:17.500
to sort of amend.

00:37:17.500 --> 00:37:20.720
So you can just keep working like that, make it fix up commits.

00:37:20.720 --> 00:37:26.920
And then the only thing that you do right before you PR is you tell it to rebase with auto

00:37:26.920 --> 00:37:27.320
squashing.

00:37:27.320 --> 00:37:32.280
So once you do that interactive rebase with auto squash, it's going to find all those fix

00:37:32.280 --> 00:37:32.880
up commits.

00:37:32.880 --> 00:37:38.060
And, you know, when you interact with rebase, you often have to like, move commits around and

00:37:38.060 --> 00:37:39.800
tell it to squash into the previous commit.

00:37:39.800 --> 00:37:41.100
You've got to get it in the right order.

00:37:41.100 --> 00:37:43.440
This handles all of it for you.

00:37:43.440 --> 00:37:48.660
And anything that's flag with a fix up, it finds that commit ID and auto squashes it back

00:37:48.660 --> 00:37:48.900
in.

00:37:48.900 --> 00:37:56.020
So you get a really, really clean history without having to like, redo all of your like, commit

00:37:56.020 --> 00:37:57.440
work that you had done a lot of the way.

00:37:57.440 --> 00:37:57.880
Yeah, that's really nice.

00:37:57.880 --> 00:37:59.280
And this looks built into Git.

00:37:59.280 --> 00:38:00.080
Yeah.

00:38:00.080 --> 00:38:02.320
I've never heard of auto squashing.

00:38:02.320 --> 00:38:04.640
I've definitely never used it, but it looks really useful.

00:38:04.640 --> 00:38:05.260
Yeah.

00:38:05.260 --> 00:38:05.760
Thank you.

00:38:05.760 --> 00:38:06.400
Yeah.

00:38:06.400 --> 00:38:06.660
All right.

00:38:06.660 --> 00:38:07.220
What's your next one?

00:38:07.220 --> 00:38:07.700
Yeah.

00:38:08.480 --> 00:38:08.840
Yeah.

00:38:08.840 --> 00:38:10.780
And then a couple, couple other cool ones.

00:38:10.780 --> 00:38:16.520
There was a tweet from Dustin Ingram about an award that the Python Software Foundation

00:38:16.520 --> 00:38:17.640
actually received.

00:38:17.640 --> 00:38:26.460
It's from the Annie Awards, which is, you know, animation version of the Academy Awards sort

00:38:26.460 --> 00:38:26.800
of thing.

00:38:27.900 --> 00:38:31.300
And it was for Python's use in animation.

00:38:31.300 --> 00:38:33.380
And so I think this is just super cool.

00:38:33.380 --> 00:38:38.800
It's one of those like applications that you don't necessarily think about for Python all

00:38:38.800 --> 00:38:39.200
the time.

00:38:39.200 --> 00:38:41.640
I don't think it gets talked about enough.

00:38:41.640 --> 00:38:48.660
I actually tried to find Paul Hildebrandt had a talk at PyCon Montreal, but I think it was

00:38:48.660 --> 00:38:50.580
back before we were recording these.

00:38:50.940 --> 00:38:57.660
So if you ever see Paul at a conference, you've got to ask him about, you know, how Python is

00:38:57.660 --> 00:38:58.980
used in animation and at studios like Disney.

00:38:58.980 --> 00:38:59.980
Oh yeah, that's really neat.

00:38:59.980 --> 00:39:01.220
So exciting.

00:39:01.220 --> 00:39:03.020
I would have never expected that, but that's great.

00:39:03.020 --> 00:39:05.000
And congrats, Guido, for getting the award.

00:39:05.000 --> 00:39:07.280
And two more quick ones.

00:39:07.480 --> 00:39:13.000
The PSF Spring fundraiser launched yesterday and they're having a ton of fun with it launched

00:39:13.000 --> 00:39:16.000
on at least Pi Day in the United States.

00:39:16.000 --> 00:39:23.400
So if you donate with some sort of contribution that is related to the number Pi, you get like

00:39:23.400 --> 00:39:25.180
a free swag band.

00:39:25.180 --> 00:39:28.980
So just a fun twist on this.

00:39:28.980 --> 00:39:35.060
You can donate $3.14 or $31.41 or $314.116.

00:39:35.420 --> 00:39:39.120
It goes pretty far out.

00:39:39.120 --> 00:39:41.460
If I remember Pi, there's a lot of numbers in there.

00:39:41.460 --> 00:39:43.340
So yeah, just keep going.

00:39:43.340 --> 00:39:43.900
Yeah.

00:39:43.900 --> 00:39:46.560
Because whatever your bank account will allow.

00:39:46.560 --> 00:39:48.260
Exactly.

00:39:48.260 --> 00:39:49.960
All right.

00:39:49.960 --> 00:39:51.720
Anything else you want to throw out?

00:39:51.720 --> 00:39:53.340
Yeah.

00:39:53.340 --> 00:39:54.440
Just one last quick one.

00:39:54.440 --> 00:39:56.760
Just a small plug for us.

00:39:56.760 --> 00:39:58.080
Cuddlesoft is hiring.

00:39:58.080 --> 00:40:03.500
We have a bunch of different positions open, but we're especially always looking for Python

00:40:03.500 --> 00:40:04.080
engineers.

00:40:04.720 --> 00:40:05.900
We're a small team.

00:40:05.900 --> 00:40:07.820
We're a team of about eight people right now.

00:40:07.820 --> 00:40:11.380
Predominantly female engineering team.

00:40:11.380 --> 00:40:16.940
And just like the pride of what I have done in the last few years of like building this

00:40:16.940 --> 00:40:17.160
team.

00:40:17.160 --> 00:40:22.820
So if you're looking for someplace that is always innovating, always focused on like really

00:40:22.820 --> 00:40:24.420
high quality tested code.

00:40:24.420 --> 00:40:29.160
But you want to work in a small team environment, get hands on with clients, get hands on with

00:40:29.160 --> 00:40:29.580
product.

00:40:29.580 --> 00:40:30.820
Come check that.

00:40:30.820 --> 00:40:32.100
Cuddlesoft looks really cool.

00:40:32.100 --> 00:40:36.640
You'd seem to be doing a lot of bunch of different small fun projects instead of just getting stuck

00:40:36.640 --> 00:40:38.240
in like one huge legacy code.

00:40:38.240 --> 00:40:42.540
So if you're looking to kind of bounce around from project to project and learn a lot, I think

00:40:42.540 --> 00:40:43.400
that'd be a good place, right?

00:40:43.400 --> 00:40:44.160
Yeah.

00:40:44.720 --> 00:40:44.940
Yeah.

00:40:44.940 --> 00:40:45.280
Absolutely.

00:40:45.280 --> 00:40:45.680
All right.

00:40:45.680 --> 00:40:49.540
Well, I have two jokes for us, even though I have no extras.

00:40:49.540 --> 00:40:50.920
So I'm making up for it there, I guess.

00:40:50.920 --> 00:40:51.260
Nice.

00:40:52.260 --> 00:40:57.100
So Aaron Patterson said, I heard Microsoft is trying to change the file separator in

00:40:57.100 --> 00:40:59.900
Windows, but it received tons of backslash from the community.

00:40:59.900 --> 00:41:04.500
That's pretty funny, right?

00:41:04.500 --> 00:41:06.280
But the forward slash works fine in Windows.

00:41:06.280 --> 00:41:07.980
People just forget to use it.

00:41:07.980 --> 00:41:09.320
It actually does.

00:41:09.320 --> 00:41:10.180
It totally does.

00:41:10.180 --> 00:41:12.420
And following along there.

00:41:12.420 --> 00:41:15.800
Oh, Emily, I think this is the perfect follow on for you as well.

00:41:15.800 --> 00:41:20.280
Do you ever look at people's GitHub profiles if they apply?

00:41:21.020 --> 00:41:22.140
Like they say, yeah, right.

00:41:22.140 --> 00:41:22.400
Of course.

00:41:22.400 --> 00:41:24.240
I mean, it'd be crazy not to, right?

00:41:24.240 --> 00:41:30.820
So this person here, you know, if you go to your GitHub profile, it will show you your

00:41:30.820 --> 00:41:32.920
public activity over time.

00:41:32.920 --> 00:41:36.460
And it'll say like on this day, you know, in September or on Monday, you had this much

00:41:36.460 --> 00:41:37.780
work and then on Tuesday that much.

00:41:37.780 --> 00:41:39.900
And it'll color like different colors of green.

00:41:39.900 --> 00:41:40.200
Yeah.

00:41:40.200 --> 00:41:46.260
So if you all check out the link here, we have a GitHub activity for a year that spells

00:41:46.260 --> 00:41:50.740
out, please hire me in like the exact amount of commits on just the right day.

00:41:50.740 --> 00:41:52.460
And I think that's...

00:41:52.460 --> 00:41:55.960
I think there's some history manipulation going on here, but...

00:41:55.960 --> 00:41:57.400
Probably some auto squashing.

00:41:57.400 --> 00:41:57.900
I don't know.

00:41:57.900 --> 00:42:07.200
I mean, hey, I would look at that and think that they had some decent enough Git skills

00:42:07.200 --> 00:42:08.620
to manage that.

00:42:08.620 --> 00:42:12.140
It does mean that you're probably not doing like normal Git work on one hand, but on the

00:42:12.140 --> 00:42:16.260
other, like I'd have to think for a while to figure out how to get it to draw that out.

00:42:16.340 --> 00:42:17.260
So that's pretty cool too.

00:42:17.260 --> 00:42:24.740
It's one of the main reasons why I switched my blog to Hugo so that blog posts count as

00:42:24.740 --> 00:42:25.320
Git commits.

00:42:25.320 --> 00:42:26.360
Exactly.

00:42:26.360 --> 00:42:26.920
Double dip.

00:42:26.920 --> 00:42:28.840
Yeah.

00:42:28.840 --> 00:42:30.100
Nice.

00:42:30.100 --> 00:42:31.800
Well, that's what I brought for the jokes.

00:42:31.800 --> 00:42:32.580
Nice.

00:42:32.580 --> 00:42:35.660
Well, thanks everybody for showing up.

00:42:35.660 --> 00:42:38.940
Thanks, Emily, for showing up here and also for the Walrus operator.

00:42:38.940 --> 00:42:39.520
Love it.

00:42:39.520 --> 00:42:40.380
Yeah.

00:42:40.440 --> 00:42:42.380
And we'll see everybody next week.