Transcript #427: Rise of the Python Lord
Return to episode page view on github00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:05 This is episode 427, recorded April 7th, 2025.
00:09 And I am Brian Okken.
00:10 And I'm Michael Kennedy.
00:12 And this episode is brought to you by Posit Package Manager.
00:16 Check their spot out later in the show.
00:19 Also connect with us if you'd like to on Mastodon or Blue Sky.
00:23 Links are in the show notes.
00:26 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:36 You can go to pythonbytes.fm/live.
00:39 We usually do it Mondays at 10, but sometimes it changes.
00:43 Anyway, it's fun to have you here.
00:45 And some people hop in and ask questions and it's good.
00:48 Anyway, also after the show, when we have everything all the dust settles, We send out links through our newsletter.
00:56 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.
01:07 It's pretty good.
01:08 Absolutely.
01:09 Michael, what do you got for us to start with?
01:11 Let's go on a trip, Brian.
01:13 Let's go on a trip.
01:14 Okay.
01:15 I want to go to take a little trip to GitTown.
01:18 GitTown 18.3.
01:20 Let's do it.
01:21 So Git Town is an interesting project.
01:24 I believe it's written in Python.
01:26 I'll double check that in a second, although it's not totally germane.
01:29 It's a tool that you can use.
01:31 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?
01:47 I don't think I'm like, 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.
01:53 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
02:01 in Rust.
02:03 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.
02:17 So by that, I mean, I want to create a feature branch off of this branch.
02:22 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?
04:05 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.
04:15 So this, you would just type git space sync.
04:17 That's cool.
04:18 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.
04:28 It'll create a pull or merge request for a feature branch back on GitHub, things like that.
04:33 So there's a bunch of cool things like that.
04:36 I thought it was going to ask it to a dance.
04:39 Exactly.
04:40 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?
04:47 My dad can drive us.
04:50 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.
04:57 So there's like these cool things on top of it.
04:59 But certainly I recommend watching that video, that seven-minute video, to see if this is something that's interesting to you.
05:06 I think I like it.
05:06 I think it's pretty cool.
05:09 There's some cool ones that I always forget about, like Get Town Rename.
05:14 I mean, renaming is not difficult, but it's nice to have a little minor.
05:20 Absolutely.
05:20 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?
05:31 Sure, you can do these things.
05:33 But it has a bunch of little steps to kind of catch the edge cases.
05:36 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.
05:43 Like each one of these commands usually results in five or six or seven Git commands.
05:48 It's worth checking out, especially if you like Git via the CLI.
05:52 Or you work in a team that wants really structured ways of doing these things.
05:56 I'm definitely going to check it out.
05:57 And actually, I used the, I can't remember what we called it last week, the SAG or something like that.
06:03 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
06:11 on.
06:12 Awesome.
06:13 Have you tried it on your Windows?
06:14 Like, I want a Windows terminal follow-up.
06:16 What was I using it on?
06:18 Remember, you were wondering if it would work on Windows.
06:20 Yeah.
06:21 Did you do this on your Mac?
06:22 I was using it on my Mac laptop.
06:24 Okay.
06:24 Well, the follow-up is still pending then.
06:27 Okay.
06:28 And we'll check out GitTown on Windows as well.
06:31 We'll take a little trip to GitTown.
06:32 I'm sure it's probably fine.
06:34 Yeah, this just automates Git, which works everywhere.
06:37 Okay.
06:38 Last week we did – going back to last week, I guess.
06:41 We did talk about a couple peps, and today I'd like to talk about another pep.
06:48 This one comes to us from Brett Cannon.
06:52 Well, I saw him posted on Blue Sky.
06:54 Pep 751 has been accepted.
07:03 So what is this Pep about?
07:04 It's about lock files.
07:05 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.
07:14 And for some tools, the format can act as a primary lock file format as well as instead of some proprietary format.
07:21 So we already had lock files.
07:23 A couple, lots of different tools had lock files, but they weren't the same lock file.
07:27 They were like UV had a lock and I think Poetry had a lock and there's a couple others.
07:33 So now we have a standardized one and it's actually, I was looking through the standard.
07:37 It looks pretty great.
07:39 One of the things that you would expect, you could do environments and versions and packages and stuff.
07:46 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.
07:54 And this allows arbitrary tool configuration.
07:58 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.
08:15 There's also packages tool.
08:17 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.
08:25 So this isn't to a, if you wanted to try this out now, let's look at an example first.
08:32 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.
08:40 It's in the PEP.
08:41 There's an example.
08:42 Mostly this is fairly readable and I'm pretty on board with how this is set up.
08:47 It looks pretty good.
08:49 It's Toml syntax.
08:51 You've even got things like, of course, hashes and stuff.
08:56 If you want to leave the hashes in for making sure it's the right thing.
09:01 So this is all great.
09:02 The other bit scrolling down is, well, how can I use this right now?
09:08 There is, there's some stuff, information about how to teach it, of course.
09:12 some discussion around rejected ideas.
09:15 Oh, I forgot to mention the name.
09:17 The name of it is pylock.toml, or pylocksomething.toml.
09:24 That's just what they came up with.
09:26 It doesn't conflict with any other tools right now, and it's reasonable, so that's good.
09:32 If you want to try this right now, I thought we had an implementation.
09:40 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.
09:53 So Mousebender allows you to play with it if you want to play with it right now.
09:57 So I imagine that some of the other tools will kind of take this up also.
10:03 And I would expect that, like, for instance, UV or something might, I don't know.
10:09 I'm not involved with UV, but I would expect some of these tools to pick them up pretty quick.
10:14 But we'll see.
10:15 Yeah, well, first of all, congratulations, Brett Cannon.
10:19 I know you've been working on this for a long time.
10:23 Here we are.
10:23 Super exciting.
10:24 So I'm sure some conversations at PyCon will be had about this.
10:28 Yeah.
10:28 Super neat.
10:29 So one thing that I like is the format.
10:32 I saw like the hash is on the same line as the actual requirement pinned version there.
10:41 So I'm trying to do hashes in my requirements.txt files.
10:45 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.
11:00 Like, well, what one of these changed because the version changed and what is the new version and so on.
11:05 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.
11:16 So I think that's going to be really nice to look at.
11:19 So I might put the hashes back in.
11:21 Yeah, I think it's kind of cool that there's an upload time.
11:24 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.
11:30 That's cool.
11:31 Yeah, you just kind of know how old is that as well.
11:33 Yeah.
11:34 Right.
11:34 I mean, for things that are not using Calver or they're abusing Calver, you know,
11:39 is it five minutes old or is it five months old?
11:41 That might matter to you.
11:43 Yeah.
11:43 Yeah.
11:44 Very cool.
11:44 So awesome.
11:45 I'm here for it.
11:46 And do you know what else is awesome?
11:47 What is that, Brian?
11:48 I think Posit's pretty awesome.
11:50 Oh, they are awesome.
11:51 Very much.
11:52 So I'd like to take a moment to thank our sponsor.
11:55 This episode of Python Bytes is brought to you by the folks at Posit.
11:59 Posit has made a huge investment in the Python community lately.
12:02 Known originally for RStudio, they've been building out a suite of tools and services for Team Python.
12:08 Over the past few years, we've learned some pretty scary terms like type squatting, supply chain attack, obfuscated code, and more.
12:15 These all orbit around the idea that you install Python packages.
12:20 When you install Python packages, you're effectively running arbitrary code off the internet, on your dev machine, and usually even your production servers.
12:28 That thought alone makes me shudder.
12:31 This doesn't even touch on the reproducibility issues surrounding external packages, but there are tools to help.
12:38 Posit Package Manager can solve both problems for you.
12:42 Think of Posit Package Manager as your personal package concierge.
12:47 You use it to build your own package repository within your firewall that keep your project safe.
12:54 You can upload your own internal packages to share or import packages directly from PyPI.
13:00 Your team members can install from these repos in the normal ways using tools like PIP, Poetry, and UV.
13:06 Posit Package Manager will help you manage updates, ensuring you're using the latest, most secure version of your packages.
13:13 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.
13:25 Posit Package Manager reports on packages with known CVEs and other vulnerabilities so you can keep ahead of threats.
13:32 And if you need the highest level of security, you can even run Posit Package Manager in an error-gapped environment.
13:39 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.
13:47 Visit pythonbytes.fm/ppm today and get a three-month free trial and see if it's a good fit.
13:54 That's pythonbytes.fm/ppm.
13:57 The link is in your podcast player's show notes.
14:00 Thank you, Posit, for supporting Python Bytes.
14:03 Indeed. Thanks, Posit.
14:04 It's a cool project.
14:05 Having a little bit more control over your packages is always a good thing.
14:09 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.
14:17 Who?
14:18 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?
14:25 Who, what, where, when, why, how are we covering these things?
14:28 We've gone from where to who, and now we're talking about Git dash who.
14:33 So I've always enjoyed the get blame or basically more broadly like source control blame.
14:40 Like, all right, who did this?
14:43 Do you see that line of code?
14:44 Who do I talk to about this?
14:46 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.
14:52 But who do I talk to about this line of code?
14:55 You know what I mean?
14:56 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?
15:04 Editors support that.
15:05 Super easy these days.
15:07 Like in PyCharm, it'll actually put an overlay of who wrote the function or whatever.
15:12 If you click on that, it'll sort of slide out the get blame.
15:15 But that's a line by line type of thing.
15:18 What if instead I wanted to know as an entire project?
15:22 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.
15:39 Cool, right?
15:40 So that's super easy to do.
15:43 And you can go into subdirectories and sort of explore those and go who's created changes on this particular subdirectorie or whatever.
15:51 So I think this is really neat.
15:53 It's sort of a natural extension of get blame.
15:55 Okay, so you can give it a particular file even and just say who modified this file?
16:01 Yeah, I would think it would say how many contributions there are to that particular file.
16:04 I don't know if you can give it a file, but there was a single file in a directory.
16:08 That's pretty cool.
16:09 Probably you can give it a file as well.
16:10 Yeah, it just sort of shows you who has been active in this repo or this subdirectory of a repo lately and how much have they
16:17 contributed.
16:18 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.
16:26 Do you want to break it?
16:28 Well, no, I don't want to be blamed for it.
16:30 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.
16:38 Yeah, that's an interesting angle.
16:40 I wonder if you should almost create like a formatter account and just let the formatter do the formatting.
16:46 Well, actually, that's one of the lovely things about putting, putting like, separating, separating formatting stuff.
16:53 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.
17:00 Don't do it in the same commit as a bunch of actual code changes.
17:04 Sure, sure.
17:04 But it doesn't fix the blame part.
17:06 No, it doesn't really fix the blame part.
17:08 But another thing that the, that GitTown thing does is it'll, it uses squashing pretty aggressively.
17:15 So when you do all your feature branches and you make 20 changes, you can squash that into a single commit
17:19 as part of the publication PR flow.
17:23 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,
17:31 adjusted space, you know, like random.
17:34 Like if you get it too small, your comments are like really, really not historically relevant.
17:38 You know, like this is the formatting statement, like great.
17:40 And why did, when were we doing this?
17:42 You know what I mean?
17:43 Yeah.
17:43 Actually, I kind of forget that not everybody does that.
17:46 So I always do a squash workflow.
17:48 I see you're a natural squasher.
17:50 Okay.
17:50 I'm a natural squasher, yeah.
17:52 That's of course.
17:53 Well, mostly because it's way easier to roll back stuff.
17:55 So if there's something that really causes a downstream problem, you kind of want
18:00 to roll back all of that work together.
18:02 Yeah, that's a good point.
18:04 So next up is whatcha, whatcha.
18:07 Okay.
18:08 Watch, G-H-A, but there's no capitalization.
18:11 So whatcha, Tom.
18:13 And this comes to us from Ned Batchelder, as in not he sent it to us, but he created it.
18:18 And this is just another Git thing real quick.
18:20 I think people find it relevant.
18:21 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.
18:33 So imagine there's a bunch of changes that have come in.
18:35 You're running talks for different versions of Python on your thing.
18:39 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?
18:45 How long are they taking?
18:46 So you can just point this at a GitHub repo that has a GitHub action.
18:50 This is awesome.
18:51 It's pretty cool, right?
18:52 Yeah.
18:53 Yes, I often have, like, a git tab open to watch this stuff, but having it right in the command line, nice.
19:00 Yeah, and it's like a live updating, very TUI feel, right?
19:04 It's a very advanced sort of UI.
19:06 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.
19:13 Yeah.
19:14 Cool.
19:14 So, yeah.
19:15 Well done on that, Ned.
19:16 That's super cool.
19:18 All right.
19:19 That's it for my main items.
19:20 Over to you, Brian.
19:21 Okay.
19:21 So are we on?
19:23 No, for your last one, you got one more, don't you?
19:24 Oh, I got one more.
19:25 Yeah, I do.
19:26 I think you do.
19:27 Yeah.
19:27 So next up is I'd like to talk about UV a little bit.
19:35 Yes.
19:36 So this is Dave J.
19:40 So Dave Johnson article.
19:44 It's called Share Python Scripts Like a Pro, UV and PEP 723 for Easy Deployment.
19:50 And we've talked about a lot of these pieces in different episodes.
19:55 But I really like this write-up.
19:59 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.
20:12 So it starts out with talking about what UV is and PEP 723.
20:18 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.
20:26 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.
20:41 So that's an extra dependency that's outside of the script.
20:46 And this is if you're doing a web scraping script, you're going to often have like some extra dependency or something.
20:53 So then that's the script.
20:55 It teaches you how to install UV, but you probably already have it installed.
20:59 And then how do I add that thing?
21:02 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.
21:13 So it sticks that script block at the top of your code, which is awesome.
21:20 And I think I knew that but forgot about it.
21:22 So I'm glad it's in there to just add that little script tag.
21:26 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.
21:36 It isn't necessary that you know that for scripts, but it's good for people to have that knowledge about the whole ecosystem.
21:44 Talks about running it with UVRun.
21:48 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.
21:56 You can add that to the top and it gives the specific environment SUV run script that you have to stick to the top of that.
22:04 That is super interesting, actually.
22:07 And then you don't have to say Python or UV run.
22:09 You can just save the script name if it's an executable and it'll just work, which is awesome.
22:14 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.
22:26 I haven't tried this, but you can use Pi and other things.
22:29 So there's some help.
22:29 I think the Pi launcher respects shebangs on Windows, which is something it adds.
22:35 Okay, cool.
22:36 And then he recommends creating like an extra script with a CMD script to launch your script with.
22:45 So how to do this, how to complete the loop with Windows.
22:49 So really great write-up for people writing utility scripts in Python.
22:55 That's actually really nice.
22:57 Yeah, well done.
22:58 Yeah, so that's all for our main topics.
23:03 We both have extras.
23:05 Do you want to jump into your extras first or do you want me to do ours?
23:08 I'll do mine real quick, sure.
23:09 I 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.
23:22 This PySQL scribe lets you express through code the structure of your tables and their relationships.
23:28 And then you can ask it like, hey, what would the query of this be?
23:31 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.
23:42 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?
23:51 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.
24:01 Good job, Daniel.
24:02 So a little bonus there.
24:04 We talked about, this is a long running one.
24:06 We talked about formatting Markdown with MD format, which I've started to adopt.
24:12 I will talk about that next.
24:14 But Hugo points out, like, hey, I use Prettier, which has been around for a long time.
24:19 It now has a Markdown format.
24:21 So that's really cool from 2017.
24:23 People can check that out.
24:25 And I'll link to that in the show notes if you want to use that.
24:27 I, however, am continuing on with MD format.
24:31 And I ran it against the entire markdown structure of my upcoming Talk Python and production book.
24:38 And it's, like I said, all markdown.
24:40 One of the things I discovered, I don't know if you knew it, Brian, but I definitely did not.
24:44 It's a really interesting linting philosophy.
24:46 Would you run it against markdown?
24:48 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
25:00 change oh that's cool yeah 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
25:17 obviously it's 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.
25:46 And so that looked really crappy.
25:47 So if you say --wrap, no, it'll actually explicitly unwrap if you've accidentally got some in there.
25:54 So I like number and wrap, no, not just not change it, but actually unravel the wrapping, which I thought was really cool.
26:00 And as part of that, we did talk about UV, sorry, we talked about PIPX Inject.
26:05 And last time you pointed out correctly that uv tool install --width is the equivalent.
26:12 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.
26:21 So uv tool install, MD format width, MD format, GFM, --width, MD format front matter, --width, and so on.
26:30 So if you want to get that inject feel, you've got to like width separately every single parameter, every single extra or whatever.
26:37 so 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.
27:13 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?
27:20 Where it has just icons on the left for the tabs and a dress bar across the top.
27:24 The new Firefox is pretty good.
27:26 There's still stuff missing that Zen brings.
27:27 That's really cool.
27:28 But anyway, I wanted to point people that that's an option now.
27:31 Nice.
27:32 Yeah.
27:32 Finally, last thing on my end is a follow-up on UV from James Falcon.
27:38 Sorry, James Falcon.
27:40 Thanks for sending us in.
27:40 He says, hey, I'm also a UV enthusiast.
27:43 And I was holding out to using UV because there's one case it hasn't solved.
27:47 However, you guys convinced me to work through it and get it figured out.
27:50 So he maintains a library supported across multiple Python versions and needs to deal with bugs and specific ones.
27:57 So like it doesn't work this way in 3.8, but it works fine in 3.10.
28:01 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.
28:10 But the way UV worked originally, it didn't.
28:12 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.
28:20 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.
28:29 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.
28:39 So kind of gives us an example of like how you might sort of pyvee and be your way around different versions using UV.
28:46 That's pretty cool.
28:47 Yeah, so there's a little bash script that people can check out if they want to use it.
28:51 Nice.
28:51 Okay.
28:52 In the show notes.
28:53 Yep.
28:53 That's it for my extras.
28:54 Well, so for my extras today, so it's April, right?
28:59 And one of the things we do on April 1st, sometimes there's April Fool's pranks that happen.
29:08 And one of the things, so there's good April Fool's pranks and then there's bad April Fool's pranks.
29:14 So I'm going to cover both.
29:16 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.
29:25 I'm not sure.
29:26 I looked and I'm like, that is a really weird thing to kind of do an official joke from the PSF.
29:30 That CultRepo group, they make a bunch of documentaries about, like highly produced documentaries about programming languages and their origins or
29:41 programming frameworks.
29:43 Like they have some on Vue.js and they have some on Angular.
29:46 That's where it's from.
29:47 Okay.
29:48 So the video is breaking Guido Van Rossum returns as Python's BDFL.
29:53 And it's a two-minute video or almost two minutes.
29:55 Hilarious.
29:56 I loved it.
29:58 It shows him like typing of the saying that everybody, what is the standards people?
30:07 Oh, the boards.
30:09 Steering counsel.
30:10 Steering counsel is no longer necessary.
30:13 A couple of things I wanted to point out that I loved about this video.
30:17 Brett Cannon, he's in it and he's listed as famous Python quotationist is his title.
30:25 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.
30:36 And that's not a Guido quote.
30:38 That's a Brett quote.
30:39 So the famous Python quotation is gets crossed out after Guido says that, which is pretty funny.
30:49 And then a little later, who was this?
30:52 Barry Warsaw walks in and says, Guido, are we ready to release Python 2.8?
30:58 Which is never going to happen, right?
31:00 So that's pretty good.
31:04 Guido says indentation is enlightenment.
31:07 And Barry gives him credit for saying that being Pythonic means becoming one with white space, which is good.
31:19 Anyway, and then it kind of wraps it up with Guido announcing that he's going to implement a new keyword, maybe.
31:28 It's kind of like if, but way more Pythonic.
31:31 So maybe something.
31:33 And it gives an example of maybe print Python, the documentary, coming this summer.
31:38 And I kind of hope that one is real.
31:41 I hope we get a documentary coming.
31:44 Well, it's already this summer, or it's almost this summer.
31:47 If we get a documentary.
31:48 Well, we're going to get it soon, then that'll be great.
31:50 And if this cult repo company makes it, I think it'll be pretty good, yeah.
31:54 When I first saw this, I was like, I saw a tweet come out.
31:57 I'm like, hey, whatever.
31:58 Funny little joke.
31:59 And I just thought it was a tweet.
32:01 And Nick Wallace sent it over and like, wait, you should check this out.
32:04 It's funny.
32:04 And I'm like, watch.
32:05 I'm like, oh, there's way more here than I realized.
32:08 This is well done.
32:10 This is good.
32:11 Okay, so that's a good way to do an April Fool's prank.
32:15 I've never done one.
32:16 I've never done like a tech prank.
32:17 So I decided to try my hand at that this year.
32:21 It did not go that well.
32:23 So I'm – and you know how – have you ever heard like if you have to explain a joke, then it's not funny?
32:29 This is me explaining a joke, so it's not funny.
32:33 So there's pytest Repeat.
32:35 So I've been doing, on testing code, I've been doing this series on pytest plugins.
32:40 And pytest Repeat is one that I use all the time.
32:43 And I noticed that it hadn't been being tested on, it only was tested on 312.
32:48 It's not tested on 313 yet or 314.
32:51 And, okay, so 314 is 3.14.
32:55 pi starts with 3.14, but pi is an irrational number, and it doesn't repeat.
33:01 So the joke I was trying to make was I put out an episode on testing code.
33:06 On April 1st, Python 3.4 won't repeat with pytestRepeat.
33:11 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.
33:24 Yeah, that was nice.
33:25 I listened to that episode.
33:26 It was well done.
33:27 Anyway, I got some feedback of people confused and wondering why I was testing 3.14 anyway, since it was an alpha.
33:36 And anyway, I had to explain like to five different people that it's actually fine.
33:41 So the TLDR is pytest Repeat works fine with Python 3.14.
33:48 So don't worry about it.
33:51 Anyway, how not to do an April Fool's break.
33:54 So I guess that's all of our extra items, right?
33:58 It sure is.
33:59 We'll see how much I got to explain this joke, huh?
34:02 No, I think this one is fine.
34:04 This one is good.
34:05 So this comes to us from the Programming Humor Twitter feed.
34:08 And it says, what's the best thing you found in code?
34:13 And they are almost always about comments in this thread.
34:17 So here's a, this is actually Python.
34:20 So this is a comment that somebody found in the code and they posted it.
34:24 But if you look through and you look at the comments below, there's a glorious set of 132 comments of similar.
34:34 They're not all great.
34:35 But so here's what it says at the top of this thread.
34:38 It says, as a comment, you may think that this function is obsolete and it doesn't seem to do anything.
34:43 And you would be correct.
34:44 But when we remove this function, for some reason, the whole program crashes and we can't figure out why.
34:49 So here it will stay.
34:53 So I entitled the joke, so here it will stay.
34:56 And let me see if I can find a few.
34:58 This is my favorite one, though.
35:00 This probably should have been the top line one, but this came to us as a response from the original.
35:04 Somebody named Jeppe pointed out and said, not mine, but I find this kind of funny.
35:10 And this is a C-based type of language because it's slash slash for the comment.
35:14 Dear programmer, when I wrote this code, only God and I knew how it worked.
35:18 Now only God knows it.
35:19 Therefore, if you're trying to optimize this routine and it fails, most surely it will.
35:24 Please increase the counter as a warning to the next person.
35:27 And then there's a variable below that says, total hours wasted here, 254.
35:33 So good.
35:36 That's good.
35:37 And on and on it goes.
35:38 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.
35:46 So there it is.
35:49 That's good.
35:49 Yeah, I think that's a good one.
35:51 Yeah.
35:52 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
36:00 for obviously it was getting run and the timing, I'm sure it was just timing.
36:04 Like if you took it out, it changed the timing of the rest of the program and then it didn't work.
36:09 So yeah, I've actually run into it.
36:11 You would uncover some kind of concurrency bug that it was defensive against.
36:16 Yeah, yeah.
36:17 C codes are like that.
36:20 It's hard to see there.
36:21 that's true. Hard to see the errors.
36:24 That's... That was good, wasn't it?
36:25 No. No, it wasn't. We better quit.
36:27 We better just call it an episode.
36:28 Okay. Alright.
36:29 Thanks a lot. Bye. Bye.