WEBVTT
00:00:00.001 -->
00:00:05.700Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:00:05.700 -->
00:00:11.800This is episode 275, recorded March 15th, and I am Brian Okken.
00:00:11.800 -->
00:00:13.040I am Michael Kennedy.
00:00:13.040 -->
00:00:14.580And I'm Emily Morehouse.
00:00:14.580 -->
00:00:16.300Yay, thanks for coming.
00:00:16.300 -->
00:00:25.560I 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.820So welcome, Emily.
00:00:27.640 -->
00:00:30.300And if people aren't familiar with who you are, who are you?
00:00:30.300 -->
00:00:31.640Yeah, of course.
00:00:31.640 -->
00:00:32.480So I'm Emily.
00:00:32.480 -->
00:00:36.740I am the Director of Engineering and one of the co-founders of Cuddlesoft.
00:00:36.740 -->
00:00:43.040So we are a creative product development agency focused on web, mobile, IoT, and the cloud.
00:00:43.040 -->
00:00:49.400I'm also a Python core developer and the Python conference chair for this year.
00:00:49.400 -->
00:00:50.140Awesome.
00:00:50.140 -->
00:00:51.160That is awesome.
00:00:51.160 -->
00:00:52.660Said another way, you're quite busy.
00:00:52.660 -->
00:00:53.980Yeah.
00:00:53.980 -->
00:00:57.080I also have a 10-month-old, so, you know, not a lot going on in my life.
00:00:57.700 -->
00:00:59.920Yeah, no, a lot of time to binge watch Netflix.
00:00:59.920 -->
00:01:01.00010 months.
00:01:01.000 -->
00:01:04.560So are you pretty busy for PyCon already?
00:01:05.340 -->
00:01:09.580So interestingly enough, this is kind of a time that goes into autopilot in a way.
00:01:09.580 -->
00:01:13.000You know, like most things are already set in motion that need to be set in motion.
00:01:13.000 -->
00:01:19.920So 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.760But 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.960Yeah.
00:01:29.960 -->
00:01:30.680Fingers crossed.
00:01:30.680 -->
00:01:34.120This will be the first PyCon after COVID hit.
00:01:34.120 -->
00:01:35.640So hopefully everything goes great.
00:01:35.640 -->
00:01:36.520I know people are excited.
00:01:36.520 -->
00:01:36.880Yeah.
00:01:36.880 -->
00:01:37.240Yeah.
00:01:37.640 -->
00:01:38.900Well, Brian, do I have the first one?
00:01:38.900 -->
00:01:39.120You do.
00:01:39.120 -->
00:01:39.580Do we have to wait?
00:01:39.580 -->
00:01:42.060Do we have to wait for me or can I talk about this?
00:01:42.060 -->
00:01:42.620Yes.
00:01:42.620 -->
00:01:43.340I'll wait.
00:01:43.340 -->
00:01:45.800Well, let's wait.
00:01:45.800 -->
00:01:47.880I'm very excited to talk about this one, actually.
00:01:47.880 -->
00:01:49.800This one comes from Frederick Aberpil.
00:01:50.260 -->
00:01:51.640I believe listens to the show a lot.
00:01:51.640 -->
00:01:52.340So hello, Frederick.
00:01:52.340 -->
00:01:53.440Nice work on this.
00:01:53.440 -->
00:02:04.460I 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.920And one of the things I did not too long ago is switch over to an async database.
00:02:09.920 -->
00:02:15.480I 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.820Not until we're quite ready.
00:02:17.300 -->
00:02:21.580But as part of that, I'm like, well, all this file stuff, this is kind of slow.
00:02:21.580 -->
00:02:22.720Like, this is a couple of seconds.
00:02:22.720 -->
00:02:27.720Is there a way to sort of set the web server free while we're doing this work?
00:02:27.720 -->
00:02:28.340Right.
00:02:28.340 -->
00:02:31.200And some of that involved calling subprocesses.
00:02:31.200 -->
00:02:43.240I 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.840So I did a quick Google search and I came across Frederick's article here.
00:02:46.840 -->
00:02:55.440And 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.180That's pretty cool.
00:02:56.180 -->
00:02:56.580Isn't that cool?
00:02:56.580 -->
00:02:56.900Yeah.
00:02:56.900 -->
00:02:57.520Yeah.
00:02:57.520 -->
00:02:59.520Emily, have you played with this any?
00:02:59.520 -->
00:03:00.480Yeah.
00:03:00.480 -->
00:03:04.540You know, I actually think I've used this exact blog post, which is super funny.
00:03:05.220 -->
00:03:11.060I was actually just recently writing, like, CLI regression test and pytest.
00:03:11.060 -->
00:03:14.240And you basically, like, test running two different servers.
00:03:14.240 -->
00:03:16.980And I was, like, fighting with subprocess to get it to work.
00:03:16.980 -->
00:03:22.940I 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.860So, yeah.
00:03:23.860 -->
00:03:24.280Yeah.
00:03:24.280 -->
00:03:24.880Very cool.
00:03:24.880 -->
00:03:31.120So, you can just say asyncio, the module, dot create subprocess exec for just running it.
00:03:31.120 -->
00:03:41.160Or 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.360And 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.640You can get the results out of it and everything.
00:03:51.640 -->
00:03:58.300So, 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.420And then you can await communicating with it, which I think is pretty cool and so on.
00:04:03.880 -->
00:04:13.640So, 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.160Think 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.620You 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.740That's pretty cool.
00:04:27.740 -->
00:04:30.780This is from like 2017.
00:04:30.780 -->
00:04:32.800It's an older article, isn't it?
00:04:32.800 -->
00:04:33.760Yeah, it looks like it.
00:04:33.900 -->
00:04:34.280Yeah, I mean.
00:04:34.280 -->
00:04:34.660Yeah.
00:04:34.660 -->
00:04:37.740It's news to me, maybe not news to the world.
00:04:37.740 -->
00:04:40.900Like Emily said, she was already working with it previously.
00:04:40.900 -->
00:04:42.120But yeah, I think it's great.
00:04:42.120 -->
00:04:42.340Right.
00:04:42.340 -->
00:04:48.080Well, the subprocess communicate is sort of people often shifted over to just run.
00:04:48.080 -->
00:04:50.880So, I'm hoping there's a run version of that too.
00:04:50.880 -->
00:04:52.780Yeah, probably is.
00:04:52.780 -->
00:04:54.020Anyway.
00:04:54.020 -->
00:04:54.540Cool.
00:04:54.540 -->
00:04:55.280Indeed.
00:04:55.280 -->
00:04:55.720All right.
00:04:55.720 -->
00:04:58.340Well, I'm going to explain some stuff to us, Brian.
00:04:58.340 -->
00:04:58.720I must.
00:04:58.720 -->
00:05:02.960I see the author of what you're about to talk about out in the audience as well.
00:05:03.160 -->
00:05:04.160Yeah, that's also.
00:05:04.160 -->
00:05:05.300That's very cool.
00:05:05.300 -->
00:05:06.600Well, this is pretty fun.
00:05:06.600 -->
00:05:07.440Definitely an exciting one.
00:05:07.440 -->
00:05:07.580Yeah.
00:05:07.580 -->
00:05:07.920Yeah.
00:05:07.920 -->
00:05:08.860So, this comes from.
00:05:08.860 -->
00:05:10.100This is TypeSplainer.
00:05:10.100 -->
00:05:11.800And let me explain it to you.
00:05:11.800 -->
00:05:14.740So, I don't know.
00:05:14.740 -->
00:05:16.180It's just this cool thing.
00:05:16.180 -->
00:05:17.280It popped up last week.
00:05:17.480 -->
00:05:18.200We saw it.
00:05:18.200 -->
00:05:20.340This is from Arian.
00:05:20.340 -->
00:05:21.380Sorry.
00:05:21.380 -->
00:05:22.980Arian Malik Wasi.
00:05:22.980 -->
00:05:26.100It's a pretty cool name, by the way.
00:05:26.100 -->
00:05:31.980But so, this is this little neat Heroku app that has you.
00:05:31.980 -->
00:05:33.260It's pretty simple.
00:05:33.260 -->
00:05:33.540You.
00:05:33.900 -->
00:05:35.920Well, I don't know how simple it is behind the scenes.
00:05:35.920 -->
00:05:36.240But.
00:05:36.240 -->
00:05:37.220Simple to use.
00:05:37.220 -->
00:05:37.640To use.
00:05:37.640 -->
00:05:38.300It's very simple.
00:05:38.300 -->
00:05:42.860You pop in any sort of Python code that has type hints in it.
00:05:42.860 -->
00:05:47.920And so, this one has like, for instance, we've got an example up that the default with
00:05:47.920 -->
00:05:52.340like a callable that takes a stir and an int and a generator.
00:05:52.340 -->
00:05:54.460And yeah.
00:05:54.460 -->
00:05:56.240So, there's a bunch of type hints in here.
00:05:56.240 -->
00:05:59.820This is even like kind of more than most people use all the time.
00:05:59.820 -->
00:06:00.100But.
00:06:00.100 -->
00:06:01.460And then you hit TypeSplain.
00:06:01.460 -->
00:06:08.640And it will show you what the different type hints mean and translate them into English for
00:06:08.640 -->
00:06:08.860you.
00:06:08.860 -->
00:06:13.220And it's just pretty, pretty cool.
00:06:13.220 -->
00:06:14.120I like it.
00:06:14.740 -->
00:06:20.980One of the things that Wasi said that he was also, when he was developing this, he was
00:06:20.980 -->
00:06:25.540on his way to developing a Visual Studio code plugin.
00:06:25.540 -->
00:06:33.720And 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.680to you right in your editor as well.
00:06:35.680 -->
00:06:37.020So, this is pretty neat.
00:06:37.020 -->
00:06:37.460Yeah.
00:06:37.460 -->
00:06:38.020This is really cool.
00:06:38.020 -->
00:06:43.160This explanation you have there, like dictionary of list of set of frozen set of, like, oh my
00:06:43.160 -->
00:06:49.280gosh, the description is something like a dictionary that maps a list of sets of frozen
00:06:49.280 -->
00:06:50.580sets of integers onto a string.
00:06:50.580 -->
00:06:54.360Like, that's way more legible and internalizable than.
00:06:54.360 -->
00:06:55.320Yeah.
00:06:55.320 -->
00:06:57.000How many brackets deeper we were?
00:06:57.000 -->
00:07:00.720Four brackets deep in that type information there?
00:07:00.720 -->
00:07:01.160Yeah.
00:07:01.520 -->
00:07:08.980It's interesting on Twitter with the announcement of it, or we heard about it through Will McGugan,
00:07:08.980 -->
00:07:09.820or at least I did.
00:07:09.820 -->
00:07:16.460And some of the comments were like, not that this isn't cool.
00:07:16.460 -->
00:07:18.000It was like, oh yeah, this is cool.
00:07:18.000 -->
00:07:21.540But maybe Python shouldn't be this complicated if you have to explain it.
00:07:21.540 -->
00:07:22.640But it's...
00:07:22.640 -->
00:07:24.680Have these people done C++?
00:07:24.680 -->
00:07:25.760Let me just ask them.
00:07:25.760 -->
00:07:26.200I know.
00:07:26.200 -->
00:07:32.100You 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.260are helping out a lot.
00:07:33.260 -->
00:07:37.580And 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.300not 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.740it out.
00:07:42.740 -->
00:07:44.280Absolutely.
00:07:44.280 -->
00:07:45.340Yeah.
00:07:45.340 -->
00:07:46.260And I did actually take a look.
00:07:46.260 -->
00:07:46.660What do you think about this?
00:07:47.100 -->
00:07:47.940Oh, I think this is awesome.
00:07:47.940 -->
00:07:49.560I think I absolutely agree.
00:07:49.560 -->
00:07:53.140Like, you know, mypy has allowed us to do gradual typing and all that.
00:07:53.140 -->
00:07:57.140But 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.440are more types than I've ever seen.
00:07:58.440 -->
00:08:01.740And so being able to kind of convert it really easily is nice.
00:08:01.740 -->
00:08:04.460And I did actually take a look at how it works under the hood.
00:08:04.460 -->
00:08:08.780There's a really big if statement of like serialization.
00:08:08.780 -->
00:08:13.360But then it also, I'm a nerd for anything AST related.
00:08:13.960 -->
00:08:19.580And so it uses like the mypyParse under the hood, which is actually relatively complex
00:08:19.580 -->
00:08:23.120for what it needs to handle based on, you know, different Python versions and whatnot.
00:08:23.120 -->
00:08:24.640Wow, that's pretty awesome.
00:08:24.640 -->
00:08:25.020Nice.
00:08:25.020 -->
00:08:25.640Yeah.
00:08:25.640 -->
00:08:30.120The very first time you were on TalkByth enemy was to talk about the AST, the abstract syntax
00:08:30.120 -->
00:08:30.600tree, right?
00:08:30.600 -->
00:08:31.120Yeah.
00:08:31.120 -->
00:08:35.440It was right around my first conference talk back in the day.
00:08:35.440 -->
00:08:35.800Yeah.
00:08:35.800 -->
00:08:36.080Awesome.
00:08:36.080 -->
00:08:36.660Yeah.
00:08:36.660 -->
00:08:37.440Way back in the day.
00:08:37.440 -->
00:08:39.480I think we met in Vancouver to set that up or something.
00:08:39.480 -->
00:08:41.360When you were up, you know, we met at PyCascades there.
00:08:41.520 -->
00:08:48.080I generally think of myself as a smart person, but people that can handle doing AST work in
00:08:48.080 -->
00:08:53.640Python, I'm like, oh my gosh, you know, it's over my head.
00:08:53.640 -->
00:08:55.080Yeah, that's pretty awesome.
00:08:55.080 -->
00:09:00.040One thing really quick before we move on, Brian, if you go to the homepage of the typesplainer,
00:09:00.040 -->
00:09:01.160which is basically the back one.
00:09:01.580 -->
00:09:06.540So it's got this fairly pathological insane example to show you, like you can take crazy
00:09:06.540 -->
00:09:08.080stuff and explain it.
00:09:08.080 -->
00:09:08.260Yeah.
00:09:08.260 -->
00:09:08.460Yeah.
00:09:08.460 -->
00:09:11.720But 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.220there and then hit typesplain.
00:09:13.220 -->
00:09:18.340So if you just made like a function that just took, you know, yeah, exactly.
00:09:18.340 -->
00:09:20.060Give it a name and do a dot, dot, dot.
00:09:20.060 -->
00:09:20.320Yeah.
00:09:20.320 -->
00:09:21.420Give the function name.
00:09:21.420 -->
00:09:21.860You'll be good.
00:09:22.620 -->
00:09:23.820And then you hit typesplain.
00:09:23.820 -->
00:09:27.000Oh, it needs a function name.
00:09:27.000 -->
00:09:28.360Oh, I didn't.
00:09:28.360 -->
00:09:29.340It's not JavaScript.
00:09:29.340 -->
00:09:29.960Come on.
00:09:29.960 -->
00:09:32.180Brian knows.
00:09:32.180 -->
00:09:32.580Yeah.
00:09:34.580 -->
00:09:34.740Wasi.
00:09:34.740 -->
00:09:38.500I 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.360some random code and drop it and then go explain it to me.
00:09:41.360 -->
00:09:41.600Yeah.
00:09:41.600 -->
00:09:44.800I guess now you can also use the VS Code extension, which I haven't seen with.
00:09:44.800 -->
00:09:49.000Anyway, I thought, I thought this was cool as well and certainly saw a lot of people talking
00:09:49.000 -->
00:09:50.520about it on Twitter when it came out.
00:09:50.520 -->
00:09:54.040So, but final thing, I think this is noteworthy as well.
00:09:54.040 -->
00:09:55.340And I think it's worth mentioning.
00:09:55.340 -->
00:09:57.240Wasi is just 14.
00:09:57.240 -->
00:10:02.380So speaking of people like Emily, who can do like AST stuff like crazy, like also, if you
00:10:02.380 -->
00:10:04.260write this when you're 14, well done.
00:10:04.700 -->
00:10:05.340You're on your way.
00:10:05.340 -->
00:10:10.120Plus it's, it's really good looking for something right out of the gate.
00:10:10.120 -->
00:10:11.360So it looks nice.
00:10:11.360 -->
00:10:11.520Yeah.
00:10:11.520 -->
00:10:11.900Awesome.
00:10:11.900 -->
00:10:12.600Yeah.
00:10:12.600 -->
00:10:16.000I also think the like architecture of it's really great too.
00:10:16.000 -->
00:10:22.140So 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.440and a web interface and a VS Code extension.
00:10:25.440 -->
00:10:30.840So I think that is a really great example of how to structure a project like this too.
00:10:30.840 -->
00:10:31.440Nice.
00:10:31.440 -->
00:10:31.840Yeah.
00:10:31.840 -->
00:10:32.240That's awesome.
00:10:33.060 -->
00:10:35.120Hey, Emily, we lost your screen.
00:10:35.120 -->
00:10:39.900If 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.420Let me just follow up with Sam real quick who pointed out, be super aware of the limitations
00:10:44.420 -->
00:10:45.240of your hardware.
00:10:45.240 -->
00:10:49.660When you try to write files in async environments at this project that ground to a halt because
00:10:49.660 -->
00:10:51.440too many workers are trying to run at once.
00:10:51.440 -->
00:10:52.980Yes, absolutely.
00:10:52.980 -->
00:10:53.880Good point, Sam.
00:10:53.980 -->
00:10:59.760That is generally true for any limited resource that you point async things at, right?
00:10:59.760 -->
00:11:04.220If you're going like async against a database and a couple of queries will max it out.
00:11:04.220 -->
00:11:07.120And 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.060go faster.
00:11:08.060 -->
00:11:12.560It's only going to get worse as it like fights for contention and resources and stuff.
00:11:12.900 -->
00:11:18.100And then on this one, on the typesplainer, Brian Skin says, agreed.
00:11:18.100 -->
00:11:19.200Very nice work.
00:11:19.200 -->
00:11:20.080So awesome.
00:11:20.080 -->
00:11:21.420All right.
00:11:21.420 -->
00:11:22.700So this is another...
00:11:22.700 -->
00:11:23.300Emily, you're up for the first one.
00:11:23.300 -->
00:11:23.840Yeah.
00:11:23.940 -->
00:11:26.340So this is another one of those like new to me things.
00:11:26.340 -->
00:11:30.460But Marlene's article just came out and that's how I actually found out about it.
00:11:30.460 -->
00:11:35.480So Marlene wrote this really excellent introduction to using IBIS for Python programmers.
00:11:35.480 -->
00:11:38.940IBIS itself has been around for like seven years or so.
00:11:38.940 -->
00:11:42.280It's a project I think that was started by Wes McKinney.
00:11:42.280 -->
00:11:49.540But they are a productivity-centered Python data analysis framework for SQL engines and Hadoop.
00:11:49.540 -->
00:11:52.340So you get a ton of different backends.
00:11:52.500 -->
00:11:58.500It's going to compile to, you know, basically any flavor of SQL database and then a bunch
00:11:58.500 -->
00:12:00.860of like more data science focused backends.
00:12:00.860 -->
00:12:06.880But this popped up on my Twitter feed from Marlene and it's just a really great introduction.
00:12:06.880 -->
00:12:09.920Also just a really interesting sort of application.
00:12:09.920 -->
00:12:16.640So she went through and wanted to pull some like art information about a city that she was
00:12:16.640 -->
00:12:19.300going to visit because she likes to experience the culture of a new city.
00:12:19.300 -->
00:12:25.960So 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.040So I'll actually switch over to the IBIS documentation.
00:12:31.540 -->
00:12:34.320Oh, and this is now just different because it's small.
00:12:34.320 -->
00:12:42.880But yeah, I think I was really interested in it because we have like a pseudo legacy system
00:12:42.880 -->
00:12:49.160that 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.860called Hesura.
00:12:50.540 -->
00:12:56.160So 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.000everything just kind of is magic from there.
00:12:58.000 -->
00:13:01.580And you give it a YAML file and you get seed data, right?
00:13:01.580 -->
00:13:02.680Right.
00:13:03.020 -->
00:13:07.260So we're trying to figure out how to manage seed data in like a wildly different environment
00:13:07.260 -->
00:13:10.960where you have to load it in via like the Hesura CLI tool.
00:13:10.960 -->
00:13:12.860And you need SQL.
00:13:12.860 -->
00:13:17.040And I don't want to write SQL, like anything I can possibly do to avoid that.
00:13:17.040 -->
00:13:23.540So this was a really neat way for getting around needing that modeling.
00:13:24.600 -->
00:13:26.400So let's see if I can get to this.
00:13:26.400 -->
00:13:26.760Super cool.
00:13:26.760 -->
00:13:27.740Yeah.
00:13:27.740 -->
00:13:31.880It also looks like it integrates with Hadoop and other things that maybe are not direct
00:13:31.880 -->
00:13:33.280SQL compatible.
00:13:33.280 -->
00:13:35.620It might need a slightly different query language anyway, right?
00:13:35.620 -->
00:13:36.260Yeah.
00:13:36.260 -->
00:13:37.080And it's super interesting.
00:13:37.080 -->
00:13:39.240So they have a few different ways that it works.
00:13:39.240 -->
00:13:45.500So it directly will execute pandas and then it compiled in a few different ways to either,
00:13:45.500 -->
00:13:51.660you know, those SQL databases, Dask, Hadoop, BigQuery, like a bunch of different stuff.
00:13:51.660 -->
00:13:54.400But yeah, it's not necessarily just going to be straight SQL, but it's going to
00:13:54.400 -->
00:13:55.260handle that for you.
00:13:55.260 -->
00:14:00.240So you're really sort of, you know, future proofing yourself away from that.
00:14:00.240 -->
00:14:06.520But yeah, they just got a ton of like really intelligent ways to filter data and interact
00:14:06.520 -->
00:14:08.340with data in a really performant way.
00:14:08.340 -->
00:14:13.400I'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.340It'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.240So she gets to the point where she has this database table.
00:14:23.440 -->
00:14:28.420So you just tell it, you know, your table name and you set the variable and then you
00:14:28.420 -->
00:14:31.740can interact with it as if it's just a dictionary.
00:14:31.740 -->
00:14:37.280So 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.800it's there.
00:14:38.480 -->
00:14:45.480So 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.840art equals the art bracket for artists and display and then boom, you get those back.
00:14:50.840 -->
00:14:51.100Right.
00:14:51.100 -->
00:14:51.320Yeah.
00:14:51.320 -->
00:14:51.840That's awesome.
00:14:51.840 -->
00:14:54.280As a dictionary, I guess or something like that.
00:14:54.280 -->
00:14:54.420Yeah.
00:14:54.420 -->
00:14:54.780That's cool.
00:14:55.620 -->
00:14:58.420So there's a ton of different things that you can do with it.
00:14:58.420 -->
00:15:01.220I highly recommend checking out their tutorials.
00:15:01.220 -->
00:15:02.920They've got a ton of different options.
00:15:02.920 -->
00:15:05.720My favorite one is the geospatial analysis.
00:15:06.840 -->
00:15:11.300So if you check out their example, they're going to show you how to pull information out
00:15:11.300 -->
00:15:18.380of a geospatial database and then a really quick way of actually like mapping out the data.
00:15:19.140 -->
00:15:23.180So 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.180but 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.900And 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.20010 lines of code.
00:15:37.200 -->
00:15:38.180Wow.
00:15:38.180 -->
00:15:38.840Yeah.
00:15:38.840 -->
00:15:40.660Generating that picture in 10 lines of code.
00:15:40.660 -->
00:15:42.540That's, that's awesome.
00:15:42.540 -->
00:15:43.320Yeah.
00:15:43.320 -->
00:15:44.040It's pretty neat.
00:15:44.040 -->
00:15:46.900It makes me think I should be doing more with geospatial stuff.
00:15:46.900 -->
00:15:49.840Like 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.580What am I going to do?
00:15:50.580 -->
00:15:53.760Like, but there's a lot of cool layers in that graph and everything.
00:15:53.760 -->
00:15:54.200That's neat.
00:15:54.200 -->
00:15:54.760Yep.
00:15:54.760 -->
00:15:55.240Yeah.
00:15:55.240 -->
00:16:00.800The API reminds me a little bit of PyMongo actually, where you kind of just say, you know,
00:16:00.800 -->
00:16:02.940dot and give it the name of things.
00:16:02.940 -->
00:16:05.320And it's really kind of dynamic in that sense.
00:16:05.320 -->
00:16:06.800And you get dictionaries back and stuff.
00:16:06.800 -->
00:16:08.180So yeah.
00:16:08.180 -->
00:16:10.260But it's different databases, right?
00:16:10.260 -->
00:16:11.000Right.
00:16:11.000 -->
00:16:11.280Yeah.
00:16:11.280 -->
00:16:12.820But I do like that perspective.
00:16:12.820 -->
00:16:19.120Like it really is kind of taking any database, but especially taking a relational database
00:16:19.120 -->
00:16:24.300and giving it more of a document oriented interface to it, which is pretty cool.
00:16:24.300 -->
00:16:24.900Yeah.
00:16:24.900 -->
00:16:25.580This is cool.
00:16:25.580 -->
00:16:28.920I definitely want to check this out for, especially for exploration.
00:16:28.920 -->
00:16:32.580It feels like it's really got a lot of advantages for data scientists.
00:16:32.580 -->
00:16:35.660Like 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.440this and playing with it.
00:16:36.440 -->
00:16:38.980And they don't really want to write queries and then convert that.
00:16:38.980 -->
00:16:39.200Right.
00:16:39.500 -->
00:16:44.200Well, 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.080in 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.620to one relationship between SQL, things you can do in SQL and things you can do here.
00:16:56.620 -->
00:17:03.800So that people already familiar with SQL can transfer over pretty easily.
00:17:03.800 -->
00:17:05.260So that's pretty neat.
00:17:05.260 -->
00:17:05.600Absolutely.
00:17:05.600 -->
00:17:06.660Yeah.
00:17:06.660 -->
00:17:07.360This is a nice find.
00:17:07.940 -->
00:17:10.860All right, Brian, before we move on, can I take a second and tell you about our sponsor?
00:17:10.860 -->
00:17:11.120Yes.
00:17:11.120 -->
00:17:11.860Very excited about this.
00:17:11.860 -->
00:17:14.180I think it's a big opportunity for people.
00:17:14.180 -->
00:17:17.120So let me tell you about Microsoft for Startups Founders Hub.
00:17:17.120 -->
00:17:22.260This episode of Python Bytes is brought to you by Microsoft for Startups Founders Hub.
00:17:22.260 -->
00:17:24.200Starting a business is hard.
00:17:24.200 -->
00:17:29.120By some estimates, over 90% of startups will go out of business in just their first year.
00:17:29.120 -->
00:17:34.720With that in mind, Microsoft for Startups set out to understand what startups need to be successful
00:17:34.720 -->
00:17:38.500and to create a digital platform to help them overcome those challenges.
00:17:38.500 -->
00:17:41.180Microsoft for Startups Founders Hub was born.
00:17:41.180 -->
00:17:47.840Founders Hub provides all founders at any stage with free resources to solve their startup challenges.
00:17:47.840 -->
00:17:56.440The 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.840Unlike 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.540Founders Hub is truly open to all.
00:18:08.540 -->
00:18:10.020So what do you get if you join them?
00:18:10.020 -->
00:18:18.280You 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.000To 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.160Through Microsoft for Startups Founders Hub, becoming a founder is no longer about who you know.
00:18:33.160 -->
00:18:46.720You'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.920You'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.060Make your idea a reality today with the critical support you'll get from Founders Hub.
00:18:57.160 -->
00:19:03.480To join the program, just visit pythonbytes.fm/foundershub, all one word, no links in your show notes.
00:19:03.480 -->
00:19:05.700Thank you to Microsoft for supporting the show.
00:19:05.700 -->
00:19:08.780Yeah, so $150,000 credit people get.
00:19:08.780 -->
00:19:12.700So 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.000Now, 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.720And keeping with the theme of the show, this one is recommended by Will McGugan.
00:19:22.720 -->
00:19:24.880So thank you, Will, for all the good ideas.
00:19:25.300 -->
00:19:31.460I 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.280And this is one of the ones they said they are going to start testing on.
00:19:35.280 -->
00:19:37.460And that has to do with performance.
00:19:37.460 -->
00:19:44.180So the topic or the library is airspeed, velocity or ASV and the pip nomenclature.
00:19:44.720 -->
00:19:54.760And 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.480oh, it's slow.
00:19:55.480 -->
00:19:57.440I need to go figure out why it's slow for now.
00:19:57.700 -->
00:20:02.400So 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.960So probably the best way to see this is to just like pick on an example.
00:20:06.960 -->
00:20:14.360So 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.480I'll pick up AstroPy.
00:20:16.000 -->
00:20:17.360And you get all these graphs.
00:20:17.360 -->
00:20:24.220So each one of these graphs here is the performance of some aspect of AstroPy over time.
00:20:24.220 -->
00:20:25.360How cool is this?
00:20:25.360 -->
00:20:26.040Look at that.
00:20:26.040 -->
00:20:27.120That's pretty cool.
00:20:27.120 -->
00:20:31.120And if you hover over it, it shows you the code that runs that scenario.
00:20:31.120 -->
00:20:31.980Wow.
00:20:31.980 -->
00:20:32.600Yeah.
00:20:32.600 -->
00:20:36.220And, you know, this is a sample, this is a sample.
00:20:36.220 -->
00:20:37.540And then they did a huge improvement.
00:20:37.540 -->
00:20:44.020You 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.480Right.
00:20:44.540 -->
00:20:47.520This particular test they did there, it goes along pretty steady state.
00:20:47.520 -->
00:20:52.540And 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.400So 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.360Yeah.
00:20:59.360 -->
00:21:00.660So lower is better, right?
00:21:00.660 -->
00:21:02.300I believe lower is better.
00:21:02.300 -->
00:21:02.580Yeah.
00:21:02.580 -->
00:21:03.600I think lower is better.
00:21:03.600 -->
00:21:05.440You can pull up regressions.
00:21:05.440 -->
00:21:07.440You can say, okay, well, what got worse?
00:21:07.440 -->
00:21:12.860Like, for example, timetable outputter got 35 times slower.
00:21:13.060 -->
00:21:14.780So that might want some attention.
00:21:14.780 -->
00:21:22.680And 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.420So 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.080Wow.
00:21:29.080 -->
00:21:30.100That's neat, I think.
00:21:31.360 -->
00:21:41.600I 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.680You're only like now realizing, wouldn't it be great to have these graphs?
00:21:46.680 -->
00:21:48.860How do you get those graphs back in history?
00:21:49.080 -->
00:21:57.460So 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.840It'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.600That's awesome.
00:22:07.600 -->
00:22:11.440Any 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.380I think you can apply it to general projects.
00:22:13.380 -->
00:22:15.920I don't remember where I saw it.
00:22:15.920 -->
00:22:17.060I got to pull it back up here.
00:22:17.060 -->
00:22:19.380Somehow I've escaped the main part.
00:22:19.960 -->
00:22:32.380But 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.180And then here's like the run command.
00:22:34.180 -->
00:22:35.620You come up with one of these test suites.
00:22:35.620 -->
00:22:41.860I 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.580Yeah.
00:22:42.580 -->
00:22:43.240Yeah.
00:22:43.240 -->
00:22:44.360So pretty neat.
00:22:44.360 -->
00:22:45.480People can check that out.
00:22:45.480 -->
00:22:49.900But like here you can specify like which versions of Python or is this 2.7 stuff?
00:22:49.900 -->
00:22:50.980I don't know.
00:22:50.980 -->
00:22:54.040But yeah, so you can run it against all those old versions.
00:22:54.040 -->
00:22:55.700You can configure how it runs and so on.
00:22:55.700 -->
00:22:56.280Okay.
00:22:56.280 -->
00:23:09.140So 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.200Things like that.
00:23:10.200 -->
00:23:10.820Yeah, exactly.
00:23:10.820 -->
00:23:15.780So 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.820Here 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.480Yeah.
00:23:22.480 -->
00:23:22.980Yeah.
00:23:22.980 -->
00:23:24.640So Will says he ran it.
00:23:24.640 -->
00:23:27.020Let's pop his up.
00:23:27.020 -->
00:23:30.680Ran it against two years worth of rich releases.
00:23:30.680 -->
00:23:31.760That's cool.
00:23:31.760 -->
00:23:33.440And found a performance regression.
00:23:33.440 -->
00:23:34.160Nice work.
00:23:34.160 -->
00:23:36.520I love it.
00:23:36.520 -->
00:23:38.580Optimizations that made rich slower.
00:23:38.580 -->
00:23:39.320Isn't that true?
00:23:39.320 -->
00:23:40.620Like this is going to make it better.
00:23:40.620 -->
00:23:40.920No.
00:23:40.920 -->
00:23:42.960Yeah.
00:23:42.960 -->
00:23:44.660So pretty cool.
00:23:44.660 -->
00:23:50.920And have to give a nice shout out to the full embracing of the my Python reference.
00:23:50.920 -->
00:23:57.820If 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.560Oh, yeah.
00:23:58.560 -->
00:23:59.320I did notice that.
00:23:59.320 -->
00:23:59.920That's awesome.
00:23:59.920 -->
00:24:00.800It's nice.
00:24:00.800 -->
00:24:02.100Yeah.
00:24:02.100 -->
00:24:02.640Very cool.
00:24:02.640 -->
00:24:04.240Well, yeah.
00:24:04.240 -->
00:24:05.020Thanks for sending that over.
00:24:05.020 -->
00:24:07.240Well, yeah, I got some projects.
00:24:07.240 -->
00:24:08.080I'd like to do that on.
00:24:08.080 -->
00:24:13.200But speaking of testing things, this one comes from Anthony Shaw.
00:24:13.200 -->
00:24:14.580This is Perflint.
00:24:14.580 -->
00:24:22.540So this is a this is a pilot extension to check for performance anti patterns.
00:24:22.540 -->
00:24:25.760And it's Tony somewhere.
00:24:25.760 -->
00:24:26.300Anthony.
00:24:26.300 -->
00:24:29.060Some guy named Anthony Shaw.
00:24:29.060 -->
00:24:29.680Anthony Shaw.
00:24:29.680 -->
00:24:30.660I thought we mentioned him.
00:24:30.660 -->
00:24:31.300Tony Baloney.
00:24:31.300 -->
00:24:32.780Says.
00:24:32.780 -->
00:24:33.480Oh, here it is.
00:24:33.480 -->
00:24:35.200Project is an early beta.
00:24:35.200 -->
00:24:38.160It will likely raise many false positives.
00:24:38.880 -->
00:24:50.760So 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.260No, at least in my experience with pilot.
00:24:55.260 -->
00:25:02.500It 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.180Like I threw pilot against some demo code that I have for like teaching people stuff.
00:25:08.460 -->
00:25:13.820And I'm using short variable names like, you know, X and Y and things like that.
00:25:13.820 -->
00:25:20.080And 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.880And, you know, for production code, that's probably fine.
00:25:23.880 -->
00:25:26.500But if you have different rules, you can change that.
00:25:26.500 -->
00:25:27.740But back to this.
00:25:27.740 -->
00:25:39.640I 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.080So don't do premature optimization.
00:25:42.720 -->
00:25:56.480However, 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.420That'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.320It creates the list.
00:26:08.320 -->
00:26:09.260You don't need to do that.
00:26:09.260 -->
00:26:10.840So that's a that's a big one.
00:26:10.840 -->
00:26:13.940Anyway, there's a whole bunch of different things that checks for.
00:26:13.940 -->
00:26:24.480And 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.100You can kind of get out of the habit of doing some of these things.
00:26:27.100 -->
00:26:28.640So, yeah, these are nice.
00:26:28.640 -->
00:26:32.320It'll catch just some of the things you might think you need to do.
00:26:32.320 -->
00:26:35.480You're not super experienced with or whatever.
00:26:35.480 -->
00:26:35.840Right.
00:26:35.840 -->
00:26:36.080Yeah.
00:26:36.080 -->
00:26:42.500Like one of the things here is a error W201 8201, which is loop invariant statement.
00:26:43.040 -->
00:26:50.880And 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.740And if that never changes within the loop, don't do the length in the loop.
00:26:55.740 -->
00:26:56.760Take it out of the loop.
00:26:56.960 -->
00:26:57.520Those are.
00:26:57.520 -->
00:26:58.360Yeah, there are.
00:26:58.360 -->
00:26:58.760Exactly.
00:26:58.760 -->
00:27:12.440There'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.500And now it's in a loop.
00:27:13.900 -->
00:27:18.340You 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.200So, yeah, this example here, you're doing it 10,000.
00:27:21.200 -->
00:27:22.780You're doing a loop 10,000 times.
00:27:22.780 -->
00:27:27.340And 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.860So you're basically doing it 10,000, 9,999 times more than necessary.
00:27:32.860 -->
00:27:33.280Yeah.
00:27:33.280 -->
00:27:33.660Yeah.
00:27:33.660 -->
00:27:35.440So kind of fun.
00:27:35.440 -->
00:27:36.500I'm going to give it a shot.
00:27:36.500 -->
00:27:39.340See what I think in as using it.
00:27:39.340 -->
00:27:40.640So, yeah, definitely.
00:27:40.860 -->
00:27:46.120Emily, do you use some of these linters or anything like this that give you warnings?
00:27:46.120 -->
00:27:47.260Yeah.
00:27:47.260 -->
00:27:48.000Yeah.
00:27:48.000 -->
00:27:51.680I mean, I think we mostly use Playgate, but I'm definitely curious to try this out, too.
00:27:51.680 -->
00:27:58.280I can see how this would be tricky to get really consistent errors for these things.
00:27:58.280 -->
00:28:01.920So props to Tony Bologna for taking it out.
00:28:01.920 -->
00:28:02.300Well done.
00:28:02.300 -->
00:28:03.060Yeah, this is exciting.
00:28:03.060 -->
00:28:04.320I'm glad to see this coming out.
00:28:04.320 -->
00:28:09.120I 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.420So, yeah, very well done.
00:28:11.280 -->
00:28:12.020Yeah, this is cool.
00:28:12.020 -->
00:28:19.100I 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.620But if you can automate it.
00:28:20.620 -->
00:28:21.600Yeah, I think that's a great point.
00:28:21.600 -->
00:28:35.460I 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.240And it's going to be tricky.
00:28:36.240 -->
00:28:39.260Like, are you really storing pickles in the database?
00:28:39.260 -->
00:28:40.920Let's not, you know, stuff like that.
00:28:40.920 -->
00:28:41.160Yeah.
00:28:41.160 -->
00:28:42.040All right.
00:28:42.040 -->
00:28:47.260Pep 594 has been accepted, which is super exciting.
00:28:47.420 -->
00:28:48.380So, Pep 594.
00:28:48.380 -->
00:28:53.040If you don't know what that is, it's a Python enhancement proposal.
00:28:53.040 -->
00:28:57.260So, a proposed change to the Python language itself.
00:28:57.260 -->
00:29:00.920And so, this one is removing dead batteries from the standard library.
00:29:01.160 -->
00:29:04.780It was written by Christian Himes and Brett Cannon.
00:29:04.780 -->
00:29:09.380I think I saw a tweet from Brett saying that it had been accepted.
00:29:09.380 -->
00:29:15.760So, this is just really exciting for anyone who's followed along with any of this discussion.
00:29:15.760 -->
00:29:17.840It's been a long time coming.
00:29:17.840 -->
00:29:23.780I think there was a major discussion about it at PyCon US 2019.
00:29:23.780 -->
00:29:25.040It must have been.
00:29:25.540 -->
00:29:27.460And shortly after that, there was a PEP.
00:29:27.460 -->
00:29:39.840But 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.080So, this is going to be targeting version 3.11.
00:29:44.080 -->
00:29:48.740So, just a quick recap of the release plan for that.
00:29:48.740 -->
00:29:52.560Development on 3.11 will start this May.
00:29:52.560 -->
00:29:53.380So, May 2021.
00:29:53.380 -->
00:29:59.300The final release, even for 3.11, is not until October 2022.
00:29:59.300 -->
00:30:02.220And even then, this is just going to be deprecating modules.
00:30:02.220 -->
00:30:05.540So, it'll be deprecations in 3.11 and 3.12.
00:30:05.700 -->
00:30:12.140And it's not until 3.13 that it will actually be fully removed from the language itself.
00:30:12.140 -->
00:30:21.320So, 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.840Yeah, it didn't look at all like anything rushed.
00:30:23.840 -->
00:30:29.600When 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.480Here's why.
00:30:30.480 -->
00:30:36.400There's a table in there that shows third-party alternatives to certain things.
00:30:36.400 -->
00:30:38.340Mostly, yeah, that's the one.
00:30:38.340 -->
00:30:40.700So, there's certain things in here.
00:30:40.700 -->
00:30:45.440You're just like, you know, that probably isn't needed or it's really superseded.
00:30:45.440 -->
00:30:46.360So, there's pipes.
00:30:46.360 -->
00:30:50.280But then we also have subprocess, which will take care of that.
00:30:50.280 -->
00:30:51.440And that's a built-in one.
00:30:51.440 -->
00:30:54.080And then async core.
00:30:54.080 -->
00:30:55.760Just use async.io.
00:30:55.940 -->
00:30:57.060But then there's other ones.
00:30:57.060 -->
00:31:00.020There's a bunch in here I've never even heard of.
00:31:00.020 -->
00:31:01.440Yeah, that's the thing, right?
00:31:01.440 -->
00:31:03.140There's one called Crypt.
00:31:03.140 -->
00:31:08.220And 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.040You know, this was from 1994.
00:31:10.040 -->
00:31:14.520Cryptography is not exactly the same as it was then.
00:31:14.520 -->
00:31:17.380So, you know, maybe it makes sense to take it out, right?
00:31:17.380 -->
00:31:18.140Yeah.
00:31:18.140 -->
00:31:19.840I guess.
00:31:19.840 -->
00:31:20.620Yeah.
00:31:20.620 -->
00:31:24.180Yeah, I think it's a really like, it's a thin line to walk, right?
00:31:24.300 -->
00:31:31.300Like, 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.240But 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.580So, 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.840Yeah, it's a liability, right?
00:31:48.880 -->
00:31:50.380There's a CGI library.
00:31:50.380 -->
00:31:52.360That's something else.
00:31:52.360 -->
00:31:54.260That takes you back from 95.
00:31:54.260 -->
00:31:55.880Yeah, that's how I started.
00:31:55.880 -->
00:31:57.600But not with Python.
00:31:57.600 -->
00:32:00.060I was doing CGI with Perl way back in 95.
00:32:00.060 -->
00:32:01.960Yeah, that does go back.
00:32:01.960 -->
00:32:07.760It also talks about whether that bit of code has a maintainer and whether that maintainer is active.
00:32:07.760 -->
00:32:09.940For example, CGI has no maintainer.
00:32:09.940 -->
00:32:10.940Like, no one wants that.
00:32:11.480 -->
00:32:15.500One 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.240You could vendor it into your code, right?
00:32:18.240 -->
00:32:19.880Yeah, now you're the maintainer.
00:32:19.880 -->
00:32:20.660Yeah.
00:32:20.660 -->
00:32:21.400Yeah, exactly.
00:32:21.400 -->
00:32:22.220It's all yours.
00:32:22.220 -->
00:32:22.800You can have that.
00:32:22.800 -->
00:32:30.660But 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.220Just, you're taking it on.
00:32:32.220 -->
00:32:38.740I 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.320They did talk about that, right, Emily?
00:32:40.320 -->
00:32:43.700About that being one of the possible paths they decided against.
00:32:43.700 -->
00:33:02.480Yeah, 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.360Which, 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.180So, I definitely agree.
00:33:14.180 -->
00:33:21.960I 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.180Or 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.940I 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.960So, 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.940Nobody knows.
00:33:44.940 -->
00:33:50.760But, like, what are some of the good aspects, other good aspects?
00:33:50.760 -->
00:33:56.240Is it going to make the library or the Python standard or the install smaller?
00:33:56.240 -->
00:34:00.560Or, I mean, you'd think, anybody know the numbers on that?
00:34:00.560 -->
00:34:01.180Okay.
00:34:01.180 -->
00:34:03.060I don't know the numbers on that.
00:34:03.060 -->
00:34:04.380But that is something interesting to look at.
00:34:04.380 -->
00:34:06.460I would say the biggest change is, like, maintenance.
00:34:06.460 -->
00:34:12.660Just 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.200Yeah.
00:34:13.200 -->
00:34:14.120Yeah.
00:34:14.460 -->
00:34:14.860Yeah.
00:34:14.860 -->
00:34:20.540And especially with CPython, there's often a very big, like, barrier to entry.
00:34:20.540 -->
00:34:27.800So, 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.200Right.
00:34:29.200 -->
00:34:33.500And then the other thing, too, is maybe somebody else goes through the effort to fix it.
00:34:33.900 -->
00:34:38.160But it always takes a core dev to review that PR and get it merged in.
00:34:38.160 -->
00:34:43.140And 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.820So as a whole, it should be hopefully an impact on how we interpret core developer time.
00:34:51.820 -->
00:34:55.700Because right now, I think we're at, like, over 1,000 PRs open on GitHub.
00:34:56.820 -->
00:35:00.940So a lot of times, you know, it's not just core developers writing code.
00:35:00.940 -->
00:35:07.700And 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.100Brian, 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.440If you want to see examples of these old modules still in use.
00:35:16.440 -->
00:35:17.060Yeah.
00:35:17.060 -->
00:35:17.920Yeah.
00:35:17.920 -->
00:35:18.960I've got a couple of them here.
00:35:18.960 -->
00:35:21.040I think I linked them in the show notes.
00:35:21.040 -->
00:35:22.660But if they're not there, I'll make sure it's in there.
00:35:22.660 -->
00:35:22.980Nice.
00:35:22.980 -->
00:35:23.160Yeah.
00:35:23.160 -->
00:35:25.660You got a link to Brett's discussion there.
00:35:25.660 -->
00:35:26.020That's cool.
00:35:26.280 -->
00:35:27.400No, I think this is good.
00:35:27.400 -->
00:35:27.900I think this is good.
00:35:27.900 -->
00:35:29.720And quick shout out to a new theme, right?
00:35:29.720 -->
00:35:31.040Yeah.
00:35:31.040 -->
00:35:33.160So it's a brand new PEP site.
00:35:33.160 -->
00:35:34.920So it's PEP.python.org.
00:35:34.920 -->
00:35:37.180And there's this really lovely theme on it.
00:35:37.180 -->
00:35:38.260It's really clean and modern.
00:35:38.260 -->
00:35:40.940You've got a nice dark theme here as well.
00:35:40.940 -->
00:35:41.060Cool.
00:35:41.060 -->
00:35:42.580Yeah, I noticed the dark theme.
00:35:42.580 -->
00:35:42.940That was cool.
00:35:42.940 -->
00:35:45.800And I think it even auto adapts to the time of day, which is great.
00:35:45.800 -->
00:35:47.600Brian, is that it for all of our main items?
00:35:47.600 -->
00:35:48.520I think it is.
00:35:48.520 -->
00:35:49.840It is.
00:35:49.840 -->
00:35:51.380Do you have anything extra for us?
00:35:51.380 -->
00:35:53.580Would it surprise you if I said no?
00:35:53.580 -->
00:35:54.280Yeah, it would.
00:35:54.280 -->
00:35:54.740Nothing extra.
00:35:54.740 -->
00:35:55.340I know.
00:35:55.340 -->
00:35:56.800I always have like 10 extra things.
00:35:56.800 -->
00:35:58.520No, I don't have anything extra this week.
00:35:58.520 -->
00:35:58.900Oh, really?
00:35:58.900 -->
00:35:59.820Yeah.
00:35:59.820 -->
00:36:00.660Nice.
00:36:00.660 -->
00:36:01.020Nice.
00:36:01.020 -->
00:36:01.340Okay.
00:36:01.340 -->
00:36:02.280How about you, Emily?
00:36:02.280 -->
00:36:02.980Cool.
00:36:02.980 -->
00:36:05.280Yeah, I've got a couple of extra things.
00:36:05.720 -->
00:36:10.240So 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.920before this one.
00:36:10.920 -->
00:36:19.340There 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.000saying like, commit all your stuff, reset everything, and then recommit everything once
00:36:25.000 -->
00:36:26.980you're like ready to make a clean PR.
00:36:27.640 -->
00:36:29.420And so I wanted to share this as well.
00:36:29.420 -->
00:36:33.740This is one of my favorite tools that I learned about probably a few months ago.
00:36:33.740 -->
00:36:35.440Again, it's 2015.
00:36:35.440 -->
00:36:38.120Not a new thing, but new to me.
00:36:38.960 -->
00:36:44.380So you can do auto squashing of git commits when you're interactive rebasing.
00:36:44.740 -->
00:36:50.280So essentially, if you've got a ton of different commits, and you realize, oh, like, I had
00:36:50.280 -->
00:36:55.140a style commit, commit for styling all my new stuff, a few commits back, but like, I want
00:36:55.140 -->
00:36:56.340to make this one more change.
00:36:56.340 -->
00:37:02.300Instead of needing to, you know, rebase immediately or remember to, you know, stage it in a certain
00:37:02.300 -->
00:37:06.340way in the future, you can actually go ahead and just commit one more time.
00:37:06.340 -->
00:37:10.620And then you flag that commit that you're making with the fix up flag.
00:37:10.620 -->
00:37:16.360So 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.500to sort of amend.
00:37:17.500 -->
00:37:20.720So you can just keep working like that, make it fix up commits.
00:37:20.720 -->
00:37:26.920And 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.320squashing.
00:37:27.320 -->
00:37:32.280So once you do that interactive rebase with auto squash, it's going to find all those fix
00:37:32.280 -->
00:37:32.880up commits.
00:37:32.880 -->
00:37:38.060And, you know, when you interact with rebase, you often have to like, move commits around and
00:37:38.060 -->
00:37:39.800tell it to squash into the previous commit.
00:37:39.800 -->
00:37:41.100You've got to get it in the right order.
00:37:41.100 -->
00:37:43.440This handles all of it for you.
00:37:43.440 -->
00:37:48.660And 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.900in.
00:37:48.900 -->
00:37:56.020So you get a really, really clean history without having to like, redo all of your like, commit
00:37:56.020 -->
00:37:57.440work that you had done a lot of the way.
00:37:57.440 -->
00:37:57.880Yeah, that's really nice.
00:37:57.880 -->
00:37:59.280And this looks built into Git.
00:37:59.280 -->
00:38:00.080Yeah.
00:38:00.080 -->
00:38:02.320I've never heard of auto squashing.
00:38:02.320 -->
00:38:04.640I've definitely never used it, but it looks really useful.
00:38:04.640 -->
00:38:05.260Yeah.
00:38:05.260 -->
00:38:05.760Thank you.
00:38:05.760 -->
00:38:06.400Yeah.
00:38:06.400 -->
00:38:06.660All right.
00:38:06.660 -->
00:38:07.220What's your next one?
00:38:07.220 -->
00:38:07.700Yeah.
00:38:08.480 -->
00:38:08.840Yeah.
00:38:08.840 -->
00:38:10.780And then a couple, couple other cool ones.
00:38:10.780 -->
00:38:16.520There was a tweet from Dustin Ingram about an award that the Python Software Foundation
00:38:16.520 -->
00:38:17.640actually received.
00:38:17.640 -->
00:38:26.460It's from the Annie Awards, which is, you know, animation version of the Academy Awards sort
00:38:26.460 -->
00:38:26.800of thing.
00:38:27.900 -->
00:38:31.300And it was for Python's use in animation.
00:38:31.300 -->
00:38:33.380And so I think this is just super cool.
00:38:33.380 -->
00:38:38.800It's one of those like applications that you don't necessarily think about for Python all
00:38:38.800 -->
00:38:39.200the time.
00:38:39.200 -->
00:38:41.640I don't think it gets talked about enough.
00:38:41.640 -->
00:38:48.660I actually tried to find Paul Hildebrandt had a talk at PyCon Montreal, but I think it was
00:38:48.660 -->
00:38:50.580back before we were recording these.
00:38:50.940 -->
00:38:57.660So 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.980used in animation and at studios like Disney.
00:38:58.980 -->
00:38:59.980Oh yeah, that's really neat.
00:38:59.980 -->
00:39:01.220So exciting.
00:39:01.220 -->
00:39:03.020I would have never expected that, but that's great.
00:39:03.020 -->
00:39:05.000And congrats, Guido, for getting the award.
00:39:05.000 -->
00:39:07.280And two more quick ones.
00:39:07.480 -->
00:39:13.000The PSF Spring fundraiser launched yesterday and they're having a ton of fun with it launched
00:39:13.000 -->
00:39:16.000on at least Pi Day in the United States.
00:39:16.000 -->
00:39:23.400So 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.180a free swag band.
00:39:25.180 -->
00:39:28.980So just a fun twist on this.
00:39:28.980 -->
00:39:35.060You can donate $3.14 or $31.41 or $314.116.
00:39:35.420 -->
00:39:39.120It goes pretty far out.
00:39:39.120 -->
00:39:41.460If I remember Pi, there's a lot of numbers in there.
00:39:41.460 -->
00:39:43.340So yeah, just keep going.
00:39:43.340 -->
00:39:43.900Yeah.
00:39:43.900 -->
00:39:46.560Because whatever your bank account will allow.
00:39:46.560 -->
00:39:48.260Exactly.
00:39:48.260 -->
00:39:49.960All right.
00:39:49.960 -->
00:39:51.720Anything else you want to throw out?
00:39:51.720 -->
00:39:53.340Yeah.
00:39:53.340 -->
00:39:54.440Just one last quick one.
00:39:54.440 -->
00:39:56.760Just a small plug for us.
00:39:56.760 -->
00:39:58.080Cuddlesoft is hiring.
00:39:58.080 -->
00:40:03.500We have a bunch of different positions open, but we're especially always looking for Python
00:40:03.500 -->
00:40:04.080engineers.
00:40:04.720 -->
00:40:05.900We're a small team.
00:40:05.900 -->
00:40:07.820We're a team of about eight people right now.
00:40:07.820 -->
00:40:11.380Predominantly female engineering team.
00:40:11.380 -->
00:40:16.940And 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.160team.
00:40:17.160 -->
00:40:22.820So if you're looking for someplace that is always innovating, always focused on like really
00:40:22.820 -->
00:40:24.420high quality tested code.
00:40:24.420 -->
00:40:29.160But 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.580product.
00:40:29.580 -->
00:40:30.820Come check that.
00:40:30.820 -->
00:40:32.100Cuddlesoft looks really cool.
00:40:32.100 -->
00:40:36.640You'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.240in like one huge legacy code.
00:40:38.240 -->
00:40:42.540So 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.400that'd be a good place, right?
00:40:43.400 -->
00:40:44.160Yeah.
00:40:44.720 -->
00:40:44.940Yeah.
00:40:44.940 -->
00:40:45.280Absolutely.
00:40:45.280 -->
00:40:45.680All right.
00:40:45.680 -->
00:40:49.540Well, I have two jokes for us, even though I have no extras.
00:40:49.540 -->
00:40:50.920So I'm making up for it there, I guess.
00:40:50.920 -->
00:40:51.260Nice.
00:40:52.260 -->
00:40:57.100So Aaron Patterson said, I heard Microsoft is trying to change the file separator in
00:40:57.100 -->
00:40:59.900Windows, but it received tons of backslash from the community.
00:40:59.900 -->
00:41:04.500That's pretty funny, right?
00:41:04.500 -->
00:41:06.280But the forward slash works fine in Windows.
00:41:06.280 -->
00:41:07.980People just forget to use it.
00:41:07.980 -->
00:41:09.320It actually does.
00:41:09.320 -->
00:41:10.180It totally does.
00:41:10.180 -->
00:41:12.420And following along there.
00:41:12.420 -->
00:41:15.800Oh, Emily, I think this is the perfect follow on for you as well.
00:41:15.800 -->
00:41:20.280Do you ever look at people's GitHub profiles if they apply?
00:41:21.020 -->
00:41:22.140Like they say, yeah, right.
00:41:22.140 -->
00:41:22.400Of course.
00:41:22.400 -->
00:41:24.240I mean, it'd be crazy not to, right?
00:41:24.240 -->
00:41:30.820So this person here, you know, if you go to your GitHub profile, it will show you your
00:41:30.820 -->
00:41:32.920public activity over time.
00:41:32.920 -->
00:41:36.460And 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.780work and then on Tuesday that much.
00:41:37.780 -->
00:41:39.900And it'll color like different colors of green.
00:41:39.900 -->
00:41:40.200Yeah.
00:41:40.200 -->
00:41:46.260So 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.740out, please hire me in like the exact amount of commits on just the right day.
00:41:50.740 -->
00:41:52.460And I think that's...
00:41:52.460 -->
00:41:55.960I think there's some history manipulation going on here, but...
00:41:55.960 -->
00:41:57.400Probably some auto squashing.
00:41:57.400 -->
00:41:57.900I don't know.
00:41:57.900 -->
00:42:07.200I mean, hey, I would look at that and think that they had some decent enough Git skills
00:42:07.200 -->
00:42:08.620to manage that.
00:42:08.620 -->
00:42:12.140It 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.260other, 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.260So that's pretty cool too.
00:42:17.260 -->
00:42:24.740It'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.320Git commits.
00:42:25.320 -->
00:42:26.360Exactly.
00:42:26.360 -->
00:42:26.920Double dip.
00:42:26.920 -->
00:42:28.840Yeah.
00:42:28.840 -->
00:42:30.100Nice.
00:42:30.100 -->
00:42:31.800Well, that's what I brought for the jokes.
00:42:31.800 -->
00:42:32.580Nice.
00:42:32.580 -->
00:42:35.660Well, thanks everybody for showing up.
00:42:35.660 -->
00:42:38.940Thanks, Emily, for showing up here and also for the Walrus operator.
00:42:38.940 -->
00:42:39.520Love it.
00:42:39.520 -->
00:42:40.380Yeah.
00:42:40.440 -->
00:42:42.380And we'll see everybody next week.