WEBVTT

00:00:00.001 --> 00:00:03.880
Hey there, thanks for listening. Before we jump into this episode, I just want to remind you

00:00:03.880 --> 00:00:09.680
that this episode is brought to you by us over at Talk Python Training and Brian through his pytest

00:00:09.680 --> 00:00:14.940
book. So if you want to get hands-on and learn something with Python, be sure to consider our

00:00:14.940 --> 00:00:21.720
courses over at Talk Python Training. Visit them via pythonbytes.fm/courses. And if you're

00:00:21.720 --> 00:00:27.320
looking to do testing and get better with pytest, check out Brian's book at pythonbytes.fm slash

00:00:27.320 --> 00:00:32.380
pytest. Enjoy the episode. Hello and welcome to Python Bytes, where we deliver Python news and

00:00:32.380 --> 00:00:39.960
headlines directly to your earbuds. This is episode 268, recorded January 26th, 2022. I'm

00:00:39.960 --> 00:00:45.720
Michael Kennedy. And I'm Brian Aiken. And I'm Madison Swain-Bowden. Hey, Madison. Great to have you here.

00:00:45.720 --> 00:00:51.820
So fantastic to be here. Yeah, yeah. We talked to you before at PyCascades, where you were on the

00:00:51.820 --> 00:00:57.300
hosting side. That's right. Tables are turned a little bit, yeah. They absolutely have. So

00:00:57.300 --> 00:01:01.920
why don't you tell folks about yourself before we jump into the news? Thanks. Yeah, I am a senior

00:01:01.920 --> 00:01:10.680
data engineer at a company called Automatic. We do WordPress, which is surprisingly, I recently heard

00:01:10.680 --> 00:01:16.120
that it backs 40% of the internet. And so that was really surprising. So much of the world is on

00:01:16.120 --> 00:01:21.460
WordPress. It's unbelievable. I know, I know. Yeah. And I work with the Openverse team there,

00:01:21.460 --> 00:01:26.520
which I'll talk about a little bit later in the show. Yeah. Fantastic. Cool. Yeah. So Brian,

00:01:26.520 --> 00:01:32.020
shall you kick us off on the first thing? Yeah, sure. Something about parentheses. I like Python

00:01:32.020 --> 00:01:34.940
because it generally doesn't have that many parentheses, but you were going to tell us that

00:01:34.940 --> 00:01:40.500
it should have more. Yes. Well, we have them with function calls, right? And tuples. Indeed.

00:01:40.500 --> 00:01:45.460
So actually, because there's function calls and tuples, both use parentheses, there's a confusion

00:01:45.460 --> 00:01:55.700
that happens. And so I just saw this the other day. A pep679 was added, submitted by Pablo Salgado.

00:01:56.500 --> 00:02:02.920
to allow parentheses in the assert statements. So what happens like currently, I don't know if

00:02:02.920 --> 00:02:08.760
there's examples in here, but what happens currently is if you, if you call assert, you're not supposed

00:02:08.760 --> 00:02:14.620
to use parentheses. You actually, you can't right now. You can, but it's wrong. So if you.

00:02:14.620 --> 00:02:18.800
It's one of those princess bride things like that, that doesn't mean what you think it means.

00:02:18.800 --> 00:02:23.820
It doesn't mean what you think it means. So what happens is, is you, you give assert asserts a

00:02:23.820 --> 00:02:31.020
statement within, within Python, you give it a, an expression to evaluate, and you can also

00:02:31.020 --> 00:02:37.260
give it a comment, like a string to add a message if, if, if, if the failure happens. But what happens

00:02:37.260 --> 00:02:42.920
is sometimes people think it's like a function and put those within parentheses and it looks like a

00:02:42.920 --> 00:02:49.720
function call and it looks visually fine. But what happens is, is it doesn't matter what the,

00:02:49.720 --> 00:02:56.720
expression evaluates to, because the, this it's a, it's a two value, tuple. And especially

00:02:56.720 --> 00:03:02.660
if you've got a string in there, the strings, not non-zero. so the tuple evaluates to a true

00:03:02.660 --> 00:03:10.420
value and your assert never fails. and, and the tuple is never none. And so you're good to go.

00:03:10.420 --> 00:03:14.800
Yeah. I feel like we could have some passing tests. Yeah. I feel like this is one of those like

00:03:14.800 --> 00:03:20.080
Python gotchas. Like if you have one and if you assign a variable to one comma,

00:03:20.080 --> 00:03:26.020
then you get a tuple instead of just the one, right? Yes. and particularly with print being

00:03:26.020 --> 00:03:31.700
changed from a statement to a function, I think it like makes a lot of sense for people to assume

00:03:31.700 --> 00:03:38.220
that assert is also a function. and it's kind of an, an odd, odd duckling in the language because

00:03:38.220 --> 00:03:43.640
it is just a keyword. So this PEP is just, to say, let's allow both. Let's, go ahead.

00:03:43.720 --> 00:03:50.180
Because right now there's no real reason to pass in a tuple as a, and as an expression,

00:03:50.180 --> 00:03:54.280
as a full expression, it just doesn't, it's, it's always going to be true. It's a no off.

00:03:54.280 --> 00:03:59.500
So, let's go ahead and add that to the language and allow people to call it as a function if they

00:03:59.500 --> 00:04:05.100
want to. And the AS there's AST around it that, to make it like basically be the same thing.

00:04:05.100 --> 00:04:10.100
I think this is a no brainer. I think we should just get it done as soon as possible.

00:04:10.360 --> 00:04:14.040
Hopefully we can get it into then, you know, 311 or 312 or something like that.

00:04:14.040 --> 00:04:21.620
So I wonder too, if having, it as a function might help with autocomplete and some IDEs.

00:04:21.620 --> 00:04:27.140
Cause I think right now when you do the assert, you don't get that like, suggested arguments

00:04:27.140 --> 00:04:31.700
or suggested parameters that you do with a function. And so it might help there. Yeah.

00:04:31.820 --> 00:04:37.100
Yeah. so if you're trying to put too many things in there, it won't tell you that it's wrong.

00:04:37.100 --> 00:04:42.800
All those things. Yeah. Yeah. Hopefully this will go through. So I hope so as well. So let's talk

00:04:42.800 --> 00:04:51.740
about local ghost. So local ghost is, a blog by, let me get the name right here by Sophie Koonin.

00:04:51.980 --> 00:04:59.080
And she blogged or wrote about everything I Googled in a week as a professional software engineer.

00:04:59.080 --> 00:04:59.520
Oh, cool.

00:04:59.520 --> 00:05:04.480
So I wanted to highlight this because there's a lot of folks out there who listen to the show

00:05:04.480 --> 00:05:09.760
and just are in the industry who feel like they don't, they don't quite add up or they don't belong

00:05:09.760 --> 00:05:14.200
or whatever, because they feel like they get stuck and lost and banging off things. You know? And I

00:05:14.200 --> 00:05:18.620
can tell you, we were just talking about it last time with a joke, right? Brian, like hate programming,

00:05:18.620 --> 00:05:20.560
hate programming, hate programming. It works. I love programming,

00:05:20.820 --> 00:05:25.400
but the hate part, there's a lot of searching, a lot of Googling and bouncing around from that.

00:05:25.400 --> 00:05:32.100
And so here's just another pro software developer pro in the sense it's her job and she's been doing

00:05:32.100 --> 00:05:37.720
it for a while. And it just talks about like, okay, what did I do? So the, what she searches is slightly

00:05:37.720 --> 00:05:43.740
different than what we would search because she mostly is a front end and node, mostly JavaScript

00:05:43.740 --> 00:05:48.200
type of developer, but it doesn't really matter. You can, you can sort of see there's some basic stuff

00:05:48.200 --> 00:05:53.600
NPM react testing library. And what's nice is she put the little comment behind a lot of these,

00:05:53.600 --> 00:05:57.600
like, why did she search for this? Not just the words like during a react upgrade, looking at

00:05:57.600 --> 00:06:03.380
dependencies to see the latest versions and checking for breaking changes and then react Apollo release

00:06:03.380 --> 00:06:06.780
notes, totally normal. And then undo a rebase. Oops.

00:06:09.020 --> 00:06:10.340
I think we've all been there.

00:06:10.340 --> 00:06:18.220
Yeah, exactly. Or just silence warning, or maybe it's undo commit. No, what did I do? I can't push this.

00:06:18.220 --> 00:06:24.800
Just silence warning. Don't judge me. Okay. So there's a bunch of interesting things and it kind of goes along

00:06:24.800 --> 00:06:28.720
there. So you, you all can look through it. I don't want to go through all the details.

00:06:28.840 --> 00:06:31.860
There's just a lot of stuff. What were you going to point out there, Madison?

00:06:31.860 --> 00:06:37.160
No, it's just a lot of, of fun and interesting searches. And I think like, if we were all to do this

00:06:37.160 --> 00:06:40.820
sort of analysis for ourselves, it would be kind of an interesting retrospective.

00:06:40.820 --> 00:06:44.720
It would be super interesting. Yeah. Like what surprised you most about your search history?

00:06:44.720 --> 00:06:51.140
Let's see. There's a few, I think one on Friday down here at the end of the week. That was pretty,

00:06:51.140 --> 00:06:56.220
yeah, I put my notes. I'll pull it up down here. So one that I thought was interesting was she searched,

00:06:56.220 --> 00:07:03.280
she searched for expecting, expecting a parsed GraphQL document. Perhaps you need to wrap the query in a

00:07:03.280 --> 00:07:10.920
string quote GQL tag. And the content of that's not super interesting, but what that is, is exactly an

00:07:10.920 --> 00:07:17.480
exception message, right? In some sort of code. And for people who don't do this, you should take the

00:07:17.480 --> 00:07:21.840
error messages and put them straight into Google or straight into DuckDuckGo or wherever you put search

00:07:21.840 --> 00:07:24.360
things. And it is so good. With quotes.

00:07:24.360 --> 00:07:29.420
The problems. With, yeah, exactly. And maybe quotes on the really important bits, right? Like I really want to make

00:07:29.420 --> 00:07:31.480
sure it's GraphQL and not some other document or something.

00:07:31.480 --> 00:07:37.560
I would say half the time when I do that, it takes me exactly to the GitHub issue that describes the problem

00:07:37.560 --> 00:07:41.400
that I'm experiencing. It's surprisingly effective, isn't it?

00:07:41.400 --> 00:07:46.900
Absolutely. It's like, why is this work so well? The thing that blew, blew my mind most once is I had a friend,

00:07:47.320 --> 00:07:53.320
this is way back. I mean, we're talking like early 2000s. He was using Outlook. Don't judge him. It was a long

00:07:53.320 --> 00:07:57.720
time ago. And he was using Outlook and it was just stopped working. It gave him some weird error that had

00:07:57.720 --> 00:08:03.180
almost no message, just a number. So I just searched Outlook, that number and boom, here's the exact fix.

00:08:03.180 --> 00:08:04.540
It's just like, are you kidding me?

00:08:04.540 --> 00:08:05.060
Absolutely.

00:08:05.060 --> 00:08:07.040
Yeah, I love it so much.

00:08:07.040 --> 00:08:13.120
A couple others. Semantic HTML contact details. Wanted to check if address tag was relevant here.

00:08:13.120 --> 00:08:18.600
I highlight that because here's somebody who's a professional HTML developer basically doing front end

00:08:18.600 --> 00:08:23.700
stuff. And still they're Googling to see, does this address tag match here? Like, should I use this block,

00:08:23.700 --> 00:08:29.920
this HTML tag in this situation? Right? So it's, even if you work in stuff day to day,

00:08:29.920 --> 00:08:34.940
there's stuff that you just go like, I'm just going to leave that to the search engine and distributed

00:08:34.940 --> 00:08:39.260
cognition and not have to, you know, memorize every detail of what I'm working in.

00:08:39.260 --> 00:08:43.800
And then finally, I just thought this was fun. Editing host file. This was the search, not the action.

00:08:43.800 --> 00:08:45.920
Desperate times. And it didn't even work.

00:08:45.920 --> 00:08:47.420
What was the comment?

00:08:47.420 --> 00:08:55.080
Anyway, I think this is fun. And I thought I'd just share it because I think it's, it's interesting for people to compare notes.

00:08:55.080 --> 00:09:02.800
One of the things I noticed recently was I don't, I don't remember the exact way you're supposed to get to

00:09:02.800 --> 00:09:09.040
GitHub repos. So I usually just Google GitHub and then my repo name just to get to the repo.

00:09:09.040 --> 00:09:10.360
Exactly that. Yeah.

00:09:10.360 --> 00:09:13.000
Nice.

00:09:13.000 --> 00:09:19.700
Well, and a lot of times I search for like a project and then it brings up like PyPI or some other,

00:09:19.700 --> 00:09:23.280
like the read the docs. I was like, no, I want, I want GitHub. Take me to GitHub.

00:09:23.280 --> 00:09:27.440
Yeah. I'm always like, all right, fine. I'll click the PyPI so I can click on the source code.

00:09:27.440 --> 00:09:30.680
Exactly. Exactly. How many links do I have to go through just to get to the repo?

00:09:30.680 --> 00:09:31.240
Exactly. Yeah.

00:09:31.240 --> 00:09:33.980
I know I'm two clicks away. That's good enough. Let's do this.

00:09:33.980 --> 00:09:36.720
Yeah. I have a couple of thoughts on this.

00:09:36.720 --> 00:09:37.760
Yeah. Tell us.

00:09:37.760 --> 00:09:43.340
First of all, local ghost.dev is an amazing domain name. I absolutely adore that. And the

00:09:43.340 --> 00:09:50.800
second is it's, it's really great seeing articles and posts like this. I see a lot of seniors,

00:09:50.800 --> 00:09:55.900
particularly like senior women and others underrepresented minorities talking about this

00:09:55.900 --> 00:10:00.140
sort of thing. And I think it really helps to dispel the myth that like, you have to be

00:10:00.140 --> 00:10:05.960
an expert who has every command for, you know, every utility memorized in order to be a senior dev.

00:10:05.960 --> 00:10:12.580
Like a lot of us are doing these sorts of Googles, right? We're like looking up the function

00:10:12.580 --> 00:10:17.400
signature for something that's like in the standard library, you know, we're all doing this. And so I

00:10:17.400 --> 00:10:22.620
think it's, I think it's really valuable to share something like this, for particularly for people

00:10:22.620 --> 00:10:27.720
who are new. Yeah. Some of the best skill acquisition isn't memorizing things. It's

00:10:27.720 --> 00:10:33.960
remembering that the feature was there. Exactly. Yes. Yes. Right. Exactly. I need to know just enough

00:10:33.960 --> 00:10:39.620
that I can Google it to get, to get to where I want to be. Absolutely. And, Johnny out in the

00:10:39.620 --> 00:10:43.580
audience also thinks it's interesting. Yeah. We, we all think this is great. Fantastic. All right.

00:10:43.860 --> 00:10:47.480
I did give a quick shout out to PyCascades previously, Madison, you want to tell us about

00:10:47.480 --> 00:10:52.060
your first time? Yeah, I wanted to share about it. So PyCascades is coming up in less than two weeks,

00:10:52.060 --> 00:10:57.560
which is really exciting. we have another year of just excellent and diverse talks from

00:10:57.560 --> 00:11:03.940
an array of different subjects and expertise levels. last year we were online and we're going to be

00:11:03.940 --> 00:11:08.740
online, again this year using the same platform that we did last year. And a lot of people really

00:11:08.740 --> 00:11:13.800
enjoyed that platform. So we're excited to use it again. We're hoping to do some watch parties,

00:11:13.800 --> 00:11:20.020
in Seattle, Portland, and Vancouver. but unfortunately, reality, wanted us not

00:11:20.020 --> 00:11:26.980
to do that. So we opted against that. Yeah. But we're, we're so excited to, to be doing this again

00:11:26.980 --> 00:11:32.280
this year. and one of the things that I'm like really excited about is that we have the PSFs,

00:11:32.280 --> 00:11:38.320
uh, diversity, equity, and inclusion working group, doing a meet and greet as sort of our,

00:11:38.320 --> 00:11:46.140
our first event on Saturday. and so they have a form that they are sharing for just trying to

00:11:46.140 --> 00:11:51.100
understand the landscape around diversity in the Python community. and so we have that linked

00:11:51.100 --> 00:11:56.580
in the show notes, if you would like to fill that out. and we are going to have socials on

00:11:56.580 --> 00:12:02.320
Friday and Saturday night. and we had a DJ last year. We're hoping to have a DJ again this year on

00:12:02.320 --> 00:12:08.240
Friday night. and then we'll be doing sprints on Sunday. and tickets are still available.

00:12:08.240 --> 00:12:14.000
we'll be selling them throughout the event too. So, cause it's a virtual event. There's, it's not

00:12:14.000 --> 00:12:19.820
like NFTs. There's no digital scarcity with these. So please feel free to buy a ticket whenever, whenever

00:12:19.820 --> 00:12:21.640
you have a chance and we hope to see you there.

00:12:22.040 --> 00:12:26.320
Yeah. That's a fun commerce. I've enjoyed going to it when it was in person. So it's cool. It's

00:12:26.320 --> 00:12:30.340
still going. I can't wait for it to get back to being actually in person.

00:12:30.340 --> 00:12:34.840
I know. I know. We were, we were hoping, we were hoping to dip our toes into it this year, but

00:12:34.840 --> 00:12:39.000
just wasn't going to happen. And I should also mention too, we're, we're having talks from,

00:12:39.000 --> 00:12:44.380
um, some well-known folks in the, in the Python community, like Thursday Brom and Jay Miller,

00:12:44.380 --> 00:12:47.620
who I know you had on, talk Python to me recently.

00:12:47.620 --> 00:12:51.880
Yeah. Yeah. Yeah. And we have, some first time speakers as well.

00:12:51.880 --> 00:12:56.920
Like Joseph Riddle and, Isaac Na. So we're, there's a lot of really great talks

00:12:56.920 --> 00:13:01.520
that, that we're looking forward to. Yeah. Super cool. Cool. All right. Brian,

00:13:01.520 --> 00:13:07.720
back to parentheses and stuff. Yeah. Well, maybe not parentheses, but yeah,

00:13:07.720 --> 00:13:13.440
stuff that happens between parentheses. so it is interesting article by Seth Larson that I,

00:13:13.440 --> 00:13:18.960
uh, ran across that's a strict Python function parameters. And I thought strict, what do we mean

00:13:18.960 --> 00:13:26.740
by the strict Python function parameters? and the idea is let's put everything together. So we have,

00:13:26.740 --> 00:13:34.060
um, we've got keyword only parameters and that's, it's a little small on screen, but, keyword

00:13:34.060 --> 00:13:40.560
only parameters is, is where you, you can put an asterisk in the middle of your key in your parameter

00:13:40.560 --> 00:13:47.260
list. And it says that everything after that has to be a keyword. It can't be, you can't,

00:13:47.260 --> 00:13:52.320
you can't pass that in as positional. And I'm, yeah, I'm not sure exactly how that works really,

00:13:52.320 --> 00:13:58.100
but, it's kind of, it's useful. the, and then you can also put defaults in there,

00:13:58.100 --> 00:14:02.340
of course, for things. And it's just that separating of what, where your keyword positional

00:14:02.340 --> 00:14:08.700
and keyword arguments go. And that's an, it's a cool thing. that's helped, allow people to,

00:14:08.700 --> 00:14:13.820
uh, add parameters before. So this was a nice addition. And then also we've got, those are

00:14:13.820 --> 00:14:20.460
keyword only parameters. We also have positional only. So with the slash, you can say everything

00:14:20.460 --> 00:14:27.520
before the slash is a positional, only you can't, you can't pass it in, as a keyword

00:14:27.520 --> 00:14:34.700
parameter. and it's, it's the, this, the natural progression is, you know, Hey, let's just

00:14:34.700 --> 00:14:38.780
do both of them at the same time. And I didn't actually, for some reason, I didn't realize you

00:14:38.780 --> 00:14:46.060
could do this. and so what the, so then you're going to have your, positional parameters

00:14:46.060 --> 00:14:53.140
first and then a slash and then a star, and then, you'll have, and then all your

00:14:53.140 --> 00:14:59.860
keyword parameters after that, what, what happens then is you're both of them are true. So you have

00:14:59.860 --> 00:15:05.880
to, you have to have the positionals first and then the keywords after. And, and so what,

00:15:05.880 --> 00:15:11.220
what's the benefit? This, this just, it looks like added syntax to confuse people. but there are

00:15:11.220 --> 00:15:16.040
a lot of benefits. One of the benefits is really that your documents and your code and your

00:15:16.040 --> 00:15:21.680
example code, example code and all examples people look, if they look up some other,

00:15:21.680 --> 00:15:26.340
GitHub repo or something using your API, all the examples are going to look kind of the same.

00:15:26.340 --> 00:15:31.640
And this is sort of something we're used to in other languages. It's, I was actually surprised

00:15:31.640 --> 00:15:37.100
in Python that you could rearrange your, your input, arguments, especially the keyword

00:15:37.100 --> 00:15:43.060
ones, you can rearrange them and they work fine, but it's confusing sometimes. And, and I just

00:15:43.060 --> 00:15:49.020
actually think this is kind of a neat idea. I think that especially for API or, you know,

00:15:49.020 --> 00:15:53.980
library API entry points doing something like this might make complete sense. And it's something I'm

00:15:53.980 --> 00:15:59.820
going to look into considering just to make sure, people use a, use something consistently.

00:15:59.820 --> 00:16:05.420
the article also goes through, thing about, empowering library authors to have

00:16:05.420 --> 00:16:11.060
flexibility to change things. And, and it's a good thing to read up on, but I was curious what you

00:16:11.060 --> 00:16:16.260
guys thought about if, if, if I, if I were having had an API or you were looking at API and it had

00:16:16.260 --> 00:16:18.840
this slash star in the middle of everything, what would you think?

00:16:18.840 --> 00:16:24.680
I, I mean, I really liked this concept and I'm, I'm glad that it's a feature of Python because of

00:16:24.680 --> 00:16:31.340
that uniformity that it can create. I've never had an opportunity where I felt like, this was

00:16:31.340 --> 00:16:35.560
something that I really should use, but I think that's a large part because all of the stuff that I

00:16:35.560 --> 00:16:43.000
work on is, usually internal tools. And so, even if it is open source, there's not like a public

00:16:43.000 --> 00:16:47.520
API that I'm building. And so that, right. If you're consuming it versus creating it for others,

00:16:47.520 --> 00:16:52.140
it's very different, right? Exactly. Exactly. Yeah. And so I think it's always a good thing to keep in

00:16:52.140 --> 00:16:57.820
the back pocket when you like have a particular contract that you really want to enforce with how

00:16:57.820 --> 00:17:04.100
functions are used and keywords and whatnot. Yeah. I also am glad that it's here. And for the same

00:17:04.100 --> 00:17:08.320
reason as medicine, I don't use it very often because to the extent that I do make open source

00:17:08.320 --> 00:17:14.160
libraries that are pretty basic and, and, and don't have tons of like tutorials or anything about

00:17:14.160 --> 00:17:18.500
them. Maybe I should think more about this, honestly, but I do like the idea that you can say,

00:17:18.500 --> 00:17:24.540
no, this is going to be like this specifically, for certain things and say this stuff you cannot

00:17:24.540 --> 00:17:28.680
use as a keyword argument. You have to just pass positional this stuff. You must, it has to go

00:17:28.680 --> 00:17:32.860
at in this order and so on. Yeah. I like it. I, yeah. One of the things I see is, is,

00:17:32.860 --> 00:17:41.760
is people looking at other examples, and, and, and saying like, so if, if you've got a key,

00:17:41.760 --> 00:17:47.280
if you just have a normal arguments, they can be, you can, you can pass them in as keywords,

00:17:47.280 --> 00:17:52.760
even if most people use positional, and then you can reorder the keywords and put them in a different

00:17:52.760 --> 00:17:58.480
order. And then somebody else might look at your code, copy it, and then take off the keywords.

00:17:58.640 --> 00:18:04.440
And now they're in the wrong order. and, that'll mess things up. this is a Dean,

00:18:04.440 --> 00:18:13.080
uh, added a comment of, so def underscore. Yeah. Star. This is a legit syntax. that's,

00:18:13.080 --> 00:18:16.200
that's funny. I can't even read that out loud. It's so confusing.

00:18:16.200 --> 00:18:19.680
Looks like code golf is what it looks like. Goodness.

00:18:20.180 --> 00:18:26.640
So anyway, I think, I think it's like typing in the sense that, it's, it's a good feature

00:18:26.640 --> 00:18:31.940
that's there and it can be helpful for making things more explicit in Python. But part of the

00:18:31.940 --> 00:18:38.600
power of Python is that it's very versatile and approachable. and so it's, I think it's nice

00:18:38.600 --> 00:18:43.260
too, that it's not like, this is something that you are required to do for every function that you write.

00:18:43.680 --> 00:18:50.760
Yeah. Yeah. I do like the flexibility there. All right. Let me tell you about something that seems

00:18:50.760 --> 00:18:57.120
a little bit contrary to the Python way, but I think people will find useful. So over on pypi.org,

00:18:57.120 --> 00:19:05.300
we have 350,000 plus packages, which is utterly mind blowing. I remember when it was 75,000 and I'm

00:19:05.300 --> 00:19:12.160
like, wow, look how many there are. It's insane. So a lot of the superpowers of Python is you,

00:19:12.160 --> 00:19:16.820
you know, the ability to use these packages and people will say I'm using Python because it's

00:19:16.820 --> 00:19:20.600
really great at working with Excel files. Well, like Python's not actually good at working with

00:19:20.600 --> 00:19:25.960
Excel files, but there are many libraries for Python, which that's true. Right. And so you have this sort

00:19:25.960 --> 00:19:30.400
of spectrum of like, what do people mean when they, they say like Python is great, but I do think these

00:19:30.400 --> 00:19:35.520
packages clearly are super important. So why do I bring this up to start the section off? I want to

00:19:35.520 --> 00:19:40.740
talk about a way to not use PyPI, but still do some cool stuff. There's this thing called

00:19:40.740 --> 00:19:49.500
new rec as in small requests over here. I got a name. Yes. If it pulls up, sure.

00:19:49.500 --> 00:19:57.100
Sure. Shri are Ram. So very cool project here. And the idea is it's request like not a drop in

00:19:57.100 --> 00:20:01.420
replacement for requests, but like requests with limited features. But if you're using a limited

00:20:01.420 --> 00:20:07.400
subset of what requests could do, you could use this library and have zero external dependencies,

00:20:07.400 --> 00:20:14.120
no virtual requirements required, no pip install -r or friends required and just have like a real

00:20:14.120 --> 00:20:21.660
simple thing and not have to fall back to just URL lib, which is pretty cool. So it does standard stuff.

00:20:21.660 --> 00:20:29.060
I would recommend maybe even from, you know, import new rec as requests and then request.get.

00:20:29.060 --> 00:20:30.420
See what breaks. Yeah.

00:20:30.420 --> 00:20:37.140
Yeah, exactly. I mean, and then see if it works or not. So you, it does have some limitations, quite a few,

00:20:37.140 --> 00:20:41.220
actually, like it doesn't support connection pooling, for example, but if you do request.get,

00:20:41.220 --> 00:20:45.160
neither does that. You have to create a client session and then use the session to do get and so on.

00:20:45.160 --> 00:20:50.180
If you want, you know, connection pooling apparently uses a lot less memory, but the main reason besides just

00:20:50.180 --> 00:20:55.300
convenience of like, I want to give you a Python file you can run or a set of Python files, you can

00:20:55.300 --> 00:21:00.720
run the top level one without any external dependencies. So that's, that's pretty nice.

00:21:00.720 --> 00:21:06.220
The other one is to avoid supply chain attack vulnerabilities, right? We, we've talked before

00:21:06.220 --> 00:21:12.100
about people putting malicious stuff into PyPI. We talked about the guy, a wreck, I believe it was,

00:21:12.100 --> 00:21:18.320
who had like sabotaged his npm packages and those kinds of things. And you know, the cascading change

00:21:18.320 --> 00:21:22.560
of like the super dependencies in the JavaScript world meant that was really, really bad. Right.

00:21:22.560 --> 00:21:26.720
So here's a way you could put something that does request like things into your code and it doesn't

00:21:26.720 --> 00:21:31.580
have any dependencies. It doesn't have, there's no way someone's going to take over that account and

00:21:31.580 --> 00:21:36.220
put something malicious there, or even maybe worse is like the dependency of the dependency of the

00:21:36.220 --> 00:21:40.720
dependency is where the problem is. Yeah. So yeah, I think this is pretty interesting.

00:21:40.720 --> 00:21:47.280
Yeah. Security is in a lot of people's minds recently with the log4j stuff. And then yeah,

00:21:47.280 --> 00:21:52.260
all of these supply chain attacks that are happening, particularly in the JavaScript space.

00:21:52.260 --> 00:22:00.180
It seems like a lot more happens in that area more so than like Python, but I feel like the packaging

00:22:00.180 --> 00:22:06.700
story is really similar in both. So it's useful to take the lessons learned from the JavaScript ecosystem,

00:22:06.700 --> 00:22:10.420
pull them back into Python. And I think something like this is really valuable,

00:22:10.420 --> 00:22:16.920
particularly, I know some companies have just very difficult bureaucratic processes to like

00:22:16.980 --> 00:22:22.620
get requirements in. And so if you say like, this is just this one file, it has this license,

00:22:22.620 --> 00:22:24.840
we just need this makes it a lot easier.

00:22:24.840 --> 00:22:27.160
We can review the one file that won't auto update.

00:22:27.160 --> 00:22:27.520
Exactly.

00:22:27.520 --> 00:22:32.400
It's going to, yeah. So that's the good news. There's a couple of things worth pointing out

00:22:32.400 --> 00:22:38.240
one over in the PR section is a lot of the stuff inside is not PEP 8 compliant or other stuff.

00:22:38.240 --> 00:22:42.080
So if you drop it into your project, it'll give you a bunch of warnings. So you might want to run

00:22:42.080 --> 00:22:46.680
like black on your on it before you put it in your project. I did a PR that's suggesting that

00:22:46.680 --> 00:22:50.500
that should just be part of it. There's an ongoing conversation about that. Also, it doesn't support

00:22:50.500 --> 00:22:58.160
a couple of the main methods like dot JSON for consuming APIs, and raise for status, which if you

00:22:58.160 --> 00:23:01.700
don't get a successful status, it'll raise an exception. So you don't carry on with bad data.

00:23:01.860 --> 00:23:08.140
So those two are really good. The raise for status is supposed to be put in soon. The JSON one is up

00:23:08.140 --> 00:23:14.100
for debate. With all that said, I have a branch that has all those fixes as PEP 8 compliant.

00:23:14.100 --> 00:23:19.820
f-strings has those two functions that you might use. So you can, people can use that as well.

00:23:19.820 --> 00:23:21.020
If they want.

00:23:21.020 --> 00:23:23.360
Did you put a PR to get those back in?

00:23:23.360 --> 00:23:26.740
Oh yeah. Yeah. That's what I was pointing out before though. I absolutely did. Yeah. They're not,

00:23:26.860 --> 00:23:32.540
I'm debating with the author whether or not he thinks that those are appropriate to add to it.

00:23:32.540 --> 00:23:35.140
Maybe you could rename it medium rec if.

00:23:35.140 --> 00:23:42.180
Medium size rec. So anyway, it's not super important. It's not that big of a deal, but I mean,

00:23:42.180 --> 00:23:47.940
you know, the effect of actually adding those, they're not huge amounts of code that you've got to

00:23:47.940 --> 00:23:54.120
add to make this happen. Like the JSON one is literally one line of code. No, you could take it. I mean,

00:23:54.160 --> 00:23:58.060
do you count the function definition of a separate line? It's two if you got to count the def, but it's

00:23:58.060 --> 00:24:02.220
like super, super small. So if people can grab mine and they can add it or they can grab theirs

00:24:02.220 --> 00:24:05.740
and then add it, whatever. So, or that's the good news.

00:24:05.740 --> 00:24:08.060
Fork the project and make Mewtwo rec.

00:24:08.060 --> 00:24:10.960
Right? So much more Mew.

00:24:10.960 --> 00:24:16.460
Yeah, exactly. Now here's the reality of what I found. I have a lot of projects that have

00:24:16.460 --> 00:24:21.600
10, 20 dependencies because there are, you know, tens of thousands of lines of code and they do a lot of

00:24:21.600 --> 00:24:25.480
stuff. Every single one of those where I thought, Oh, this would be kind of fun just to like cut down

00:24:25.480 --> 00:24:29.240
on the dependencies and the dependencies of the dependencies. Cause what I do with requests is

00:24:29.240 --> 00:24:33.900
real simple. Usually call an API, get some JSON, get some values out of it. It'd be nice to do

00:24:33.900 --> 00:24:42.420
something like this. The reality is so many things depend upon requests. Sentry, for example, depends on

00:24:42.420 --> 00:24:49.780
requests. MailChimp API depends on requests and et cetera, et cetera, et cetera. So by the time you get

00:24:49.780 --> 00:24:54.920
a project built up with other stuff, it's already got requests required and installed and so on.

00:24:54.920 --> 00:25:00.260
So it's like, this is for like a smallish app that doesn't have really many other dependencies that I

00:25:00.260 --> 00:25:04.120
think this makes a lot of sense for. Cause if you depend on a lot of things, you're going to end up

00:25:04.120 --> 00:25:07.380
with requests as a dependency real quick. Yeah. That's a really solid point.

00:25:07.380 --> 00:25:13.240
Yeah. Thanks. Lastly, for people out there listening, wouldn't it be fantastic if a request itself

00:25:13.240 --> 00:25:21.400
offered a, an official mini requests and HTTPX offered a single file version and aiohttp client

00:25:21.400 --> 00:25:27.440
offered a single file version. Like, yeah, it only has 80% of the functions, but if they don't have,

00:25:27.440 --> 00:25:32.120
if those functions don't have dependencies, maybe just drop those in and offer. I don't know. It would be

00:25:32.120 --> 00:25:32.380
great.

00:25:32.380 --> 00:25:37.320
One of the things that I like about actually alternatives, either, either within a project

00:25:37.320 --> 00:25:43.320
itself as an alternative or these forked projects that have the same API is they might have benefits.

00:25:43.320 --> 00:25:51.400
And so, but you have to, you have to weigh those. So it does encourage actually a nice software design

00:25:51.400 --> 00:25:57.580
of a couple of things. One of them is isolate your dependencies to the fuse, few files as possible.

00:25:57.580 --> 00:26:02.800
So if, if you only have one of your modules accessing requests, then you only have one

00:26:02.800 --> 00:26:07.340
place. You need to change it to this new module import. Yeah, absolutely. The other thing is

00:26:07.340 --> 00:26:13.120
testing, testing your behavior. So instead of implementation, so if you test your behavior

00:26:13.120 --> 00:26:18.920
and you've got it isolated, you can drop in a thing, run your, run your CI, see if it all works,

00:26:18.920 --> 00:26:24.800
throw it to a couple, few beta people and run with it if it works. So yeah, quite cool.

00:26:24.800 --> 00:26:30.760
Now, one thing that could be useful and also potentially extremely dangerous is some like

00:26:30.760 --> 00:26:38.200
Python level capacity for shimming a module. So like in the situation that you describe,

00:26:38.200 --> 00:26:43.640
Michael, where you have a ton of dependencies that all require requests, you could pull in something

00:26:43.640 --> 00:26:50.180
like murec and then just say like, this is a request. Python, I want you to think of this as requests.

00:26:50.740 --> 00:26:55.700
Yeah. But obviously that has, I mean, it's just an idea. It has some pretty bad security implications

00:26:55.700 --> 00:27:02.480
with people being able to usurp that. So yeah, it may cost some unexpected behavior, but yeah,

00:27:02.480 --> 00:27:08.620
it's also could be good. All right. Just put your entire application inside of a patch statement.

00:27:08.620 --> 00:27:13.960
No, just kidding. What I'm hearing is that we need to make our entire application one file

00:27:13.960 --> 00:27:16.420
in every case and that will just solve all of the problems.

00:27:16.420 --> 00:27:18.500
Just one function actually. Just one main.

00:27:18.500 --> 00:27:20.400
It's perfect.

00:27:20.400 --> 00:27:22.780
We don't even need a function in Python, right?

00:27:22.780 --> 00:27:24.840
Yeah. Okay. Yeah. No functions.

00:27:24.840 --> 00:27:28.700
It just runs once, top to bottom. Let's go.

00:27:28.700 --> 00:27:33.660
Now I was streaming of a world where like there's a simple use case that you don't have to have a

00:27:33.660 --> 00:27:38.240
bunch of dependencies and dependencies, but it's probably a little extreme and when you take it

00:27:38.240 --> 00:27:41.060
very far at all. All right, Brian, what you got for the next one here?

00:27:41.060 --> 00:27:45.880
Oh, this is your extra. No, Madison, you're taking us out for a many times.

00:27:45.880 --> 00:27:46.160
Yeah.

00:27:46.160 --> 00:27:54.540
Yeah. Welcome to Openverse. This is not the metaverse, but everything is, you know, I say call the tech

00:27:54.540 --> 00:28:02.720
industry a song because everything's a verse these days. But this is a search engine for openly licensed

00:28:02.720 --> 00:28:08.680
media. This is something that the WordPress community is supporting. And so what I mean by

00:28:08.680 --> 00:28:16.660
openly licensed media is images and audio. That's what we have currently. But we're hoping down the

00:28:16.660 --> 00:28:26.060
line to have things like video, 3D models, text, all assets and media that you can use without having

00:28:26.060 --> 00:28:32.540
to pay for them. And just some licenses require attribution. Others don't. A lot of them are free

00:28:32.540 --> 00:28:40.600
for remix and reuse. And so this used to be called CC search under the Creative Commons sort of purview,

00:28:40.600 --> 00:28:47.700
but they've handed it off to us to help shepherd into the future. And so if you are looking for content

00:28:47.700 --> 00:28:54.480
to use on your blog or your podcast or anything that you're creating, any sort of content that you're creating,

00:28:54.480 --> 00:29:00.920
your conference presentation, your conference presentation, your courses, whatever, there's a lot of a lot of times I'm like,

00:29:00.920 --> 00:29:03.560
I need an image. I need to be able to use it.

00:29:03.560 --> 00:29:06.640
Or a snippet of audio to throw someplace. This is awesome.

00:29:06.800 --> 00:29:13.020
Yeah. So I'll show an example here in the live stream. I'm going to type Jupyter. And I have to spell it right. I typed

00:29:13.020 --> 00:29:21.240
Jupyter last time. And yeah, you just get a bunch of pictures of, you know, Jupyter and then also different sound clips that we have

00:29:21.240 --> 00:29:29.120
mixed in if you want all of the results. You can also filter by just certain media types, like seeing just images or seeing just the audio results.

00:29:29.120 --> 00:29:34.380
And then when you click on an image, you'll see the attribution for that image right there alongside it.

00:29:34.380 --> 00:29:37.960
And so you can just copy that and put it in your website after you link the image.

00:29:37.960 --> 00:29:45.960
And we have over 600 million images in Openverse and more audio and more images and more just media in general to come.

00:29:45.960 --> 00:29:46.940
Fantastic.

00:29:46.940 --> 00:29:53.460
Oh, and if we search, sorry, if we search Jupyter, there's some fun, like, conference-y, you know, screenshots.

00:29:53.460 --> 00:29:55.940
So there's, you know, lots to use here.

00:29:55.940 --> 00:29:59.260
Cool. Alvaro asks, can you search by license type?

00:29:59.260 --> 00:30:07.100
Yeah. So I'm sharing this in the live stream, but on the right, the first filter that we have is by different license types.

00:30:07.100 --> 00:30:12.000
And a lot of these are, I believe they're creative commons license, but not all of them are.

00:30:12.000 --> 00:30:15.800
We have public domain markered licenses as well.

00:30:15.800 --> 00:30:19.860
And then you can search by use too, depending on how you're using that.

00:30:19.860 --> 00:30:26.220
So if you're using it commercially, that's going to have different licenses and implications for you versus modifying and adapting.

00:30:26.940 --> 00:30:36.940
And then we have, I mean, Openverse serves as like an aggregate for different entities that host some of this openly licensed media.

00:30:36.940 --> 00:30:41.220
So things like museums, you know, NASA's photos, that sort of thing.

00:30:41.220 --> 00:30:43.260
And so you can also search by provider too.

00:30:43.260 --> 00:30:50.280
So if you're looking for space photos and you say, I just want NASA's authority on this, then you can sort of filter by that.

00:30:50.280 --> 00:30:52.200
By that aggregate.

00:30:52.200 --> 00:30:52.500
Very cool.

00:30:52.620 --> 00:30:52.740
Yeah.

00:30:52.740 --> 00:30:53.240
Yeah.

00:30:53.240 --> 00:30:56.140
This is a constant challenge and it's great.

00:30:56.140 --> 00:30:57.440
Like it's a challenge for blogs.

00:30:57.440 --> 00:30:59.480
It's a challenge for like all these things.

00:30:59.480 --> 00:30:59.640
Right.

00:30:59.640 --> 00:31:02.580
But it makes perfect sense why WordPress would be interested in this.

00:31:02.580 --> 00:31:02.960
Totally.

00:31:02.960 --> 00:31:03.360
Yeah.

00:31:03.360 --> 00:31:07.100
And we're hoping to have it integrated into WordPress down the line.

00:31:07.260 --> 00:31:14.940
So like if you're working on a WordPress site and you want to add an image, one of the blocks that you can pull up is just a search on Openverse.

00:31:14.940 --> 00:31:17.580
And then you pull it in and it will pull the attribution in with it.

00:31:17.580 --> 00:31:20.240
And you don't have to do a whole lot of extra work.

00:31:20.240 --> 00:31:24.120
So we're hoping that that's going to be coming down the line too.

00:31:24.600 --> 00:31:32.320
And yeah, it's so easy to just like go to Google Images and find an image, but it's harder to find the appropriate attribution for that.

00:31:32.320 --> 00:31:37.920
And particularly you can get into some very interesting legal spaces if you're making money off of that photo too.

00:31:37.920 --> 00:31:38.160
Right.

00:31:38.160 --> 00:31:42.080
I mean, it makes perfect sense if you're like a high school student doing like a research project.

00:31:42.080 --> 00:31:42.580
Who cares?

00:31:42.580 --> 00:31:42.860
Right.

00:31:43.080 --> 00:31:47.920
But it starts to push the limit if you're selling something or you're making a book or whatever.

00:31:47.920 --> 00:31:48.680
Yeah.

00:31:48.680 --> 00:31:54.600
One of the things I think is interesting is that the difference between non-commercial and commercial.

00:31:54.600 --> 00:31:59.980
And we think of it like big companies or blogs or something.

00:31:59.980 --> 00:32:09.200
And it's not that cut and dry because like you start, say you're starting a podcast, you start getting sponsors and you're making like five bucks a week.

00:32:09.200 --> 00:32:10.300
That's commercial.

00:32:11.020 --> 00:32:14.120
But it's not like I can afford a huge license.

00:32:14.120 --> 00:32:14.920
So, yeah.

00:32:14.920 --> 00:32:15.440
Right.

00:32:15.440 --> 00:32:15.880
Exactly.

00:32:15.880 --> 00:32:20.140
And I mean, maybe you started non-commercially and then it became commercial.

00:32:20.140 --> 00:32:20.460
Yeah.

00:32:20.460 --> 00:32:20.720
Right.

00:32:20.720 --> 00:32:23.080
But you had already used it and stuff like that as well.

00:32:23.080 --> 00:32:23.520
Yeah.

00:32:23.520 --> 00:32:25.900
How about a real time feature request?

00:32:25.900 --> 00:32:32.040
Dean Langston asks, I wish it had a, this is a ping with a transparent background.

00:32:32.040 --> 00:32:33.200
I hear it.

00:32:33.200 --> 00:32:33.600
I hear it.

00:32:33.600 --> 00:32:35.960
I use that feature all the time in Google Images.

00:32:35.960 --> 00:32:36.520
Yeah.

00:32:36.520 --> 00:32:39.120
We actually just finished a redesign of the site.

00:32:39.120 --> 00:32:40.580
We launched yesterday.

00:32:40.960 --> 00:32:43.240
For this redesign, which is really exciting.

00:32:43.240 --> 00:32:49.660
But we have, I mean, we have lots of stuff that we want to, we want to start adding to this.

00:32:49.660 --> 00:32:53.960
Turns out that making a search engine is not easy.

00:32:53.960 --> 00:32:54.920
Surprise.

00:32:55.600 --> 00:32:57.640
So there's a lot of work to be done.

00:32:57.640 --> 00:32:59.380
But that's, yeah, that's a great feature request.

00:32:59.380 --> 00:33:01.840
All of this too is a great plug.

00:33:01.840 --> 00:33:02.960
So thank you for that comment.

00:33:02.960 --> 00:33:04.460
All of this is open source.

00:33:04.460 --> 00:33:10.380
And so if you just search Openverse GitHub, like we had mentioned earlier, because if you just search Openverse, you'll actually get the site.

00:33:11.380 --> 00:33:16.900
You can go and make an issue on any one of the number of repos that we have for describing this project.

00:33:16.900 --> 00:33:31.120
And on top of that too, if you know of a content provider, like a museum or whatnot that has an API that could have its images added to Openverse, we're trying to make it really easy to write those.

00:33:31.120 --> 00:33:33.120
We call them provider ingestion scripts.

00:33:33.720 --> 00:33:37.900
So even if you just know of one, you can make an issue for us and we'll write the provider script.

00:33:37.900 --> 00:33:40.820
But we also love, you know, public contributions.

00:33:40.820 --> 00:33:44.760
If you have a source that you want to add and you want to get it into Openverse.

00:33:44.760 --> 00:33:45.820
Oh, yeah, that's great.

00:33:45.820 --> 00:33:47.660
Brian, now are you ready for your extras?

00:33:47.660 --> 00:33:48.420
I am.

00:33:48.420 --> 00:33:48.820
Yeah.

00:33:48.820 --> 00:33:53.880
So we were talking about security and supply chain for packages.

00:33:53.880 --> 00:33:58.380
And so I noticed this actually, gosh, it just came out.

00:33:58.380 --> 00:33:59.620
Like, was it yesterday?

00:33:59.620 --> 00:34:00.460
Yesterday.

00:34:01.140 --> 00:34:11.040
Brett Cannon announced that he's got a, he has a GitHub action that called pip secure install that he published.

00:34:11.040 --> 00:34:15.440
And apparently VS Code or VS Code Python uses it.

00:34:15.440 --> 00:34:25.500
But the thing is, is it just sort of, if you pip install something with a requirements file, it could have who knows what it all is in there and your requirements.

00:34:25.500 --> 00:34:27.460
And then they have dependencies and they have dependencies.

00:34:28.000 --> 00:34:38.160
So this, this secure install is, allows you to do through GitHub actions, use a requirements file, but you have to have, you have to have stuff in it.

00:34:38.200 --> 00:34:44.400
So you have to have, no, it doesn't pick up any dependencies and it requires hashes.

00:34:44.400 --> 00:34:57.160
So you, so you have to have a full requirements file with all of, all of the dependency tree in there with the hashes to eliminate, eliminate these like supply chain problems.

00:34:57.160 --> 00:35:02.960
It doesn't eliminate them, but once you've tested a good package, you can just, you know, put this in there.

00:35:03.100 --> 00:35:06.620
So I just wanted to shout out for, for this project by Brett.

00:35:06.620 --> 00:35:07.900
So that was cool.

00:35:07.900 --> 00:35:11.920
The second thing I wanted to shout out, which I'm like totally excited.

00:35:11.920 --> 00:35:18.860
Basically, this is a shout out to everybody out there listening to this that has supported the Python testing with pytest book.

00:35:19.020 --> 00:35:24.620
I was talking right before we started recording that today is the last day I get to touch it.

00:35:24.620 --> 00:35:35.120
I get to my final edits are going in, but because of all the beta, the beta purchasers it's supported the rewrite and just, just been awesome support.

00:35:35.120 --> 00:35:38.800
And right now it's at number two is the bestseller on pragmatic.

00:35:38.800 --> 00:35:39.840
So that's pretty exciting.

00:35:39.840 --> 00:35:40.500
Congratulations.

00:35:40.500 --> 00:35:41.100
That's awesome.

00:35:41.100 --> 00:35:41.840
That's fantastic.

00:35:41.840 --> 00:35:42.300
Yeah.

00:35:42.300 --> 00:35:45.080
Madison back to you.

00:35:45.080 --> 00:35:46.880
Anything you want to give a quick shout out to?

00:35:47.020 --> 00:35:47.100
Yeah.

00:35:47.100 --> 00:35:48.600
A couple, couple quick things.

00:35:48.600 --> 00:35:53.740
One thing I forgot to mention about Openverse is also written mostly in Python too.

00:35:53.740 --> 00:35:56.240
So if you're familiar with Python, you can, you can help contribute.

00:35:56.240 --> 00:35:57.040
But on top of that.

00:35:57.040 --> 00:35:59.540
No, no, that's, yeah.

00:35:59.540 --> 00:36:09.100
It's kind of interesting because most of WordPress is PHP and JavaScript, but Openverse is a fun little extra, you know, blob on the side that runs in Python.

00:36:09.100 --> 00:36:09.480
So.

00:36:09.480 --> 00:36:09.960
Yeah.

00:36:09.960 --> 00:36:10.240
Beautiful.

00:36:10.240 --> 00:36:13.480
Speaking of small Python web apps and whatnot.

00:36:13.480 --> 00:36:19.160
Some folks in Seattle recently launched a new police accountability and information tool.

00:36:20.040 --> 00:36:21.280
And so this is just a tool.

00:36:21.280 --> 00:36:23.920
It's spd.watch for the URL.

00:36:23.920 --> 00:36:31.980
And it's a tool that just allows you to search for police officers in the Seattle area and get information on them.

00:36:31.980 --> 00:36:39.240
So, you know, if you're interacting with an officer, sort of what their, what their history is, how long they've been with the force, that sort of thing.

00:36:39.240 --> 00:36:41.340
And it can be really useful for community safety.

00:36:41.680 --> 00:36:43.000
And also just accountability.

00:36:43.000 --> 00:36:48.380
And you all had mentioned Just in episode 242.

00:36:48.380 --> 00:36:51.620
I just wanted to give, I just wanted to give a shout out to it.

00:36:51.620 --> 00:36:54.820
I have been using this for every single project that I have touched.

00:36:54.820 --> 00:36:59.400
When I go to a project that doesn't have Just, I get very angry.

00:36:59.400 --> 00:37:01.480
It's so fantastic.

00:37:01.480 --> 00:37:07.520
I mean, the fact that you can add comments for different recipes, your recipes can build on other recipes.

00:37:08.280 --> 00:37:16.380
There's a lot of complexity that you can have in the Just file, which makes it easy for new people to come on and start contributing.

00:37:16.380 --> 00:37:25.720
And so if you have, like, lots of Docker containers that require, you know, certain specialization in some sense, you don't have to write this big, long read me that describes all the steps.

00:37:25.720 --> 00:37:28.340
You say, download Just, and then Just run.

00:37:28.340 --> 00:37:29.020
And that's it.

00:37:29.020 --> 00:37:29.760
It's so nice.

00:37:29.760 --> 00:37:31.780
I totally forgot about Just.

00:37:31.780 --> 00:37:33.040
So I'm glad you brought it up again.

00:37:33.040 --> 00:37:36.220
It's so, I just, I can't sing its praises enough, honestly.

00:37:36.320 --> 00:37:41.600
Although I do have to say, its name does make it very difficult to do Google searches for.

00:37:41.600 --> 00:37:47.960
And then lastly, I just want to give a shout out to the GitHub Package Registry.

00:37:47.960 --> 00:37:53.620
That's ghcr.io for githubcontainerregistry.io.

00:37:53.620 --> 00:37:58.360
They do free Docker image hosting for open source projects.

00:37:58.880 --> 00:38:00.560
And I'm not sure what the pricing is for it.

00:38:00.560 --> 00:38:01.600
There's, or we could see the pricing.

00:38:01.600 --> 00:38:04.120
But, yeah, they do.

00:38:04.120 --> 00:38:08.540
They do free for open source projects, which Openverse is taking advantage of.

00:38:08.540 --> 00:38:10.980
And I've used on a number of personal projects.

00:38:10.980 --> 00:38:19.580
And it's been incredibly helpful to just be able to build and push an image for free with GitHub Actions and then have that hosted for free on GitHub Container Registry.

00:38:19.940 --> 00:38:20.380
Oh, that's cool.

00:38:20.380 --> 00:38:21.280
Yeah, it looks handy.

00:38:21.280 --> 00:38:21.900
Cool.

00:38:21.900 --> 00:38:22.480
Nice.

00:38:22.480 --> 00:38:23.420
How about you, Michael?

00:38:23.420 --> 00:38:24.720
I got a couple as well.

00:38:24.720 --> 00:38:25.660
Yeah, I got a couple.

00:38:25.660 --> 00:38:27.000
Let me go back here.

00:38:27.000 --> 00:38:35.280
So very kind message came out on Twitter saying, here's a really cool way you can go to the transcripts for the podcast, which is on GitHub.

00:38:35.280 --> 00:38:39.580
And then you can do like a search across them using some nice GitHub search features.

00:38:39.580 --> 00:38:40.840
Absolutely true.

00:38:40.840 --> 00:38:41.820
Very nice.

00:38:41.820 --> 00:38:46.820
I also wanted to point out a couple of things that we actually have some neat features that people can play with.

00:38:46.820 --> 00:38:48.780
First of all, we have a search engine.

00:38:48.780 --> 00:38:49.900
You can click on the upper right.

00:38:49.900 --> 00:38:51.260
This is, look, we're live streaming.

00:38:51.260 --> 00:38:56.540
So the thing you can search for, so I could search for like pytest and it would come up with the episodes and whatnot.

00:38:56.540 --> 00:38:57.380
I could search for Hawaii.

00:38:57.380 --> 00:38:58.420
Like every single episode.

00:38:58.420 --> 00:38:59.420
Yeah, exactly.

00:38:59.420 --> 00:39:02.880
So we get like our Python on the beach that we did recently and whatnot.

00:39:02.880 --> 00:39:06.260
My search for just was very difficult, but through no fault of your own.

00:39:06.260 --> 00:39:08.760
If you search for just, we get a whole bunch of stuff back.

00:39:08.760 --> 00:39:09.820
Yeah, yeah.

00:39:09.820 --> 00:39:11.400
But it's pretty neat.

00:39:11.400 --> 00:39:13.240
It also has a JSON API.

00:39:13.240 --> 00:39:20.660
If people want to consume that, they can go and search for stuff and then it'll come up with, you know, a JSON variant of results and whatnot.

00:39:20.660 --> 00:39:21.300
Yeah.

00:39:21.300 --> 00:39:23.120
So that has been there for a while.

00:39:23.120 --> 00:39:24.720
So people can check that out and that's cool.

00:39:24.720 --> 00:39:27.260
But I also wanted to point out something brand new, Brian.

00:39:27.260 --> 00:39:29.960
I don't know if you even got a chance to play with this because I just did this.

00:39:29.960 --> 00:39:30.400
I did.

00:39:30.400 --> 00:39:31.140
It's so cool.

00:39:31.140 --> 00:39:32.040
It's so good.

00:39:32.040 --> 00:39:41.120
So if you go to a trans or the transcript, so if you're on any episode, usually on the right, it'll say, unless the screen is really small, then it might be the bottom.

00:39:41.120 --> 00:39:42.100
It'll say full transcript.

00:39:42.100 --> 00:39:46.360
And then you can go in here and there's transcripts, which are searchable and there's a play thing.

00:39:46.360 --> 00:39:52.600
But there's also now a ability to click on any paragraph or sentence, the little play button next to it.

00:39:52.600 --> 00:39:52.960
That's awesome.

00:39:52.960 --> 00:39:55.560
And it'll just start playing the episode at that time.

00:39:55.560 --> 00:40:00.520
So if people want to go back and use what we've been doing for four or five years, whatever it's been,

00:40:01.160 --> 00:40:04.100
as resources, yeah, that should make it a little bit easier.

00:40:04.100 --> 00:40:07.140
Did you back part this to like old episodes also?

00:40:07.140 --> 00:40:10.700
Yeah, because this is so let me tell you how I did it.

00:40:10.700 --> 00:40:13.060
Because the transcripts, if you look at them, they just have a number.

00:40:13.060 --> 00:40:14.660
They just have like a timestamp there.

00:40:14.660 --> 00:40:14.900
Yeah.

00:40:15.980 --> 00:40:27.080
So I use this really cool regular expressions 101 or regex101.com tool website to build up the regex using named groups.

00:40:27.460 --> 00:40:29.840
And let me just check this out, which is on the screen.

00:40:29.840 --> 00:40:31.120
You guys, you'll check out the link.

00:40:31.120 --> 00:40:33.540
If you're listening, you can put the thing you want to search for.

00:40:33.660 --> 00:40:37.340
And then the groups and the regex, it'll show if it's a match.

00:40:37.340 --> 00:40:48.460
It'll actually highlight and name the different elements and color code the syntax of your regular expression elements into like name sections and all sorts of cool stuff.

00:40:48.460 --> 00:40:49.220
What do you think of that?

00:40:49.220 --> 00:40:50.180
It's awesome.

00:40:50.380 --> 00:40:57.680
If I'm writing a regular expression that's longer than like three or four characters, then I'm using regex101.

00:40:57.680 --> 00:40:59.500
Like this site is so fantastic.

00:40:59.500 --> 00:41:00.540
It is.

00:41:00.540 --> 00:41:01.740
I totally agree.

00:41:01.740 --> 00:41:06.500
It has the references in the bottom right too for the different whatever the tokens.

00:41:06.500 --> 00:41:07.640
Felix has loved it as well.

00:41:07.640 --> 00:41:08.880
And so it also gives you hope.

00:41:08.880 --> 00:41:18.840
So if I put it like on the D+, which means find one or more numbers, it'll say exactly what that kind of stuff means and so on.

00:41:18.940 --> 00:41:23.220
So you can say like B down here and it'll tell you, you know, what is that doing?

00:41:23.220 --> 00:41:23.880
And so on.

00:41:23.880 --> 00:41:24.720
And that's a quick one.

00:41:24.720 --> 00:41:25.580
Somewhere there's a search.

00:41:25.580 --> 00:41:32.400
But it was nice that it will actually show you which sections and give you extra information about it and all kinds of neat stuff.

00:41:32.400 --> 00:41:37.200
And like full descriptions too of like what each particular thing is doing.

00:41:37.200 --> 00:41:37.760
It's so great.

00:41:37.760 --> 00:41:38.560
There you go.

00:41:38.560 --> 00:41:46.940
So if you like hover over the backslash D+, or whatever I got here, it says Meta Escape matches a digit equivalent to bracket zero to nine.

00:41:46.940 --> 00:41:48.120
Here's a name group.

00:41:48.360 --> 00:41:49.920
Here's just that matches the character.

00:41:49.920 --> 00:41:53.880
And you just as you hover, you know, starts the start of the text, right?

00:41:53.880 --> 00:41:54.400
For a carrot.

00:41:54.400 --> 00:42:01.000
And as you hover over these things, you get real time like autocomplete for like the meaning of that section.

00:42:01.000 --> 00:42:04.820
And like a full explanation in the top right too, which can be really helpful.

00:42:04.820 --> 00:42:05.660
Absolutely.

00:42:05.940 --> 00:42:12.880
Because so often when I look at this kind of stuff, it's right only, you know, like I got it working and I can't decipher it again.

00:42:12.880 --> 00:42:15.740
So you can put it back in here and come to an understanding, which is cool.

00:42:15.740 --> 00:42:16.260
All right.

00:42:16.920 --> 00:42:18.160
One more thing real quick.

00:42:18.160 --> 00:42:20.880
A new video on my Python short series that I'm doing.

00:42:20.880 --> 00:42:22.140
Do you even need loops in Python?

00:42:22.140 --> 00:42:23.320
People can check that out.

00:42:24.120 --> 00:42:27.920
So it's really about list comprehensions and fun stuff you can do with list comprehensions in Python.

00:42:27.920 --> 00:42:29.220
So I've been having a lot of fun with that.

00:42:29.220 --> 00:42:34.500
And the open verse sounds very interesting for grabbing content to throw in some of those videos as well.

00:42:34.500 --> 00:42:34.940
Oops.

00:42:34.940 --> 00:42:35.440
Yeah.

00:42:36.000 --> 00:42:36.360
Absolutely.

00:42:36.360 --> 00:42:37.160
All right.

00:42:37.160 --> 00:42:39.700
Well, that brings us to our joke, I do believe.

00:42:39.700 --> 00:42:40.280
All right.

00:42:40.280 --> 00:42:40.960
You all ready for it?

00:42:40.960 --> 00:42:41.980
I have one.

00:42:41.980 --> 00:42:43.360
There's a...

00:42:43.360 --> 00:42:43.660
Oh, yeah.

00:42:43.660 --> 00:42:44.300
I found a video.

00:42:44.300 --> 00:42:44.720
Sorry.

00:42:44.720 --> 00:42:47.060
This got shared in...

00:42:47.060 --> 00:42:51.080
Speaking of Python loops, I don't know that I'm going to be able to show it, but well, fingers crossed here.

00:42:51.080 --> 00:42:53.160
I...

00:42:53.160 --> 00:43:00.000
This video was shared in a work channel recently, and I'm not going to be able to show it.

00:43:00.000 --> 00:43:04.600
But it's a snake that is moving around a box.

00:43:04.600 --> 00:43:05.840
Oh, here we go.

00:43:06.100 --> 00:43:06.360
Perfect.

00:43:06.360 --> 00:43:08.820
Oh, I love it.

00:43:08.820 --> 00:43:11.260
Speaking of Python loops...

00:43:11.260 --> 00:43:13.420
So you really don't need these Python loops.

00:43:13.420 --> 00:43:14.700
Yes, exactly.

00:43:14.700 --> 00:43:15.600
Oh, my God.

00:43:15.600 --> 00:43:19.740
It's a Python slithering around a box, which is rotating it in a circle.

00:43:19.740 --> 00:43:21.200
Here's a simple loop with Python.

00:43:21.200 --> 00:43:22.060
And it also...

00:43:22.060 --> 00:43:25.280
The snake isn't moving anywhere because of the way that it's slithering.

00:43:25.280 --> 00:43:28.780
So anyway, you really don't need loops.

00:43:28.780 --> 00:43:30.100
I love it.

00:43:30.100 --> 00:43:30.760
That's awesome.

00:43:30.760 --> 00:43:33.540
Roller out there says, the new Python short channel is great.

00:43:33.540 --> 00:43:34.100
Thanks, Michael.

00:43:34.100 --> 00:43:38.660
And Alvaro says, I usually test my regex with set and grep on the command line.

00:43:38.660 --> 00:43:39.740
This seems easier.

00:43:39.740 --> 00:43:41.820
That thing is awesome.

00:43:41.820 --> 00:43:42.660
All right.

00:43:42.660 --> 00:43:47.380
So I've got a joke that is not my joke, but is from instead Josh Thurston.

00:43:47.380 --> 00:43:48.500
He sent them in a little while ago.

00:43:48.840 --> 00:43:51.600
So there's kind of three together in sequence.

00:43:51.600 --> 00:43:52.700
So here we go.

00:43:52.700 --> 00:43:54.780
How did the hacker get away from the police?

00:43:54.780 --> 00:43:57.000
He just ran somewhere.

00:43:57.000 --> 00:43:57.920
Boo.

00:43:57.920 --> 00:44:01.420
Oh, that joke makes me want to cry.

00:44:01.420 --> 00:44:01.920
Oh, my goodness.

00:44:01.920 --> 00:44:05.060
Where do you find a hacker?

00:44:05.060 --> 00:44:06.020
Indie Crypt.

00:44:06.020 --> 00:44:07.400
Oh, my goodness.

00:44:07.400 --> 00:44:08.540
Oh, they're so bad.

00:44:08.540 --> 00:44:09.320
These are full...

00:44:09.320 --> 00:44:10.500
Hold on.

00:44:10.500 --> 00:44:11.480
I'll add them to the stream as well.

00:44:11.480 --> 00:44:13.220
Those are full-on dad jokes right there.

00:44:13.560 --> 00:44:15.860
That's two thumbs down in a good way.

00:44:15.860 --> 00:44:17.040
Absolutely.

00:44:17.040 --> 00:44:20.300
Like overflows the bad buffer and becomes good again.

00:44:20.300 --> 00:44:21.560
Yeah.

00:44:21.560 --> 00:44:21.920
Wow.

00:44:21.920 --> 00:44:23.660
Fantastic.

00:44:23.660 --> 00:44:24.520
All right.

00:44:24.520 --> 00:44:26.200
Well, speaking of fantastic, great to have you here, Madison.

00:44:26.200 --> 00:44:27.360
Thanks so much for having me.

00:44:27.360 --> 00:44:27.720
As always.

00:44:27.720 --> 00:44:28.400
It's good.

00:44:28.400 --> 00:44:28.780
You're welcome.

00:44:28.780 --> 00:44:29.600
Yep.

00:44:29.600 --> 00:44:30.580
Talk to everybody later.

00:44:30.940 --> 00:44:31.120
Yeah.

00:44:31.120 --> 00:44:31.660
Thanks, everyone.

00:44:31.660 --> 00:44:31.860
Have a good one.

00:44:31.860 --> 00:44:33.920
Thanks for listening to Python Bytes.

00:44:33.920 --> 00:44:36.720
Follow the show on Twitter via at Python Bytes.

00:44:36.720 --> 00:44:39.860
That's Python Bytes as in B-Y-T-E-S.

00:44:39.860 --> 00:44:42.720
Get the full show notes over at pythonbytes.fm.

00:44:42.720 --> 00:44:47.640
If you have a news item we should cover, just visit pythonbytes.fm and click submit in the

00:44:47.640 --> 00:44:48.060
nav bar.

00:44:48.060 --> 00:44:50.220
We're always on the lookout for sharing something cool.

00:44:50.220 --> 00:44:54.880
If you want to join us for the live recording, just visit the website and click live stream to

00:44:54.880 --> 00:44:57.620
get notified of when our next episode goes live.

00:44:57.780 --> 00:45:02.020
That's usually happening at noon Pacific on Wednesdays over at YouTube.

00:45:02.020 --> 00:45:05.400
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:45:05.400 --> 00:45:09.120
Thank you for listening and sharing this podcast with your friends and colleagues.

