TRANSCRIÇÃO 🔗
WEBVTT
00:00:00.020 --> 00:00:04.660
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:00:05.240 --> 00:00:08.980
This is episode 427, recorded April 7th, 2025.
00:00:09.720 --> 00:00:10.620
And I am Brian Okken.
00:00:10.880 --> 00:00:11.500
And I'm Michael Kennedy.
00:00:12.340 --> 00:00:16.340
And this episode is brought to you by Posit Package Manager.
00:00:16.980 --> 00:00:18.900
Check their spot out later in the show.
00:00:19.220 --> 00:00:23.160
Also connect with us if you'd like to on Mastodon or Bluesky.
00:00:23.920 --> 00:00:24.800
Links are in the show notes.
00:00:26.000 --> 00:00:36.360
And then also, if you'd listen to us through a podcast player or something, occasionally it's fun to stop by and watch us live or at least see past live episodes.
00:00:36.680 --> 00:00:38.840
You can go to pythonbytes.fm/live.
00:00:39.080 --> 00:00:42.200
We usually do it Mondays at 10, but sometimes it changes.
00:00:43.040 --> 00:00:44.780
Anyway, it's fun to have you here.
00:00:45.160 --> 00:00:48.460
And some people hop in and ask questions and it's good.
00:00:48.800 --> 00:00:56.100
Anyway, also after the show, when we have everything all the dust settles, We send out links through our newsletter.
00:00:56.830 --> 00:01:06.940
So please go to pythonbytes.fm and add your name to the email newsletter, and you'll get the links and some extra content delivered right to your inbox.
00:01:07.480 --> 00:01:08.140
It's pretty good.
00:01:08.880 --> 00:01:09.100
Absolutely.
00:01:09.160 --> 00:01:10.580
Michael, what
00:01:10.580 --> 00:01:11.700
do you got for us to start with?
00:01:11.920 --> 00:01:12.980
Let's go on a trip, Brian.
00:01:13.760 --> 00:01:14.520
Let's go on a trip.
00:01:14.860 --> 00:01:15.020
Okay.
00:01:15.320 --> 00:01:18.060
I want to go to take a little trip to GitTown.
00:01:18.580 --> 00:01:19.860
GitTown 18.3.
00:01:20.080 --> 00:01:20.500
Let's do it.
00:01:21.080 --> 00:01:23.980
So Git Town is an interesting project.
00:01:24.460 --> 00:01:25.860
I believe it's written in Python.
00:01:26.220 --> 00:01:29.320
I'll double check that in a second, although it's not totally germane.
00:01:29.640 --> 00:01:31.280
It's a tool that you can use.
00:01:31.680 --> 00:01:47.160
And the idea is with the Git CLI, or honestly, most of the Git GUIs, I'm a big fan of primarily doing Git through GUI operations using Sourcetree, PyCharm, VS Code, whatever I happen to be in, right?
00:01:47.480 --> 00:01:47.560
I
00:01:47.560 --> 00:01:48.140
don't think I'm like,
00:01:48.160 --> 00:01:53.440
well, pretend my editor doesn't know what any of the source control is and go to the terminal and do it and then come back.
00:01:53.540 --> 00:02:01.780
Like I just preferred that way, especially, you know, that's why I called out that Git branch explorer, that, that TUI based one that we talked about last week
00:02:01.780 --> 00:02:02.600
in
00:02:02.600 --> 00:02:02.760
Rust.
00:02:03.240 --> 00:02:16.960
So one of the things you'll find with most of these tools, especially the CLI, but often all of them is they're great at the atomic operations of Git and source control, but they don't have workflows built into them.
00:02:17.300 --> 00:02:22.080
So by that, I mean, I want to create a feature branch off of this branch.
00:02:22.360 --> 00:04:04.940
And as I'm working on the feature branch, I would like to be able to type a single command and have that branch make sure that it's up to date with it without breaking the work that I'm currently doing. Maybe in the middle of a feature branch I'm working on, I need to create a bug fix branch and do that, come back, sync them. There's like these higher level things that you would like to do. Okay. So Git Town is a CLI, I think it's a plugin. I think Git has like plugin type things because the commands are still Git space command, subcommands of Git, right? So it's not a totally separate thing. Anyway, it operates all, it sort of brings all those together. And so if you're, if what I'm about to describe sounds interesting to you, you should really, really watch this seven minute video at git-town.com and it says, please check it out. Right. So just watch this and it talks through the different scenarios, shows you how it works, and so on. However, if you jump over to the Git town GitHub repo, it gives you a much better understanding of all the pieces there. And by written in Python, I mean written in Go. Okay. So it has a couple of different commands. It says I could type git, like in a git repo, I could type git space hack. And that will create a new feature branch that I can explore that will not affect any of the main work. And if I need to throw it away or whatever, it's fine. It's kind of like the exploratory, like hack in a positive sense, not hack is in the, I got a hoodie and it's shady in my room sort of thing. Or sync. If I'm on top, if I'm on some kind of feature branch, I can update that branch from the main. Cause one of the things you want to do as you're, if you have a long running feature branch is keep periodically pulling from the main branch in there so you are less distant from it, right?
00:04:05.180 --> 00:04:14.920
If for some reason, like when you want to go back, you want that to be just your changes, not your changes plus all of the conflicts that you've been potentially messing with and you've got another round basically.
00:04:15.060 --> 00:04:17.320
So this, you would just type git space sync.
00:04:17.660 --> 00:04:18.040
That's cool.
00:04:18.380 --> 00:04:28.400
You could type git switch to change branches via UI or once you're happy with your feature branch, you could say git propose and that'll create a merge.
00:04:28.860 --> 00:04:33.620
It'll create a pull or merge request for a feature branch back on GitHub, things like that.
00:04:33.920 --> 00:04:35.400
So there's a bunch of cool things like that.
00:04:36.000 --> 00:04:38.400
I
Load full transcript
thought it was going to ask it to a dance.
00:04:39.940 --> 00:04:40.280
Exactly.
00:04:40.780 --> 00:04:47.400
You know, I mean, I know we haven't talked much, and I know this is seventh grade, and we're all really shy, but do you go to the dance with me?
00:04:47.660 --> 00:04:48.640
My dad can drive us.
00:04:50.320 --> 00:04:57.860
Another one is you can do things like git ship, which will merge a completed feature branch and then remove it once it's successfully shipped over and so on.
00:04:57.900 --> 00:04:59.880
So there's like these cool things on top of it.
00:04:59.880 --> 00:05:05.840
But certainly I recommend watching that video, that seven-minute video, to see if this is something that's interesting to you.
00:05:06.220 --> 00:05:06.940
I think I like it.
00:05:06.940 --> 00:05:07.640
I think it's pretty cool.
00:05:09.020 --> 00:05:13.020
There's some cool ones that I always forget about, like Get Town Rename.
00:05:14.760 --> 00:05:19.640
I mean, renaming is not difficult, but it's nice to have a little minor.
00:05:20.300 --> 00:05:20.560
Absolutely.
00:05:20.800 --> 00:05:31.520
And if you watch the video, you'll see that there's a lot of – really this thing is mostly built around like, yeah, you could – You're like, well, why can't I just do, you know, Git merge from this branch and this and that?
00:05:31.620 --> 00:05:32.900
Sure, you can do these things.
00:05:33.260 --> 00:05:33.600
But it
00:05:33.600 --> 00:05:36.620
has a bunch of little steps to kind of catch the edge cases.
00:05:36.940 --> 00:05:43.580
Like it'll use stashing for certain operations when it's sure that you don't want any of your changes changed and other things.
00:05:43.680 --> 00:05:47.820
Like each one of these commands usually results in five or six or seven Git commands.
00:05:48.680 --> 00:05:52.300
It's worth checking out, especially if you like Git via the CLI.
00:05:52.680 --> 00:05:53.160
Or you work in
00:05:53.160 --> 00:05:55.820
a team that wants really structured ways of doing these things.
00:05:56.060 --> 00:05:57.040
I'm definitely going to check it out.
00:05:57.120 --> 00:06:02.460
And actually, I used the, I can't remember what we called it last week, the SAG or something like that.
00:06:03.440 --> 00:06:11.760
But I used it this weekend to look at a Git log from a project that I hadn't been familiar with to see what was going
00:06:11.760 --> 00:06:12.040
on.
00:06:12.540 --> 00:06:12.740
Awesome.
00:06:13.220 --> 00:06:14.220
Have you tried it on your Windows?
00:06:14.500 --> 00:06:15.980
Like, I want a Windows terminal follow-up.
00:06:16.800 --> 00:06:17.900
What was I using it on?
00:06:18.640 --> 00:06:20.360
Remember, you were wondering if it would work on Windows.
00:06:20.740 --> 00:06:21.020
Yeah.
00:06:21.220 --> 00:06:22.000
Did you do this on your Mac?
00:06:22.510 --> 00:06:23.820
I was using it on my Mac laptop.
00:06:24.080 --> 00:06:24.240
Okay.
00:06:24.580 --> 00:06:24.620
Well,
00:06:25.510 --> 00:06:26.940
the follow-up is still pending then.
00:06:27.720 --> 00:06:27.900
Okay.
00:06:28.430 --> 00:06:30.100
And we'll check out GitTown
00:06:30.100 --> 00:06:31.480
on Windows as well.
00:06:31.640 --> 00:06:32.980
We'll take a little trip to GitTown.
00:06:32.980 --> 00:06:33.340
I'm sure it's
00:06:33.340 --> 00:06:34.100
probably fine.
00:06:34.940 --> 00:06:36.960
Yeah, this just automates Git, which works everywhere.
00:06:37.520 --> 00:06:37.720
Okay.
00:06:38.590 --> 00:06:41.260
Last week we did – going back to last week, I guess.
00:06:41.900 --> 00:06:48.120
We did talk about a couple peps, and today I'd like to talk about another PEP.
00:06:48.660 --> 00:06:51.020
This one comes to us from Brett Cannon.
00:06:52.320 --> 00:06:54.220
Well, I saw him posted on Bluesky.
00:06:54.360 --> 00:07:02.800
Pep 751 has been accepted.
00:07:03.100 --> 00:07:04.080
So what is this Pep about?
00:07:04.300 --> 00:07:05.120
It's about lock files.
00:07:05.440 --> 00:07:13.680
So Brett says this means Python now has a lock file standard that can act as an export target for tools and create some sort of lock file.
00:07:14.680 --> 00:07:21.080
And for some tools, the format can act as a primary lock file format as well as instead of some proprietary format.
00:07:21.180 --> 00:07:22.860
So we already had lock files.
00:07:23.040 --> 00:07:27.280
A couple, lots of different tools had lock files, but they weren't the same lock file.
00:07:27.280 --> 00:07:32.440
They were like uv had a lock and I think Poetry had a lock and there's a couple others.
00:07:33.599 --> 00:07:37.920
So now we have a standardized one and it's actually, I was looking through the standard.
00:07:37.920 --> 00:07:38.620
It looks pretty great.
00:07:39.120 --> 00:07:45.460
One of the things that you would expect, you could do environments and versions and packages and stuff.
00:07:46.060 --> 00:07:54.760
One of the things I thought was kind of cool, scrolling down to the bottom, was that there's a tool section that is pretty much open-ended.
00:07:54.980 --> 00:07:57.700
And this allows arbitrary tool configuration.
00:07:58.120 --> 00:08:15.140
So if other tools like Poetry or whatever want to try to use this instead or migrate to it, but it doesn't kind of cover some of their own configuration, they can override this and put some extra things in here, which I think is pretty cool.
00:08:15.700 --> 00:08:17.260
There's also packages tool.
00:08:17.400 --> 00:08:25.000
I'm not sure which, I don't know, when you would use one or the other, but I'll leave it up to some tutorial writer to figure that one out.
00:08:25.920 --> 00:08:32.180
So this isn't to a, if you wanted to try this out now, let's look at an example first.
00:08:32.800 --> 00:08:40.520
The examples is in the video if you want to check out the live version if you're listening, but we're going to link to it as well.
00:08:40.659 --> 00:08:41.140
It's in the PEP.
00:08:41.640 --> 00:08:42.219
There's an example.
00:08:42.700 --> 00:08:47.360
Mostly this is fairly readable and I'm pretty on board with how this is set up.
00:08:47.940 --> 00:08:49.020
It looks pretty good.
00:08:49.020 --> 00:08:50.300
It's Toml syntax.
00:08:51.340 --> 00:08:56.360
You've even got things like, of course, hashes and stuff.
00:08:56.740 --> 00:09:00.420
If you want to leave the hashes in for making sure it's the right thing.
00:09:01.320 --> 00:09:02.140
So this is all great.
00:09:02.680 --> 00:09:07.320
The other bit scrolling down is, well, how can I use this right now?
00:09:08.140 --> 00:09:11.720
There is, there's some stuff, information about how to teach it, of course.
00:09:12.420 --> 00:09:14.980
some discussion around rejected ideas.
00:09:15.640 --> 00:09:17.520
Oh, I forgot to mention the name.
00:09:17.760 --> 00:09:23.100
The name of it is pylock.toml, or pylocksomething.toml.
00:09:24.800 --> 00:09:26.680
That's just what they came up with.
00:09:26.820 --> 00:09:31.560
It doesn't conflict with any other tools right now, and it's reasonable, so that's good.
00:09:32.900 --> 00:09:39.040
If you want to try this right now, I thought we had an implementation.
00:09:40.440 --> 00:09:52.680
There was, okay, I can't find it right now, but there was an implementation already that is just an example that it's in Brett's tool, Mousebender.
00:09:53.140 --> 00:09:57.180
So Mousebender allows you to play with it if you want to play with it right now.
00:09:57.910 --> 00:10:03.240
So I imagine that some of the other tools will kind of take this up also.
00:10:03.900 --> 00:10:08.760
And I would expect that, like, for instance, uv or something might, I don't know.
00:10:09.020 --> 00:10:14.400
I'm not involved with uv, but I would expect some of these tools to pick them up pretty quick.
00:10:14.860 --> 00:10:15.420
But we'll see.
00:10:15.560 --> 00:10:19.040
Yeah, well, first of all, congratulations, Brett Cannon.
00:10:19.240 --> 00:10:21.800
I know you've been working on this for a long time.
00:10:23.060 --> 00:10:23.580
Here we are.
00:10:23.960 --> 00:10:24.400
Super exciting.
00:10:24.920 --> 00:10:27.980
So I'm sure some conversations at PyCon will be had about this.
00:10:28.320 --> 00:10:28.420
Yeah.
00:10:28.780 --> 00:10:29.140
Super neat.
00:10:29.260 --> 00:10:32.220
So one thing that I like is the format.
00:10:32.370 --> 00:10:40.660
I saw like the hash is on the same line as the actual requirement pinned version there.
00:10:41.090 --> 00:10:44.740
So I'm trying to do hashes in my requirements.txt files.
00:10:45.300 --> 00:10:59.820
And the hashes so overwhelm the version of the thing that you actually have in the diff that it's just like, well, it's a bunch of hash variations when I look at the diff and I got to hunt for the actual new version.
00:11:00.020 --> 00:11:04.960
Like, well, what one of these changed because the version changed and what is the new version and so on.
00:11:05.660 --> 00:11:16.660
So the way this looks, it looks like it's going to be, well, it might differ also on the end for the hashes, but the first thing that appears on the line is the actual version number wheel and so on.
00:11:16.660 --> 00:11:18.720
So I think that's going to be really nice to look at.
00:11:19.040 --> 00:11:19.200
So
00:11:19.200 --> 00:11:20.900
I might put the hashes back in.
00:11:21.400 --> 00:11:23.960
Yeah, I think it's kind of cool that there's an upload time.
00:11:24.200 --> 00:11:30.640
So if you don't want to deal with hashes, but you do want to grab the upload time as a way to check for things.
00:11:30.980 --> 00:11:31.320
That's cool.
00:11:31.540 --> 00:11:33.360
Yeah, you just kind of know how old is that as well.
00:11:33.660 --> 00:11:33.800
Yeah.
00:11:34.100 --> 00:11:34.240
Right.
00:11:34.440 --> 00:11:39.740
I mean, for things that are not using Calver or they're abusing Calver, you know,
00:11:39.880 --> 00:11:41.000
is it five minutes old
00:11:41.000 --> 00:11:41.740
or is it five months old?
00:11:41.880 --> 00:11:42.900
That might matter to you.
00:11:43.080 --> 00:11:43.280
Yeah.
00:11:43.500 --> 00:11:43.620
Yeah.
00:11:44.060 --> 00:11:44.380
Very cool.
00:11:44.520 --> 00:11:45.360
So awesome.
00:11:45.620 --> 00:11:46.100
I'm here for it.
00:11:46.720 --> 00:11:47.520
And do you know what else is awesome?
00:11:47.860 --> 00:11:48.580
What is that, Brian?
00:11:48.880 --> 00:11:50.120
I think Posit's pretty awesome.
00:11:50.420 --> 00:11:51.220
Oh, they are awesome.
00:11:51.680 --> 00:11:52.100
Very much.
00:11:52.500 --> 00:11:55.360
So I'd like to take a moment to thank our sponsor.
00:11:55.680 --> 00:11:58.940
This episode of Python Bytes is brought to you by the folks at Posit.
00:11:59.360 --> 00:12:02.400
Posit has made a huge investment in the Python community lately.
00:12:02.900 --> 00:12:08.180
Known originally for RStudio, they've been building out a suite of tools and services for Team Python.
00:12:08.540 --> 00:12:15.600
Over the past few years, we've learned some pretty scary terms like type squatting, supply chain attack, obfuscated code, and more.
00:12:15.900 --> 00:12:19.900
These all orbit around the idea that you install Python packages.
00:12:20.060 --> 00:12:28.300
When you install Python packages, you're effectively running arbitrary code off the internet, on your dev machine, and usually even your production servers.
00:12:28.780 --> 00:12:30.720
That thought alone makes me shudder.
00:12:31.140 --> 00:12:37.780
This doesn't even touch on the reproducibility issues surrounding external packages, but there are tools to help.
00:12:38.200 --> 00:12:42.460
Posit Package Manager can solve both problems for you.
00:12:42.620 --> 00:12:47.040
Think of Posit Package Manager as your personal package concierge.
00:12:47.440 --> 00:12:54.420
You use it to build your own package repository within your firewall that keep your project safe.
00:12:54.750 --> 00:12:59.820
You can upload your own internal packages to share or import packages
directly from PyPI.
00:13:00.300 --> 00:13:05.800
Your team members can install from these repos in the normal ways using tools like pip, Poetry, and uv.
00:13:06.180 --> 00:13:12.620
Posit Package Manager will help you manage updates, ensuring you're using the latest, most secure version of your packages.
00:13:13.060 --> 00:13:24.960
But Posit Package Manager also takes point-in-time snapshots of your repos, which you can use to rerun your code reproducibility in the future.
00:13:25.380 --> 00:13:32.660
Posit Package Manager reports on packages with known CVEs and other vulnerabilities so you can keep ahead of threats.
00:13:32.980 --> 00:13:39.340
And if you need the highest level of security, you can even run Posit Package Manager in an error-gapped environment.
00:13:39.620 --> 00:13:47.020
If you work on a data science team where security matters, you owe it to you and your org to check out Posit Package Manager.
00:13:47.440 --> 00:13:54.100
Visit pythonbytes.fm/ppm today and get a three-month free trial and see if it's a good fit.
00:13:54.440 --> 00:13:57.140
That's pythonbytes.fm/ppm.
00:13:57.500 --> 00:13:59.960
The link is in your podcast player's show notes.
00:14:00.360 --> 00:14:02.800
Thank you, Posit, for supporting Python Bytes.
00:14:03.140 --> 00:14:03.900
Indeed. Thanks, Posit.
00:14:04.090 --> 00:14:04.920
It's a cool project.
00:14:05.690 --> 00:14:07.280
Having a little bit more control over your
00:14:07.280 --> 00:14:08.140
packages is
00:14:08.140 --> 00:14:09.120
always a good thing.
00:14:09.180 --> 00:14:17.400
Well, Brian, I want to carry on with the theme of Git and talk about three more Git project, Git topics, I believe at least.
00:14:17.880 --> 00:14:17.960
Who?
00:14:18.380 --> 00:14:25.560
So we know where, like this, this is sort of the thing they teach you in like early writing classes, all the W's, right?
00:14:25.760 --> 00:14:28.320
Who, what, where, when, why, how are we covering these things?
00:14:28.700 --> 00:14:32.920
We've gone from where to who, and now we're talking about Git dash who.
00:14:33.340 --> 00:14:40.660
So I've always enjoyed the get blame or basically more broadly like source control blame.
00:14:40.830 --> 00:14:42.400
Like, all right, who did this?
00:14:43.340 --> 00:14:44.160
Do you see that line of code?
00:14:44.460 --> 00:14:46.160
Who do I talk to about this?
00:14:46.240 --> 00:14:52.640
Either they are not very good or we need to talk to them or there's something way more complicated going on here and I need to understand it better.
00:14:52.820 --> 00:14:55.220
But who do I talk to about this line of code?
00:14:55.290 --> 00:14:55.680
You know what I mean?
00:14:56.040 --> 00:15:03.520
And the way that works is you can run that on a file and it shows you line by line who made the last change to that particular line, right?
00:15:04.020 --> 00:15:04.920
Editors support that.
00:15:05.860 --> 00:15:06.860
Super easy these days.
00:15:07.140 --> 00:15:12.800
Like in PyCharm, it'll actually put an overlay of who wrote the function or whatever.
00:15:12.940 --> 00:15:15.100
If you click on that, it'll sort of slide out the get blame.
00:15:15.520 --> 00:15:17.620
But that's a line by line type of thing.
00:15:18.100 --> 00:15:22.680
What if instead I wanted to know as an entire project?
00:15:22.940 --> 00:15:39.020
Like if I go to the repo and I type get who dash L, it will say who has made how many commits, how many changes, how many lines, when did they last do that as a summary of the project instead of a summary of the line.
00:15:39.780 --> 00:15:40.060
Cool, right?
00:15:40.480 --> 00:15:41.900
So that's super easy to do.
00:15:43.230 --> 00:15:51.580
And you can go into subdirectories and sort of explore those and go who's created changes on this particular subdirectorie or whatever.
00:15:51.900 --> 00:15:53.120
So I think this is really neat.
00:15:53.400 --> 00:15:55.620
It's sort of a natural extension of get blame.
00:15:55.840 --> 00:16:00.480
Okay, so you can give it a particular file even and just say who modified this file?
00:16:01.060 --> 00:16:04.300
Yeah, I would think it would say how many contributions there are to that particular file.
00:16:04.380 --> 00:16:07.820
I don't know if you can give it a file, but there was a single file in a directory.
00:16:08.680 --> 00:16:09.300
That's pretty cool.
00:16:09.300 --> 00:16:09.980
Probably you can give it a file as well.
00:16:10.340 --> 00:16:11.200
Yeah, it
00:16:11.200 --> 00:16:17.940
just sort of shows you who has been active in this repo or this subdirectory of a repo lately and how much have they
00:16:17.940 --> 00:16:17.980
contributed.
00:16:18.000 --> 00:16:25.900
Yeah, the blame part is one of the reasons why I'm careful if I try to do like a, just a prettying up of code.
00:16:26.920 --> 00:16:27.980
Do you want to break
00:16:27.980 --> 00:16:28.200
it?
00:16:28.520 --> 00:16:30.100
Well, no, I don't want to be blamed for
00:16:30.100 --> 00:16:30.240
it.
00:16:30.480 --> 00:16:38.020
So if you're just like lining up something to make it look nicer, be careful because you're now the owner of that line of code.
00:16:38.700 --> 00:16:40.140
Yeah, that's an interesting angle.
00:16:40.140 --> 00:16:43.160
I wonder if you should almost create like a formatter account
00:16:43.580 --> 00:16:43.920
and
00:16:43.920 --> 00:16:46.380
just let the formatter do the formatting.
00:16:46.620 --> 00:16:46.720
Well,
00:16:46.860 --> 00:16:53.320
actually, that's one of the lovely things about putting, putting like, separating, separating formatting stuff.
00:16:53.430 --> 00:16:59.980
So I was like, that's one of the things I try to teach people is to, if cleaning up is great, but do it in a separate commit.
00:17:00.400 --> 00:17:03.240
Don't do it in the same commit as a bunch of actual code
00:17:03.240 --> 00:17:03.460
changes.
00:17:04.339 --> 00:17:04.420
Sure, sure.
00:17:04.780 --> 00:17:06.180
But it doesn't fix the blame part.
00:17:06.540 --> 00:17:07.780
No, it doesn't really fix the blame part.
00:17:08.250 --> 00:17:14.699
But another thing that the, that GitTown thing does is it'll, it uses squashing pretty aggressively.
00:17:15.030 --> 00:17:19.720
So when you do all your feature branches and you make 20 changes, you can squash that into a single commit
00:17:19.720 --> 00:17:20.360
as
00:17:20.360 --> 00:17:22.699
part of the publication PR flow.
00:17:23.050 --> 00:17:30.560
And so then at least when people go look at the blame, it's like all part of one commit that has to do with this feature rather than Ruff formatting,
00:17:31.060 --> 00:17:32.260
adjusted space,
00:17:32.460 --> 00:17:33.480
you know, like random.
00:17:34.000 --> 00:17:38.140
Like if you get it too small, your comments are like really, really not historically relevant.
00:17:38.410 --> 00:17:40.540
You know, like this is the formatting statement, like great.
00:17:40.860 --> 00:17:42.340
And why did, when were we doing this?
00:17:42.480 --> 00:17:42.860
You know what I mean?
00:17:43.180 --> 00:17:43.420
Yeah.
00:17:43.930 --> 00:17:45.980
Actually, I kind of forget that not everybody does that.
00:17:46.120 --> 00:17:48.460
So I always do a squash workflow.
00:17:48.680 --> 00:17:49.480
I see you're a natural
00:17:49.480 --> 00:17:49.980
squasher.
00:17:50.090 --> 00:17:50.220
Okay.
00:17:50.400 --> 00:17:51.740
I'm a natural squasher, yeah.
00:17:52.280 --> 00:17:52.780
That's of course.
00:17:53.020 --> 00:17:53.080
Well,
00:17:53.080 --> 00:17:55.520
mostly because it's way easier to roll back stuff.
00:17:55.780 --> 00:18:00.060
So if there's something that really causes a downstream problem, you kind of want
00:18:00.060 --> 00:18:01.700
to roll back all of that work together.
00:18:02.040 --> 00:18:02.940
Yeah, that's
00:18:02.940 --> 00:18:03.340
a good point.
00:18:04.340 --> 00:18:06.940
So next up is whatcha, whatcha.
00:18:07.600 --> 00:18:07.800
Okay.
00:18:08.260 --> 00:18:11.480
Watch, G-H-A, but there's no capitalization.
00:18:11.780 --> 00:18:12.940
So whatcha, Tom.
00:18:13.160 --> 00:18:17.880
And this comes to us from Ned Batchelder, as in not he sent it to us, but he created it.
00:18:18.200 --> 00:18:20.080
And this is just another Git thing real quick.
00:18:20.200 --> 00:18:21.380
I think people find it relevant.
00:18:21.620 --> 00:18:32.840
So what you can do is you can install this, and then it will allow you to watch in real time the status of your GitHub actions.
00:18:33.280 --> 00:18:35.520
So imagine there's a bunch of changes that have come in.
00:18:35.880 --> 00:18:38.880
You're running talks for different versions of Python on your thing.
00:18:39.100 --> 00:18:45.700
There's some pending other requests that are queued up, and you're waiting for them to run, and you just want to know, like, well, when are these done?
00:18:45.750 --> 00:18:46.420
How long are they taking?
00:18:46.960 --> 00:18:49.720
So you can just point this at a GitHub repo that
has a GitHub action.
00:18:50.280 --> 00:18:50.980
This is awesome.
00:18:51.420 --> 00:18:52.180
It's pretty cool, right?
00:18:52.480 --> 00:18:52.660
Yeah.
00:18:53.180 --> 00:18:55.880
Yes, I often have, like, a git tab open
00:18:55.880 --> 00:18:56.980
to watch this stuff,
00:18:57.200 --> 00:19:00.060
but having it right in the command line, nice.
00:19:00.420 --> 00:19:04.080
Yeah, and it's like a live updating, very TUI feel, right?
00:19:04.180 --> 00:19:04.540
It's a very
00:19:04.540 --> 00:19:05.300
advanced
00:19:05.300 --> 00:19:06.140
sort of UI.
00:19:06.420 --> 00:19:13.580
It's not just a stream of text, but it's the UI is updating and changing with progress bars for each action and so on.
00:19:13.780 --> 00:19:13.960
Yeah.
00:19:14.260 --> 00:19:14.360
Cool.
00:19:14.620 --> 00:19:15.200
So, yeah.
00:19:15.580 --> 00:19:16.700
Well done on that, Ned.
00:19:16.980 --> 00:19:18.240
That's super cool.
00:19:18.620 --> 00:19:18.780
All right.
00:19:19.440 --> 00:19:20.400
That's it for my main items.
00:19:20.480 --> 00:19:20.900
Over to you, Brian.
00:19:21.240 --> 00:19:21.460
Okay.
00:19:21.820 --> 00:19:23.260
So are we on?
00:19:23.260 --> 00:19:24.560
No, for your last one, you got one more, don't you?
00:19:24.740 --> 00:19:25.500
Oh, I got one more.
00:19:25.600 --> 00:19:26.120
Yeah, I do.
00:19:26.120 --> 00:19:26.380
I think you do.
00:19:27.360 --> 00:19:27.440
Yeah.
00:19:27.820 --> 00:19:31.240
So next up is I'd
00:19:31.240 --> 00:19:32.840
like to talk about uv a little bit.
00:19:35.260 --> 00:19:35.440
Yes.
00:19:36.200 --> 00:19:39.880
So this is Dave J.
00:19:40.820 --> 00:19:42.620
So Dave Johnson article.
00:19:44.080 --> 00:19:50.500
It's called Share Python Scripts Like a Pro, uv and PEP 723 for Easy Deployment.
00:19:50.820 --> 00:19:55.180
And we've talked about a lot of these pieces in different episodes.
00:19:55.560 --> 00:19:59.420
But I really like this write-up.
00:19:59.500 --> 00:20:11.780
It's a sort of kind of, if you want to write Python scripts with dependencies, that was an issue before and now it's not, but all the different parts of how to do this.
00:20:12.040 --> 00:20:18.420
So it starts out with talking about what uv is and PEP 723.
00:20:18.960 --> 00:20:25.400
And that's the PEP that allowed you to put like some stuff at the top of a file to include your dependencies and stuff.
00:20:26.240 --> 00:20:41.040
So to set the stage, we don't have to dig into what this is, but he gives a command line script called Word Lookup that has some things like argparse that's built in, but it also uses HTTPX.
00:20:41.180 --> 00:20:45.380
So that's an extra dependency that's outside of the script.
00:20:46.360 --> 00:20:51.340
And this is if you're doing a web scraping script, you're going to often have like some extra dependency or something.
00:20:53.020 --> 00:20:54.580
So then that's the script.
00:20:55.600 --> 00:20:58.820
It teaches you how to install uv, but you probably already have it installed.
00:20:59.460 --> 00:21:02.040
And then how do I add that thing?
00:21:02.080 --> 00:21:13.560
You don't have to memorize the format of how to put that up at the top because if you say uv add script and then you give it your script name and then what your dependency is, it automatically fills that out for you.
00:21:13.690 --> 00:21:18.860
So it sticks that script block at the top of your code, which is awesome.
00:21:20.800 --> 00:21:22.860
And I think I knew that but forgot about it.
00:21:22.920 --> 00:21:25.860
So I'm glad it's in there to just add that little script tag.
00:21:26.470 --> 00:21:36.420
And then talks about how this is different and similar to the PyProject.toml and the relation to that, which I kind of like that extra teaching.
00:21:36.730 --> 00:21:43.400
It isn't necessary that you know that for scripts, but it's good for people to have that knowledge about the whole ecosystem.
00:21:44.340 --> 00:21:47.340
Talks about running it with UVRun.
00:21:48.020 --> 00:21:56.220
And then jumps down and saying things like you can do uv run, but you can also just add that uv run as a shebang for Linux and Mac users.
00:21:56.370 --> 00:21:58.460
You can add that to the top and it gives the
00:21:58.460 --> 00:22:04.940
specific environment SUV run script that you have to stick to the top of that.
00:22:04.980 --> 00:22:05.220
That is
00:22:05.220 --> 00:22:05.960
super
00:22:05.960 --> 00:22:06.740
interesting, actually.
00:22:07.320 --> 00:22:09.540
And then you don't have to say Python or uv run.
00:22:09.570 --> 00:22:14.200
You can just save the script name if it's an executable and it'll just work, which is awesome.
00:22:14.500 --> 00:22:25.100
And I didn't get into trying this with Windows, but apparently you can kind of do some of this around how to get this invocable on Windows as well.
00:22:26.160 --> 00:22:28.760
I haven't tried this, but you can use Pi and other things.
00:22:29.210 --> 00:22:29.640
So there's
00:22:29.640 --> 00:22:29.760
some help.
00:22:29.760 --> 00:22:32.220
I think the Pi launcher respects
00:22:32.220 --> 00:22:34.740
shebangs on Windows, which is something it adds.
00:22:35.060 --> 00:22:35.740
Okay, cool.
00:22:36.090 --> 00:22:45.800
And then he recommends creating like an extra script with a CMD script to launch your script with.
00:22:45.990 --> 00:22:48.800
So how to do this, how to complete the loop with Windows.
00:22:49.440 --> 00:22:54.780
So really great write-up for people writing utility scripts in Python.
00:22:55.840 --> 00:22:56.860
That's actually really nice.
00:22:57.170 --> 00:22:57.880
Yeah, well done.
00:22:58.200 --> 00:22:58.400
Yeah,
00:22:58.710 --> 00:23:00.240
so that's
00:23:00.240 --> 00:23:01.640
all for our main topics.
00:23:03.200 --> 00:23:04.580
We both have extras.
00:23:05.550 --> 00:23:07.720
Do you want to jump into your extras first or do you want me to do
00:23:07.720 --> 00:23:07.840
ours?
00:23:08.320 --> 00:23:09.520
I'll do mine real quick,
sure.
00:23:09.560 --> 00:23:10.200
I
00:23:10.200 --> 00:23:22.680
got a few. I'm going to try to go quick through them. One, I talked about PySQL Scribe, which if you're writing raw SQL for your code, but you don't, you want to have some kind of tooling support to help you in Python.
00:23:22.840 --> 00:23:28.540
This PySQL scribe lets you express through code the structure of your tables and their relationships.
00:23:28.920 --> 00:23:31.120
And then you can ask it like, hey, what would the query of this be?
00:23:31.200 --> 00:23:41.700
And then it'll generate it based on like what database scheme or dialect like SQLite versus Microsoft SQL Server query syntax you wanted to generate and so on.
00:23:42.000 --> 00:23:51.420
And I proposed when we talked about it that, hey, would it be cool if there was an ability to just point it at a bunch of create scripts that defines your hundred tables and it just knows that?
00:23:51.660 --> 00:24:01.500
Well, Daniel, who runs a project, said that is a good idea and just released a version that you can just point it out a directory of create scripts and it'll use them to understand your entire data structure.
00:24:01.800 --> 00:24:02.180
Good job, Daniel.
00:24:02.510 --> 00:24:03.800
So a little bonus there.
00:24:04.240 --> 00:24:06.560
We talked about, this is a long running one.
00:24:06.890 --> 00:24:12.540
We talked about formatting Markdown with MD format, which I've started to adopt.
00:24:12.570 --> 00:24:13.480
I will talk about that next.
00:24:14.060 --> 00:24:19.220
But Hugo points out, like, hey, I use Prettier, which has been around for a long time.
00:24:19.270 --> 00:24:21.180
It now has a Markdown format.
00:24:21.260 --> 00:24:23.140
So that's really cool from 2017.
00:24:23.780 --> 00:24:24.700
People can check that out.
00:24:25.060 --> 00:24:25.460
And I'll link
00:24:25.460 --> 00:24:27.220
to that in the show notes if you want to use that.
00:24:27.820 --> 00:24:30.660
I, however, am continuing on with MD format.
00:24:31.220 --> 00:24:37.400
And I ran it against the entire markdown structure of my upcoming Talk Python and production book.
00:24:38.080 --> 00:24:39.940
And it's, like I said, all markdown.
00:24:40.360 --> 00:24:44.020
One of the things I discovered, I don't know if you knew it, Brian, but I definitely did not.
00:24:44.320 --> 00:24:46.540
It's a really interesting linting philosophy.
00:24:46.920 --> 00:24:48.140
Would you run it against markdown?
00:24:48.180 --> 00:25:00.740
it will render the markdown to html then pretty it then you know clean it up and then it'll run it through the markdown parser again and if the html differs it will roll back that
00:25:00.740 --> 00:25:02.520
change oh that's cool yeah
00:25:02.520 --> 00:25:17.340
so one of my chapters apparent i put a whole bunch of plugins and goes one of the plugins is like not great because it changed the format and i'm like oh which one is it but i like them all i don't know maybe i need to debug it
right now i'm just not formatting one chapter and you know what chapters 13 obviously
00:25:17.340 --> 00:25:18.620
obviously it's
00:25:18.620 --> 00:25:46.220
13 anyway um what i found the command that i think is really really good is to use i wrote it down it's in the show notes where i must find it it is to get say md format --number so it renumbers those things which is great and then this one i thought i would like it to wrap it but all of my editors actually preserve the wrapping format so that it can kind of help you see the structure a little better, even though Markdown Render doesn't.
00:25:46.480 --> 00:25:47.760
And so that looked really crappy.
00:25:47.940 --> 00:25:53.700
So if you say --wrap, no, it'll actually explicitly unwrap if you've accidentally got some in there.
00:25:54.040 --> 00:26:00.500
So I like number and wrap, no, not just not change it, but actually unravel the wrapping, which I thought was really cool.
00:26:00.780 --> 00:26:05.240
And as part of that, we did talk about uv, sorry, we talked about PIPX Inject.
00:26:05.740 --> 00:26:06.140
And
00:26:06.140 --> 00:26:12.100
last time you pointed out correctly that uv tool install --width is the equivalent.
00:26:12.170 --> 00:26:21.100
But I wanted to point out that when you, and I put it in the show notes, if you want to use width and uv tool install like inject, you have to say width as many times as there are extras.
00:26:21.540 --> 00:26:30.480
So uv tool install, MD format width, MD format, GFM, --width, MD format front matter, --width, and so on.
00:26:30.580 --> 00:26:37.740
So if you want to get that inject feel, you've got to like width separately every single parameter, every single extra or whatever.
00:26:37.800 --> 00:26:38.600
so
00:26:38.600 --> 00:27:12.400
anyway that's a thing another one you can see right now that I if you're watching the live stream or see the pictures that I'm using the Zen browser which I really come to love it's built on top of Firefox which is great and I really want this like nice clean format we just have the tabs as icons on the side and everything's just at the top and gives you more space right Well, Firefox, if you are a Firefox purist, has now come up with this tabs on the left side of things, which is a brand new feature that they just released last week, I think it was.
00:27:13.240 --> 00:27:20.360
But if you grab that little width of the tab and you slide it over to their icon size, it looks exactly like what I have on the screen right now, right?
00:27:20.620 --> 00:27:24.540
Where it has just icons on the left for the tabs and a dress bar across the top.
00:27:24.840 --> 00:27:26.160
The new Firefox is pretty good.
00:27:26.340 --> 00:27:27.840
There's still stuff missing that Zen brings.
00:27:27.980 --> 00:27:28.400
That's really cool.
00:27:28.500 --> 00:27:31.240
But anyway, I wanted to point people that that's an option now.
00:27:31.460 --> 00:27:31.780
Nice.
00:27:32.090 --> 00:27:32.220
Yeah.
00:27:32.740 --> 00:27:37.980
Finally, last thing on my end is a follow-up on uv from James Falcon.
00:27:38.940 --> 00:27:39.680
Sorry, James Falcon.
00:27:40.040 --> 00:27:40.720
Thanks for sending us in.
00:27:40.720 --> 00:27:42.438
He says, hey, I'm also a uv enthusiast.
00:27:43.460 --> 00:27:46.840
And I was holding out to using uv because there's one case it hasn't solved.
00:27:47.320 --> 00:27:50.200
However, you guys convinced me to work through it and get it figured out.
00:27:50.210 --> 00:27:56.940
So he maintains a library supported across multiple Python versions and needs to deal with bugs and specific ones.
00:27:57.080 --> 00:28:00.500
So like it doesn't work this way in 3.8, but it works fine in 3.10.
00:28:01.000 --> 00:28:09.760
So the idea was to have, originally I was using PyE and V because you can create virtual environments with those different ones and then activate them by name.
00:28:10.240 --> 00:28:12.440
But the way uv worked originally, it didn't.
00:28:12.860 --> 00:28:19.640
So what he said, hey, look, I'm creating just a location for virtual environments on my profile, maybe a sub folder for the project.
00:28:20.120 --> 00:28:29.020
And then I use now use uv to create version specific virtual environments, you know, 3.11, 3.12, 3.13 and so on for that project.
00:28:29.460 --> 00:28:39.340
And then he includes a batch file that you can just say work on this virtual environment project name and it'll automatically find it and activate for you and so on.
00:28:39.600 --> 00:28:46.060
So kind of gives us an example of like how you might sort of pyvee and be your way around different versions using uv.
00:28:46.480 --> 00:28:47.000
That's pretty cool.
00:28:47.220 --> 00:28:47.360
Yeah,
00:28:47.580 --> 00:28:51.200
so there's a little bash script that people can check out if they want to use it.
00:28:51.320 --> 00:28:51.560
Nice.
00:28:51.870 --> 00:28:52.000
Okay.
00:28:52.400 --> 00:28:52.960
In the show notes.
00:28:53.240 --> 00:28:53.360
Yep.
00:28:53.640 --> 00:28:54.220
That's it for my extras.
00:28:54.620 --> 00:28:59.460
Well, so for my extras today, so it's April, right?
00:28:59.690 --> 00:29:07.920
And one of the things we do on April 1st, sometimes there's April Fool's pranks that happen.
00:29:08.220 --> 00:29:14.180
And one of the things, so there's good April Fool's pranks and then there's bad April Fool's pranks.
00:29:14.520 --> 00:29:15.680
So I'm going to cover both.
00:29:16.260 --> 00:29:24.780
So first off, I think a good one, which was a video put out by, well, it was forwarded by the PSF, but it says CultRepo.
00:29:25.060 --> 00:29:25.520
I'm not sure.
00:29:26.220 --> 00:29:30.780
I looked and I'm like, that is a really weird thing to kind of do an official joke from the PSF.
00:29:30.980 --> 00:29:41.960
That CultRepo group, they make a bunch of documentaries about, like highly produced documentaries about programming languages and their origins or
00:29:41.960 --> 00:29:42.380
programming
00:29:42.380 --> 00:29:42.820
frameworks.
00:29:43.100 --> 00:29:45.380
Like they have some on Vue.js and they have some on Angular.
00:29:46.580 --> 00:29:47.100
That's
00:29:47.100 --> 00:29:47.520
where it's from.
00:29:47.800 --> 00:29:47.980
Okay.
00:29:48.190 --> 00:29:48.320
So
00:29:48.320 --> 00:29:51.120
the video is breaking Guido Van Rossum returns
00:29:51.120 --> 00:29:52.720
as Python's BDFL.
00:29:53.120 --> 00:29:55.360
And it's a two-minute video or almost two minutes.
00:29:55.780 --> 00:29:56.280
Hilarious.
00:29:56.450 --> 00:29:57.060
I loved it.
00:29:58.140 --> 00:30:07.480
It shows him like typing of the saying that everybody, what is the standards people?
00:30:07.660 --> 00:30:08.980
Oh, the boards.
00:30:09.260 --> 00:30:09.740
Steering counsel.
00:30:10.000 --> 00:30:12.260
Steering counsel is no longer necessary.
00:30:13.640 --> 00:30:16.540
A couple of things I wanted to point out that I loved about this video.
00:30:17.680 --> 00:30:25.280
Brett Cannon, he's in it and he's listed as famous Python quotationist is his title.
00:30:25.590 --> 00:30:36.320
And then Guido goes ahead and says one of the things that he said, Guido says, as I always say, come for the language, stay for the community.
00:30:36.840 --> 00:30:38.780
And that's not a Guido quote.
00:30:38.900 --> 00:30:39.640
That's a Brett quote.
00:30:39.940 --> 00:30:47.840
So the famous Python quotation is gets crossed out after Guido says that, which is pretty funny.
00:30:49.700 --> 00:30:52.580
And then a little later, who was this?
00:30:52.590 --> 00:30:58.220
Barry Warsaw walks in and says, Guido, are we ready to release Python 2.8?
00:30:58.780 --> 00:31:00.420
Which is never going to happen, right?
00:31:00.620 --> 00:31:02.920
So that's pretty good.
00:31:04.240 --> 00:31:06.520
Guido says indentation is enlightenment.
00:31:07.220 --> 00:31:18.360
And Barry gives him credit for saying that being Pythonic means becoming one with white space, which is good.
00:31:19.240 --> 00:31:27.820
Anyway, and then it kind of wraps it up with Guido announcing that he's going to implement a new keyword, maybe.
00:31:28.280 --> 00:31:31.140
It's kind of like if, but way more Pythonic.
00:31:31.520 --> 00:31:32.540
So maybe something.
00:31:33.220 --> 00:31:38.320
And it gives an example of maybe print Python, the documentary, coming this summer.
00:31:38.960 --> 00:31:40.940
And I kind of hope that one is real.
00:31:41.030 --> 00:31:44.020
I hope we get a documentary coming.
00:31:44.460 --> 00:31:46.840
Well, it's already this summer, or it's almost this summer.
00:31:47.360 --> 00:31:48.060
If we get a
00:31:48.060 --> 00:31:48.360
documentary.
00:31:48.420 --> 00:31:49.940
Well, we're going to get it soon, then that'll be great.
00:31:50.220 --> 00:31:51.340
And if this
00:31:51.340 --> 00:31:54.120
cult repo company makes it, I think it'll be pretty good, yeah.
00:31:54.820 --> 00:31:57.400
When I first saw this, I was like, I saw a tweet come
out.
00:31:57.440 --> 00:31:57.920
I'm like, hey, whatever.
00:31:58.440 --> 00:31:59.640
Funny little joke.
00:31:59.840 --> 00:32:01.200
And I just thought it was a tweet.
00:32:01.600 --> 00:32:04.460
And Nick Wallace sent it over and like, wait, you should check this out.
00:32:04.560 --> 00:32:04.880
It's funny.
00:32:04.960 --> 00:32:05.660
And I'm like, watch.
00:32:05.740 --> 00:32:08.360
I'm like, oh, there's way more here than I realized.
00:32:08.660 --> 00:32:09.480
This is
00:32:09.480 --> 00:32:10.060
well done.
00:32:10.380 --> 00:32:10.920
This is good.
00:32:11.260 --> 00:32:11.840
Okay, so that's
00:32:11.840 --> 00:32:14.680
a good way to do an April Fool's prank.
00:32:15.100 --> 00:32:16.000
I've never done one.
00:32:16.100 --> 00:32:17.500
I've never done like a tech prank.
00:32:17.670 --> 00:32:20.620
So I decided to try my hand at that this year.
00:32:21.740 --> 00:32:22.760
It did not go that well.
00:32:23.630 --> 00:32:29.060
So I'm – and you know how – have you ever heard like if you have to explain a joke, then it's not funny?
00:32:29.440 --> 00:32:31.520
This is me explaining a joke, so it's not funny.
00:32:33.320 --> 00:32:34.920
So there's pytest Repeat.
00:32:35.150 --> 00:32:39.340
So I've been doing, on testing code, I've been doing this series on pytest plugins.
00:32:40.240 --> 00:32:42.780
And pytest Repeat is one that I use all the time.
00:32:43.220 --> 00:32:47.840
And I noticed that it hadn't been being tested on, it only was tested on 312.
00:32:48.040 --> 00:32:50.600
It's not tested on 313 yet or 314.
00:32:51.100 --> 00:32:54.540
And, okay, so 314 is 3.14.
00:32:55.080 --> 00:33:01.420
pi starts with 3.14, but pi is an irrational number, and it doesn't repeat.
00:33:01.960 --> 00:33:06.620
So the joke I was trying to make was I put out an episode on testing code.
00:33:06.820 --> 00:33:10.360
On April 1st, Python 3.4 won't repeat with pytestRepeat.
00:33:11.580 --> 00:33:24.140
And I guess it was – and I even, like, tried to make it, I thought, obvious to say, unfortunately, it doesn't seem to work on 3.14, even though there's no rational, like no irrational.
00:33:24.660 --> 00:33:25.160
Yeah, that was nice.
00:33:25.690 --> 00:33:26.460
I listened to that episode.
00:33:26.460 --> 00:33:27.060
It was well done.
00:33:27.720 --> 00:33:35.780
Anyway, I got some feedback of people confused and wondering why I was testing 3.14 anyway, since it was an alpha.
00:33:36.880 --> 00:33:41.080
And anyway, I had to explain like to five different people that it's actually fine.
00:33:41.320 --> 00:33:47.560
So the TLDR is pytest Repeat works fine with Python 3.14.
00:33:48.220 --> 00:33:49.620
So don't worry about it.
00:33:51.600 --> 00:33:53.940
Anyway, how not to do an April Fool's break.
00:33:54.520 --> 00:33:57.840
So I guess that's all of our extra items, right?
00:33:58.040 --> 00:33:58.740
It sure is.
00:33:59.500 --> 00:33:59.960
We'll see
00:33:59.960 --> 00:34:01.580
how much I got to explain this joke, huh?
00:34:02.600 --> 00:34:03.700
No, I think this one is fine.
00:34:04.020 --> 00:34:04.620
This one is good.
00:34:05.020 --> 00:34:08.600
So this comes to us from the Programming Humor Twitter feed.
00:34:08.820 --> 00:34:13.240
And it says, what's the best thing you found in code?
00:34:13.300 --> 00:34:17.060
And they are almost always about comments in this thread.
00:34:17.120 --> 00:34:19.879
So here's a, this is actually Python.
00:34:20.399 --> 00:34:24.360
So this is a comment that somebody found in the code and they posted it.
00:34:24.880 --> 00:34:33.780
But if you look through and you look at the comments below, there's a glorious set of 132 comments of similar.
00:34:34.260 --> 00:34:34.919
They're not all great.
00:34:35.100 --> 00:34:38.100
But so here's what it says at the top of this thread.
00:34:38.120 --> 00:34:43.159
It says, as a comment, you may think that this function is obsolete and it doesn't seem to do anything.
00:34:43.460 --> 00:34:44.200
And you would be correct.
00:34:44.580 --> 00:34:49.460
But when we remove this function, for some reason, the whole program crashes and we can't figure out why.
00:34:49.860 --> 00:34:50.720
So here it will stay.
00:34:53.460 --> 00:34:53.820
So
00:34:53.820 --> 00:34:55.440
I entitled the joke, so here it will stay.
00:34:56.020 --> 00:34:56.540
And let me see
00:34:56.540 --> 00:34:57.960
if I can find a few.
00:34:58.900 --> 00:35:00.020
This is my favorite one, though.
00:35:00.080 --> 00:35:04.180
This probably should have been the top line one, but this came to us as a response from the original.
00:35:04.900 --> 00:35:09.720
Somebody named Jeppe pointed out and said, not mine, but I find this kind of funny.
00:35:10.100 --> 00:35:13.960
And this is a C-based type of language because it's slash slash for the comment.
00:35:14.500 --> 00:35:17.800
Dear programmer, when I wrote this code, only God and I knew how it worked.
00:35:18.120 --> 00:35:19.180
Now only God knows it.
00:35:19.660 --> 00:35:23.580
Therefore, if you're trying to optimize this routine and it fails, most surely it will.
00:35:24.040 --> 00:35:27.060
Please increase the counter as a warning to the next person.
00:35:27.300 --> 00:35:31.400
And then there's a variable below that says, total hours wasted here, 254.
00:35:33.340 --> 00:35:34.100
So good.
00:35:36.920 --> 00:35:37.300
That's good.
00:35:37.340 --> 00:35:38.420
And on and on it goes.
00:35:38.580 --> 00:35:46.300
If you don't want the rest of your, if you want to lose maybe a half hour, you can go right down here and there's a bunch of good stuff in there.
00:35:46.500 --> 00:35:48.180
So there it is.
00:35:49.020 --> 00:35:49.420
That's good.
00:35:49.980 --> 00:35:51.140
Yeah, I think that's a good one.
00:35:51.460 --> 00:35:51.580
Yeah.
00:35:52.580 --> 00:36:00.540
I've only a couple times have, actually, at least I have at least one memory of some code that didn't look like it did anything, except
00:36:00.540 --> 00:36:01.100
for obviously
00:36:01.100 --> 00:36:04.320
it was getting run and the timing, I'm sure it was just timing.
00:36:04.600 --> 00:36:09.080
Like if you took it out, it changed the timing of the rest of the program and then it didn't work.
00:36:09.420 --> 00:36:10.660
So yeah, I've actually
00:36:10.660 --> 00:36:11.020
run into it.
00:36:11.020 --> 00:36:15.360
You would uncover some kind of concurrency bug that it was defensive against.
00:36:16.000 --> 00:36:16.780
Yeah, yeah.
00:36:17.500 --> 00:36:18.180
C codes
00:36:18.180 --> 00:36:18.700
are like that.
00:36:20.240 --> 00:36:21.460
It's hard to see there.
00:36:21.560 --> 00:36:23.520
that's true. Hard to see the errors.
00:36:24.359 --> 00:36:25.080
That's... That
00:36:25.080 --> 00:36:25.520
was good, wasn't
00:36:25.520 --> 00:36:25.660
it?
00:36:25.760 --> 00:36:27.340
No. No, it wasn't. We better quit.
00:36:27.490 --> 00:36:28.420
We better just call it an episode.
00:36:28.840 --> 00:36:29.400
Okay. Alright.
00:36:29.860 --> 00:36:29.920
Thanks
00:36:29.920 --> 00:36:31.080
a lot. Bye. Bye.