WEBVTT

00:00:00.040 --> 00:00:04.660
<v Brian Okken>Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:00:05.130 --> 00:00:10.240
<v Brian Okken>This is episode 467, recorded January 26, 2026.

00:00:10.570 --> 00:00:11.880
<v Brian Okken>Ooh, that's a lot of 26s.

00:00:12.200 --> 00:00:13.200
<v Brian Okken>I'm Brian Okken.

00:00:13.460 --> 00:00:14.220
<v Michael Kennedy>I'm Michael Kennedy.

00:00:14.560 --> 00:00:22.420
<v Brian Okken>This episode is sponsored by all of us, all of you, and the products that we have going at Python Bytes,

00:00:22.720 --> 00:00:28.520
<v Brian Okken>and I guess not at Python Bytes, but Talk Python Training, and at pythontest.com,

00:00:28.580 --> 00:00:34.060
<v Brian Okken>We've got the pytest course and LeanTDD, but Michael's got courses and books and all sorts of fun stuff.

00:00:34.500 --> 00:00:36.020
<v Brian Okken>And also, of course, Patreon supporters.

00:00:36.320 --> 00:00:37.940
<v Brian Okken>We still love you.

00:00:38.500 --> 00:00:44.080
<v Brian Okken>And yeah, if you'd like to connect with us and send us topics, maybe topics for the show, we love that.

00:00:44.440 --> 00:00:50.640
<v Brian Okken>You can just send us through the contact form at pythonbytes.fm, but you can also find us on the socials.

00:00:51.580 --> 00:00:52.920
<v Brian Okken>And the links are in the show notes.

00:00:53.060 --> 00:00:54.840
<v Brian Okken>We're on Bluesky and Mastodon.

00:00:55.620 --> 00:00:59.320
<v Brian Okken>Yeah, and if you'd like to see what we look like

00:00:59.880 --> 00:01:02.420
<v Brian Okken>or watch us live or tape recorded,

00:01:03.100 --> 00:01:05.820
<v Brian Okken>you can go to pythonbytes.fm/live

00:01:06.120 --> 00:01:07.780
<v Brian Okken>and yeah, check out that.

00:01:08.040 --> 00:01:10.020
<v Brian Okken>And it tells you when we're going to show next time.

00:01:10.180 --> 00:01:11.900
<v Michael Kennedy>Yeah, they can even check out a glimpse

00:01:12.200 --> 00:01:15.540
<v Michael Kennedy>of the Python staff of power just behind you there.

00:01:15.620 --> 00:01:16.300
<v Brian Okken>Yeah, that's right.

00:01:17.000 --> 00:01:17.680
<v Brian Okken>Yeah, there it is.

00:01:19.220 --> 00:01:21.400
<v Brian Okken>Yeah, and I'm still on the fence

00:01:21.540 --> 00:01:23.000
<v Brian Okken>about going to PyCon this year.

00:01:23.070 --> 00:01:24.060
<v Brian Okken>And if I go to PyCon,

00:01:24.300 --> 00:01:25.920
<v Brian Okken>I'll definitely bring the staff of power.

00:01:26.560 --> 00:01:29.440
<v Michael Kennedy>My fence has been built and decided upon.

00:01:29.590 --> 00:01:33.360
<v Michael Kennedy>I bought my tickets and I got actually a pretty amazing deal on Expedia.

00:01:34.140 --> 00:01:42.980
<v Michael Kennedy>I was able to get four days hotel right near a block or two from the convention center and the water and a round trip flight for 600 bucks total.

00:01:43.340 --> 00:01:43.740
<v Michael Kennedy>So I'm going.

00:01:44.080 --> 00:01:44.900
<v Brian Okken>Oh, nice.

00:01:45.440 --> 00:01:45.540
<v Brian Okken>Yeah.

00:01:45.920 --> 00:01:51.520
<v Brian Okken>I'm going to try to ask work if I can get away with not having to take vacation time to go.

00:01:52.240 --> 00:01:52.900
<v Michael Kennedy>Yeah, wouldn't that be nice?

00:01:53.160 --> 00:01:54.460
<v Michael Kennedy>Hey, they talk about pytest there.

00:01:54.510 --> 00:01:55.540
<v Michael Kennedy>I know you're doing a lot with that.

00:01:55.860 --> 00:01:56.020
<v Michael Kennedy>Yeah.

00:01:56.290 --> 00:01:56.980
<v Michael Kennedy>So, all right.

00:01:57.090 --> 00:01:59.420
<v Michael Kennedy>Well, should we do some topics for the show?

00:01:59.980 --> 00:02:00.640
<v Michael Kennedy>Let's talk.

00:02:00.980 --> 00:02:02.200
<v Michael Kennedy>Oh, I have the toad up.

00:02:02.360 --> 00:02:03.420
<v Michael Kennedy>That is not what I want to talk about.

00:02:03.460 --> 00:02:06.720
<v Michael Kennedy>I want to talk about this thing called the Gray Noise IP Check.

00:02:06.870 --> 00:02:07.000
<v Michael Kennedy>Okay.

00:02:07.310 --> 00:02:14.040
<v Michael Kennedy>So Gray Noise is a company that does research on cyber security breaches,

00:02:14.490 --> 00:02:15.340
<v Michael Kennedy>et cetera, et cetera, right?

00:02:15.640 --> 00:02:15.740
<v Brian Okken>Yeah.

00:02:16.060 --> 00:02:20.000
<v Michael Kennedy>So they have published this thing called the Gray Noise IP Check.

00:02:20.560 --> 00:02:26.480
<v Michael Kennedy>And if you just go to check.labs.greynoise.io or way simpler, click the link in the show notes.

00:02:26.940 --> 00:02:30.900
<v Michael Kennedy>It will take you to this place that says your IP address is whatever your IP address is.

00:02:31.360 --> 00:02:33.600
<v Michael Kennedy>And your IP address is clean.

00:02:33.920 --> 00:02:41.560
<v Michael Kennedy>Your IP has not been observed scanning the internet or contained in the common business services data set.

00:02:41.880 --> 00:02:42.840
<v Michael Kennedy>So what is this for?

00:02:43.220 --> 00:02:51.360
<v Michael Kennedy>Like in the day of 30 things connected to your internet, your Wi-Fi, with your kids installing random junk off the internet.

00:02:51.600 --> 00:02:52.760
<v Michael Kennedy>Like my kid is pretty good.

00:02:52.860 --> 00:02:54.920
<v Michael Kennedy>She says, dad, is it okay if I install this?

00:02:55.480 --> 00:02:56.440
<v Michael Kennedy>Yes, it's okay or no.

00:02:56.600 --> 00:03:02.540
<v Michael Kennedy>And she actually completely reformatted her Windows 11 machine so she could play games but not worry about what was installed on it.

00:03:02.920 --> 00:03:04.680
<v Michael Kennedy>So, you know, not knocking the kid or anything.

00:03:04.980 --> 00:03:06.380
<v Michael Kennedy>But kids install stuff.

00:03:06.800 --> 00:03:08.040
<v Michael Kennedy>Other people install stuff.

00:03:08.240 --> 00:03:14.320
<v Michael Kennedy>Your TV, your smart power thing that goes to that lamp in the corner.

00:03:14.590 --> 00:03:17.540
<v Michael Kennedy>You know, there's a crap ton of stuff that is on your network.

00:03:18.040 --> 00:03:20.340
<v Michael Kennedy>And even if you run some sort of virus check on your computer,

00:03:21.080 --> 00:03:23.600
<v Michael Kennedy>having that come up empty doesn't mean that there's not a problem

00:03:24.010 --> 00:03:25.720
<v Michael Kennedy>with things that you are in control of, right?

00:03:26.120 --> 00:03:29.000
<v Michael Kennedy>So basically the idea of this thing is you can go here

00:03:29.140 --> 00:03:32.700
<v Michael Kennedy>and it will tell you if something on your network has been being bad.

00:03:32.960 --> 00:03:33.200
<v Michael Kennedy>Okay.

00:03:33.660 --> 00:03:33.760
<v Michael Kennedy>Yeah.

00:03:34.140 --> 00:03:36.220
<v Michael Kennedy>And I don't know, for me, I thought that was pretty cool.

00:03:36.480 --> 00:03:41.940
<v Michael Kennedy>So I threw it in as one of the topics so that other people can click on this and see, I guess, a couple caveats.

00:03:42.420 --> 00:03:48.720
<v Michael Kennedy>If your IP address just changed recently, it's very plausible that you could get a warning.

00:03:49.140 --> 00:03:50.320
<v Michael Kennedy>And it was whoever had it before.

00:03:50.800 --> 00:03:51.100
<v Michael Kennedy>You know what I mean?

00:03:51.400 --> 00:03:54.620
<v Michael Kennedy>Like we had a power outage for just a couple hours.

00:03:55.180 --> 00:03:59.680
<v Michael Kennedy>Some sort of, I think I talked about this last time because my mic had gotten all reset.

00:03:59.900 --> 00:04:04.060
<v Michael Kennedy>Because everything got powered 100% down because some sort of transformer thing exploded.

00:04:04.440 --> 00:04:05.980
<v Michael Kennedy>We got a new IP address from then.

00:04:06.400 --> 00:04:08.180
<v Michael Kennedy>Right. But, you know, a couple of weeks ago.

00:04:08.520 --> 00:04:11.200
<v Michael Kennedy>And so it turns out that I guess things are still good.

00:04:11.360 --> 00:04:11.980
<v Michael Kennedy>That's good to know.

00:04:12.700 --> 00:04:15.300
<v Michael Kennedy>But if you just had your IP address change,

00:04:15.620 --> 00:04:18.060
<v Michael Kennedy>then it could be picking up issues from whoever had it before.

00:04:18.590 --> 00:04:21.060
<v Michael Kennedy>Right. Kind of like you keep getting spam with that new phone number you got.

00:04:21.859 --> 00:04:23.400
<v Michael Kennedy>Yeah. But these, I don't know about you,

00:04:23.500 --> 00:04:26.520
<v Michael Kennedy>but my IP address is pretty much rock solid stable.

00:04:26.810 --> 00:04:29.300
<v Michael Kennedy>Unless something goes wrong with the internet or with power,

00:04:29.590 --> 00:04:30.240
<v Michael Kennedy>then it may change.

00:04:30.420 --> 00:04:32.680
<v Michael Kennedy>But other than that, it's the same for quite a while.

00:04:33.160 --> 00:04:37.840
<v Brian Okken>I'm slightly embarrassed to say I usually don't know my IP address.

00:04:38.320 --> 00:04:42.460
<v Brian Okken>And I actually don't quite get how, I mean, I get how IP addresses work.

00:04:42.680 --> 00:04:46.800
<v Brian Okken>But like for a house, is your whole house like the same IP address?

00:04:47.300 --> 00:04:49.280
<v Brian Okken>Or I don't know how that works.

00:04:51.000 --> 00:04:52.820
<v Brian Okken>Also, like, does this, can you use this?

00:04:52.960 --> 00:04:56.980
<v Brian Okken>Like if you're at a cafe to check to see if there's other like bad actors there?

00:04:57.100 --> 00:04:58.400
<v Michael Kennedy>Yeah, I guess you probably could actually.

00:04:58.540 --> 00:04:58.640
<v Michael Kennedy>Yeah.

00:04:58.960 --> 00:04:59.500
<v Brian Okken>So, yeah.

00:04:59.840 --> 00:04:59.920
<v Brian Okken>Anyway.

00:05:00.660 --> 00:05:01.000
<v Brian Okken>Interesting.

00:05:01.380 --> 00:05:01.500
<v Michael Kennedy>Okay.

00:05:01.880 --> 00:05:02.700
<v Brian Okken>Well, I'll have to check it out.

00:05:02.760 --> 00:05:09.000
<v Michael Kennedy>And I know more because I have a lot of my stuff gated behind IP addresses, like the server.

00:05:09.540 --> 00:05:14.320
<v Michael Kennedy>You can't even SSH to the server unless your IP address is on a whitelist, right?

00:05:14.580 --> 00:05:17.520
<v Michael Kennedy>So periodically when it changes, I'm like, oh, what is my IP address again?

00:05:17.670 --> 00:05:18.840
<v Michael Kennedy>So then I go copy.

00:05:18.950 --> 00:05:23.620
<v Michael Kennedy>I don't really pay too much attention, but because of that, I kind of got to pay a little attention.

00:05:23.940 --> 00:05:27.660
<v Brian Okken>Yeah, I'm like a very data in the cloud sort of person.

00:05:28.060 --> 00:05:28.720
<v Brian Okken>So I guess.

00:05:28.840 --> 00:05:28.960
<v Brian Okken>Perfect.

00:05:29.240 --> 00:05:29.400
<v Michael Kennedy>All right.

00:05:29.740 --> 00:05:34.900
<v Michael Kennedy>Well, I'm very excited about this next topic that you have because I also saw it and said, that is killer.

00:05:35.440 --> 00:05:36.400
<v Michael Kennedy>It is killer.

00:05:36.840 --> 00:05:36.960
<v Brian Okken>Yeah.

00:05:37.220 --> 00:05:39.720
<v Brian Okken>So what we're talking about is TPROF.

00:05:39.900 --> 00:05:41.460
<v Brian Okken>This is from, or TPROF?

00:05:41.600 --> 00:05:42.420
<v Brian Okken>I think it's TPROF.

00:05:42.660 --> 00:05:44.780
<v Brian Okken>It's the targeting profiler from Adam Johnson.

00:05:45.560 --> 00:05:49.780
<v Brian Okken>And we've got a link to the PyPA site.

00:05:50.760 --> 00:05:54.400
<v Brian Okken>But it just mostly says, yeah, it's a targeting profiler.

00:05:54.640 --> 00:05:58.920
<v Brian Okken>But we're also going to link to his article introducing it.

00:05:59.100 --> 00:06:06.820
<v Brian Okken>introducing tprof a targeting profile profiler so that yeah so it's it almost speaks for itself

00:06:07.360 --> 00:06:13.700
<v Brian Okken>what the what he's talking about is if you run a profiler on your program it gives you everything

00:06:13.950 --> 00:06:20.020
<v Brian Okken>it like it and that and you do you want to do that at first to to see all the hot spots where

00:06:20.030 --> 00:06:24.940
<v Brian Okken>are you spending your time and that's what you use profilers for to see where you know where you

00:06:24.960 --> 00:06:31.920
<v Brian Okken>maybe could could optimize some of your some of your code and so but and once you pinpointed what

00:06:31.940 --> 00:06:37.300
<v Brian Okken>you want to try to fix then you want to try to measure that and you kind of have to do and his

00:06:37.380 --> 00:06:42.580
<v Brian Okken>his pain point was running running it over the whole program again and again and again and you

00:06:42.580 --> 00:06:47.540
<v Brian Okken>don't really need to so his is a targeting profiler and you give it exactly the function that you're

00:06:47.600 --> 00:06:53.599
<v Brian Okken>caring about or the functions multiple and it'll report what the times are like the minute max and

00:06:53.620 --> 00:06:58.620
<v Brian Okken>stuff. And then he went further and said, there's a lot of times where you're just going to want to

00:06:58.640 --> 00:07:04.340
<v Brian Okken>do like a before and after function. And it probably won't be before and after, but you can

00:07:04.440 --> 00:07:12.500
<v Brian Okken>like my search routine old and my search routine new or something like that. And you can have those

00:07:12.660 --> 00:07:18.800
<v Michael Kennedy>be targeted and run the results and compare those. Nice. It's like a showdown, right? Instead of

00:07:18.900 --> 00:07:23.200
<v Michael Kennedy>trying to remember the results, you just say, here's the old way, here's the new way. How'd that

00:07:23.080 --> 00:07:28.080
<v Brian Okken>turn out right. And he's kind of got two ways to do it. You can do like a, well, so you can do the

00:07:28.320 --> 00:07:33.660
<v Brian Okken>past the functions that you want to want to look at on the command line. So you don't even

00:07:33.840 --> 00:07:39.820
<v Brian Okken>have to actually change anything in your code to do this. You can just, you can just target a couple

00:07:39.900 --> 00:07:48.180
<v Brian Okken>functions and, and call those. And then, but you can also do a dash X for a compare and it'll do

00:07:48.200 --> 00:07:50.820
<v Brian Okken>a delta time, like a percent faster or a percent slower,

00:07:51.290 --> 00:07:51.920
<v Brian Okken>which is pretty cool.

00:07:52.920 --> 00:07:56.280
<v Brian Okken>Or you can not have to do the command line thing too much

00:07:56.330 --> 00:07:59.560
<v Brian Okken>and just do as a context manager.

00:07:59.730 --> 00:08:02.460
<v Brian Okken>You can say which ones you're going to compare

00:08:03.150 --> 00:08:05.500
<v Brian Okken>and run those before and after with tprof.

00:08:06.480 --> 00:08:09.140
<v Brian Okken>All those are, I probably use all of those

00:08:09.380 --> 00:08:12.600
<v Brian Okken>at different times, but I'm really excited to try this

00:08:12.670 --> 00:08:15.700
<v Brian Okken>to use, to optimize some code that I've been working on.

00:08:15.940 --> 00:08:16.960
<v Brian Okken>So it's pretty neat.

00:08:17.340 --> 00:08:22.320
<v Michael Kennedy>Apparently uses the new Python 3.12 profiling API, which is really nice.

00:08:22.610 --> 00:08:26.160
<v Michael Kennedy>So a little using the modern lower touch profiler as well.

00:08:26.600 --> 00:08:26.720
<v Brian Okken>Yeah.

00:08:26.770 --> 00:08:31.340
<v Brian Okken>So of course, you have to run it with 3.12 or above,

00:08:31.760 --> 00:08:35.500
<v Brian Okken>but that doesn't mean that the code that you're testing against

00:08:36.200 --> 00:08:38.000
<v Brian Okken>is necessarily just 3.12 and above.

00:08:38.219 --> 00:08:40.260
<v Brian Okken>It's just when you're running it, it'll be 3.12.

00:08:41.190 --> 00:08:43.060
<v Michael Kennedy>You know what? 3.12 is almost obsolete.

00:08:43.370 --> 00:08:43.740
<v Michael Kennedy>I'm serious.

00:08:44.090 --> 00:08:45.080
<v Michael Kennedy>Like how insane is that?

00:08:45.380 --> 00:08:45.700
<v Michael Kennedy>What?

00:08:46.580 --> 00:08:49.720
<v Michael Kennedy>I mean, 3.10 is the oldest that is even allowed.

00:08:50.100 --> 00:08:53.840
<v Michael Kennedy>Like 3.9 has gone into, like, we don't even do security patches anymore.

00:08:54.280 --> 00:08:55.980
<v Brian Okken>Yeah, yeah, that's true.

00:08:56.230 --> 00:08:59.660
<v Michael Kennedy>3.10 is on the shadow, and then, like, it's a few years until all that thing's gone.

00:08:59.920 --> 00:09:00.700
<v Michael Kennedy>So it's not that old.

00:09:01.020 --> 00:09:04.700
<v Michael Kennedy>And we don't even mention 2.7 anymore, the legacy.

00:09:05.420 --> 00:09:05.920
<v Michael Kennedy>So good.

00:09:06.480 --> 00:09:08.960
<v Michael Kennedy>So good to be past those days, right?

00:09:09.040 --> 00:09:38.140
<v Michael Kennedy>I would also like to point out that this is just so good for profiling any real application, like any real application, because so much of what happens if you just see profile my particular app is all the time spent loading modules, all the time connecting to the database and just all of that, you know, setting up the log in that all, like all the stuff that happens before you get to the one function, you want to see what's going on.

00:09:38.260 --> 00:09:39.240
<v Michael Kennedy>and then it stops and you're like,

00:09:39.540 --> 00:09:41.200
<v Michael Kennedy>the thing only takes 50 milliseconds,

00:09:41.780 --> 00:09:43.760
<v Michael Kennedy>but I've got profiling for like two seconds.

00:09:44.740 --> 00:09:46.060
<v Michael Kennedy>And what is going on?

00:09:46.160 --> 00:09:48.100
<v Michael Kennedy>It's just so lost in the noise.

00:09:48.620 --> 00:09:50.860
<v Michael Kennedy>And then this one, you can just say, run it,

00:09:51.100 --> 00:09:52.860
<v Michael Kennedy>let all that, just ignore all that junk.

00:09:53.200 --> 00:09:54.400
<v Michael Kennedy>When you get to this function, start,

00:09:54.600 --> 00:09:55.760
<v Michael Kennedy>when you're done with the function, stop.

00:09:56.140 --> 00:09:56.560
<v Michael Kennedy>You know what I mean?

00:09:56.940 --> 00:09:58.400
<v Brian Okken>Yeah, and that's actually, oh,

00:09:58.720 --> 00:10:00.660
<v Brian Okken>that part of it's overwhelming to me.

00:10:00.880 --> 00:10:02.640
<v Brian Okken>Every time I've had to reach, I don't have to,

00:10:02.820 --> 00:10:04.780
<v Brian Okken>you know, it's like a lot of debugging tools.

00:10:04.860 --> 00:10:06.560
<v Brian Okken>You don't have to reach for them all the time.

00:10:06.980 --> 00:10:11.100
<v Brian Okken>But when you do, it's a little overwhelming to look at all that profiling output.

00:10:12.200 --> 00:10:15.360
<v Brian Okken>And I still haven't got my head around flame graphs.

00:10:15.780 --> 00:10:16.340
<v Brian Okken>But, you know.

00:10:16.560 --> 00:10:16.680
<v Brian Okken>Yeah.

00:10:17.060 --> 00:10:17.360
<v Michael Kennedy>Catch them.

00:10:17.580 --> 00:10:17.940
<v Michael Kennedy>They're hot.

00:10:18.260 --> 00:10:26.920
<v Michael Kennedy>No, honestly, like the fact you just say, just profile this function, and that actually happens on the CLI, my profiling is back, baby.

00:10:27.380 --> 00:10:32.200
<v Michael Kennedy>Like, it's just, I'm like, is it really worth trying to dig through all that overhead and junk and decide, like, probably no.

00:10:32.570 --> 00:10:34.160
<v Michael Kennedy>But now maybe it really is.

00:10:34.640 --> 00:10:35.020
<v Michael Kennedy>Thanks, Adam.

00:10:35.760 --> 00:10:36.400
<v Michael Kennedy>Yeah, thank you, Adam.

00:10:36.520 --> 00:10:41.440
<v Michael Kennedy>And then one more thing is like a lot of times some things are slower the very, very first

00:10:41.640 --> 00:10:42.140
<v Michael Kennedy>times they run.

00:10:42.660 --> 00:10:48.060
<v Michael Kennedy>So it might be worth writing a function that actually like runs it a bunch of times or

00:10:48.560 --> 00:10:51.420
<v Michael Kennedy>runs it once before you get to it and then profile.

00:10:51.840 --> 00:10:52.220
<v Michael Kennedy>You know what I mean?

00:10:52.320 --> 00:10:56.700
<v Michael Kennedy>Like just like, because it might be the module loading that actually overwhelms the compute,

00:10:56.960 --> 00:10:59.640
<v Michael Kennedy>but that only happens once or, you know, do I see compilation?

00:11:00.160 --> 00:11:02.160
<v Brian Okken>The context manager one would be great for that.

00:11:02.260 --> 00:11:04.560
<v Brian Okken>then you could just, you could call both,

00:11:04.720 --> 00:11:06.500
<v Brian Okken>like both the new and the old function once.

00:11:06.980 --> 00:11:07.240
<v Brian Okken>Exactly.

00:11:07.860 --> 00:11:11.320
<v Brian Okken>And then do a loop and do like a hundred times

00:11:11.560 --> 00:11:12.980
<v Brian Okken>to the other two.

00:11:13.210 --> 00:11:14.660
<v Brian Okken>Yeah, that would be totally perfect.

00:11:14.810 --> 00:11:15.780
<v Brian Okken>That would be really, really good.

00:11:16.000 --> 00:11:17.720
<v Michael Kennedy>You know what we don't talk enough about though, Brian?

00:11:18.040 --> 00:11:19.660
<v Michael Kennedy>Honestly, I mean, toads.

00:11:20.040 --> 00:11:20.580
<v Michael Kennedy>Let's talk about toads.

00:11:21.000 --> 00:11:22.740
<v Brian Okken>I know, and we live in Oregon.

00:11:22.850 --> 00:11:23.900
<v Brian Okken>We got them all over the place.

00:11:24.280 --> 00:11:24.780
<v Brian Okken>We do.

00:11:25.090 --> 00:11:26.300
<v Brian Okken>We do got them all over the place.

00:11:26.690 --> 00:11:27.320
<v Brian Okken>Or frogs at least.

00:11:27.390 --> 00:11:28.580
<v Brian Okken>I don't know if we have toads.

00:11:28.760 --> 00:11:29.720
<v Michael Kennedy>I don't, you know what.

00:11:30.080 --> 00:11:32.720
<v Michael Kennedy>So with Toad, this comes from Will McGuggan.

00:11:33.420 --> 00:11:35.820
<v Michael Kennedy>It's kind of his next big thing that he's been working on

00:11:36.320 --> 00:11:37.600
<v Michael Kennedy>since Textual.

00:11:38.280 --> 00:11:43.240
<v Michael Kennedy>And the idea is it's kind of like a UI for Claude Code type

00:11:43.420 --> 00:11:43.500
<v Michael Kennedy>things.

00:11:43.540 --> 00:11:45.660
<v Michael Kennedy>It actually works with something called OpenHands.

00:11:45.860 --> 00:11:46.820
<v Michael Kennedy>It works with Claude Code.

00:11:47.040 --> 00:11:49.780
<v Michael Kennedy>It works with Gemini CLI, probably others

00:11:50.080 --> 00:11:50.700
<v Michael Kennedy>that I don't know about.

00:11:51.000 --> 00:11:52.500
<v Michael Kennedy>When I first saw this, I'm like, OK, well,

00:11:52.520 --> 00:11:53.380
<v Michael Kennedy>I already have a terminal.

00:11:53.800 --> 00:11:54.300
<v Michael Kennedy>I can do this.

00:11:54.300 --> 00:11:57.860
<v Michael Kennedy>Like, what-- I'm not really entirely sure what I need this

00:11:58.000 --> 00:11:58.180
<v Michael Kennedy>for.

00:11:58.540 --> 00:12:01.020
<v Michael Kennedy>But the more I looked into it, it looks really quite neat.

00:12:01.440 --> 00:12:04.560
<v Michael Kennedy>So if you go through, it obviously renders pictures.

00:12:05.120 --> 00:12:06.200
<v Michael Kennedy>Apparently not there.

00:12:06.200 --> 00:12:06.880
<v Michael Kennedy>It renders pictures.

00:12:07.520 --> 00:12:10.340
<v Michael Kennedy>Like one of the pictures is the Mandelbrot set drawn.

00:12:10.740 --> 00:12:11.000
<v Michael Kennedy>Cool.

00:12:11.240 --> 00:12:16.000
<v Michael Kennedy>And it has really nice, basically better input.

00:12:16.840 --> 00:12:19.340
<v Michael Kennedy>One of the challenges with things like Claude Code and friends

00:12:19.380 --> 00:12:20.500
<v Michael Kennedy>is you're just in the terminal.

00:12:20.660 --> 00:12:24.360
<v Michael Kennedy>And so can you use the mouse to select part of your text

00:12:24.480 --> 00:12:25.000
<v Michael Kennedy>and cut it?

00:12:25.960 --> 00:12:27.360
<v Michael Kennedy>No, it's the terminal, right?

00:12:28.500 --> 00:12:30.620
<v Michael Kennedy>And the arrow keys work right and all those kinds of things.

00:12:31.070 --> 00:12:35.980
<v Michael Kennedy>So it has a really nice, I'll just put this little video in the background while it's

00:12:36.100 --> 00:12:36.460
<v Michael Kennedy>going here.

00:12:36.740 --> 00:12:39.420
<v Michael Kennedy>I can get it to play and it doesn't want to play.

00:12:39.680 --> 00:12:45.640
<v Michael Kennedy>Well, it has a really nice input for that kind of behavior, right?

00:12:45.880 --> 00:12:49.020
<v Michael Kennedy>Has a nice little web server that runs.

00:12:49.900 --> 00:12:51.140
<v Michael Kennedy>Let's see, a few more.

00:12:51.500 --> 00:12:53.000
<v Michael Kennedy>It uses fuzzy search.

00:12:53.240 --> 00:12:56.160
<v Michael Kennedy>So something you do all the time or should do all the time.

00:12:56.260 --> 00:12:57.940
<v Michael Kennedy>And if you're not, you're totally missing out.

00:12:58.540 --> 00:13:03.540
<v Michael Kennedy>adding files a specific context to what you're working on.

00:13:03.560 --> 00:13:07.520
<v Michael Kennedy>So you might say, hey, I'd like to work on the login page.

00:13:07.920 --> 00:13:10.460
<v Michael Kennedy>And here are the notes that I, you know, use the notes that I took.

00:13:10.900 --> 00:13:12.060
<v Michael Kennedy>How well is it going to work?

00:13:12.160 --> 00:13:12.600
<v Michael Kennedy>We don't know.

00:13:12.640 --> 00:13:16.580
<v Michael Kennedy>You could say, I'd like to work on at login.html.

00:13:16.960 --> 00:13:22.280
<v Michael Kennedy>And please see at login requirements.md, right?

00:13:22.440 --> 00:13:25.420
<v Michael Kennedy>And that will actually pop up a select.

00:13:26.040 --> 00:13:30.800
<v Michael Kennedy>And so this uses really nice fuzzy search and UI dropdowns in the terminal.

00:13:31.240 --> 00:13:32.380
<v Michael Kennedy>It says better prompt input.

00:13:33.000 --> 00:13:37.020
<v Michael Kennedy>It has support for terminals within terminals.

00:13:37.220 --> 00:13:41.260
<v Michael Kennedy>So if you ask it to run a command that is like complex terminal output,

00:13:41.700 --> 00:13:43.600
<v Michael Kennedy>it will actually embed that, which is really sweet.

00:13:43.920 --> 00:13:45.480
<v Michael Kennedy>So people should give this a look.

00:13:45.740 --> 00:13:46.940
<v Michael Kennedy>I think it's pretty nice.

00:13:47.500 --> 00:13:49.120
<v Michael Kennedy>You know, pip install, I believe.

00:13:49.560 --> 00:13:50.420
<v Michael Kennedy>I'm going to check it out.

00:13:50.720 --> 00:13:51.200
<v Michael Kennedy>No, curl.

00:13:51.660 --> 00:13:52.440
<v Michael Kennedy>Curl install it.

00:13:52.760 --> 00:13:53.020
<v Michael Kennedy>Get it.

00:13:53.240 --> 00:13:54.080
<v Michael Kennedy>That's the new way, right?

00:13:54.360 --> 00:13:55.380
<v Michael Kennedy>UV is showing us the way.

00:13:55.500 --> 00:13:57.640
<v Michael Kennedy>But you can also uv tool install it if you prefer.

00:13:58.140 --> 00:14:05.600
<v Michael Kennedy>And that's probably the way I would install it because I already have scripts that basically manage all of my uv tools, check for updates and so on.

00:14:05.920 --> 00:14:11.100
<v Michael Kennedy>So check out Toad if you're doing like CLI cloud code like things.

00:14:11.560 --> 00:14:12.260
<v Brian Okken>Yeah, cool.

00:14:12.960 --> 00:14:13.060
<v Brian Okken>Yeah.

00:14:14.480 --> 00:14:14.960
<v Brian Okken>Batrachain.

00:14:15.460 --> 00:14:15.940
<v Brian Okken>Batrachain.

00:14:16.120 --> 00:14:16.740
<v Brian Okken>I don't know.

00:14:16.820 --> 00:14:22.760
<v Brian Okken>The girl is pulling it from a URL called B-A-T-R-A-C-H-I-A-N.

00:14:23.300 --> 00:14:23.420
<v Michael Kennedy>Yeah.

00:14:24.300 --> 00:14:24.680
<v Brian Okken>That's.

00:14:25.340 --> 00:14:26.040
<v Brian Okken>Is that him?

00:14:26.140 --> 00:14:26.680
<v Brian Okken>That's where he's got it.

00:14:26.880 --> 00:14:27.480
<v Brian Okken>Yeah, that's him.

00:14:27.560 --> 00:14:28.100
<v Michael Kennedy>Nice.

00:14:28.560 --> 00:14:28.640
<v Michael Kennedy>Cool.

00:14:29.660 --> 00:14:32.200
<v Michael Kennedy>You've even got your animated Zoom.

00:14:32.680 --> 00:14:32.940
<v Michael Kennedy>Oh, yeah.

00:14:33.000 --> 00:14:34.580
<v Michael Kennedy>It's got the codex as well.

00:14:34.720 --> 00:14:35.000
<v Michael Kennedy>I'm going to stroll.

00:14:35.400 --> 00:14:36.500
<v Michael Kennedy>Unified experience for your terminal.

00:14:36.520 --> 00:14:36.840
<v Michael Kennedy>Nice.

00:14:37.220 --> 00:14:37.340
<v Michael Kennedy>Nice.

00:14:37.360 --> 00:14:43.140
<v Michael Kennedy>Yeah, so this is, I don't know how this relates back to Toads, but it must in ways that I don't

00:14:43.200 --> 00:14:43.280
<v Michael Kennedy>know.

00:14:43.740 --> 00:14:44.000
<v Brian Okken>Well done.

00:14:44.200 --> 00:14:45.160
<v Brian Okken>Well done, Will.

00:14:46.780 --> 00:14:47.640
<v Brian Okken>It was the inkblot.

00:14:47.800 --> 00:14:48.400
<v Brian Okken>What do you see here?

00:14:48.540 --> 00:14:49.140
<v Brian Okken>I see a Toad.

00:14:49.920 --> 00:14:50.160
<v Brian Okken>Exactly.

00:14:50.980 --> 00:14:55.540
<v Brian Okken>Well, I want to talk about something that sort of AI related as well.

00:14:56.060 --> 00:15:01.280
<v Brian Okken>So FastAPI just made, I'm linking to a merge request,

00:15:01.680 --> 00:15:04.320
<v Brian Okken>and we'll link to the actual page too.

00:15:04.780 --> 00:15:08.540
<v Brian Okken>But in the contributing to FastAPI page,

00:15:09.160 --> 00:15:12.940
<v Brian Okken>there was a new change to talk about contribution instructions

00:15:13.260 --> 00:15:18.500
<v Brian Okken>about LLM generated code and comments and automated tools for PRs.

00:15:18.840 --> 00:15:33.100
<v Brian Okken>So I'm guessing that all FastAPI at least, but probably all very popular projects are having a problem with people doing PRs that they really haven't spent that much time on the PR, but they want to get their name in or something.

00:15:33.220 --> 00:15:33.600
<v Brian Okken>I don't know.

00:15:35.040 --> 00:15:37.900
<v Brian Okken>But there's some really good highlight here.

00:15:37.960 --> 00:15:49.460
<v Brian Okken>And it's not, so I'm bringing this up not just because of FastAPI is awesome, and it is, but it's just sort of an interesting thing that we're having these sort of discussions.

00:15:49.960 --> 00:15:57.300
<v Brian Okken>And this is a nice, concise verbiage if you want to add some of this pros to your own project to say what is allowed and what's not.

00:15:58.339 --> 00:16:05.900
<v Brian Okken>And it's, so we'll link to the contributing guideline, developing, contributing, and there's an automated code and AI section.

00:16:06.980 --> 00:16:19.940
<v Brian Okken>And the gist is you're encouraged to use AI tools to do things, you know, whatever tools you have at hand to do things efficiently, but also know that there is human effort on the other end for the pull request.

00:16:20.680 --> 00:16:28.440
<v Brian Okken>And they just basically want to make sure that you're not doing less effort than they have to do to just check it.

00:16:28.640 --> 00:16:31.080
<v Brian Okken>So please put a person in the middle.

00:16:31.580 --> 00:16:40.420
<v Brian Okken>So there's things like they will automatically, they will close things that look like automated pull requests from bots and whatever.

00:16:41.780 --> 00:16:46.880
<v Brian Okken>And there is a, there's, they have a section on human effort denial of service.

00:16:47.260 --> 00:16:58.220
<v Brian Okken>You know, using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be an equivalent of a denial of service attack on our human effort.

00:16:58.720 --> 00:17:04.120
<v Brian Okken>be very little effort for a person submitting the pr that generates a large amount of effort on our

00:17:04.280 --> 00:17:10.540
<v Brian Okken>side please don't do that um so i think this is uh completely fair and it said uh we will block

00:17:10.839 --> 00:17:17.660
<v Brian Okken>accounts that spam us with repeated automated prs or comments use tools wisely and a nice um nice

00:17:17.939 --> 00:17:24.879
<v Brian Okken>i think what is this spider-man comment come quote uh with great power i mean tools comes great

00:17:24.900 --> 00:17:32.220
<v Brian Okken>responsibility. So I just think this was good on their part to throw this in of, yes, use tools,

00:17:32.520 --> 00:17:36.160
<v Brian Okken>but know that there's a human on the other side having to deal with it.

00:17:36.780 --> 00:17:42.400
<v Michael Kennedy>Yeah. Keep it focused, right? Don't submit a 7,000 line PR and say, I made it better.

00:17:44.000 --> 00:17:49.240
<v Michael Kennedy>There was probably some small little part that need changed and stay on target, right?

00:17:49.700 --> 00:17:54.860
<v Brian Okken>Yeah. Now that you bring that up, it is very easy now to say, oh, I want to refactor

00:17:54.880 --> 00:17:59.420
<v Brian Okken>this function to be a new, like even with, without AI, I want to refactor this function to be a new,

00:17:59.590 --> 00:18:05.040
<v Brian Okken>a new function name. And it's going to change tons of code. That's still okay to do if it's focused,

00:18:05.180 --> 00:18:10.260
<v Brian Okken>even if it hits like hundreds of files, if it's just that one thing, like separate those up so

00:18:10.400 --> 00:18:14.760
<v Brian Okken>that, so that code reviewers can go, oh yeah, you just changed that function name. That's fine. But

00:18:14.760 --> 00:18:20.300
<v Brian Okken>if you do that plus, oh, plus I, you know, formatted with black and plus I like, you know,

00:18:20.440 --> 00:18:21.840
<v Brian Okken>optimize this one function.

00:18:22.260 --> 00:18:23.600
<v Brian Okken>It's terrible to combine those together.

00:18:23.900 --> 00:18:24.840
<v Michael Kennedy>And, you know, let's see.

00:18:24.900 --> 00:18:29.040
<v Michael Kennedy>And AI, it's very common for it to just churn through that kind of stuff

00:18:29.300 --> 00:18:30.320
<v Michael Kennedy>and generate a bunch of changes.

00:18:30.760 --> 00:18:36.040
<v Michael Kennedy>The curl team actually has blocked all AI contributions, period, for the same reason.

00:18:36.340 --> 00:18:37.340
<v Michael Kennedy>It's like, this is out of control.

00:18:37.400 --> 00:18:37.980
<v Michael Kennedy>We're not doing it.

00:18:38.140 --> 00:18:41.740
<v Brian Okken>I got a weird request for a private repository.

00:18:43.700 --> 00:18:50.400
<v Brian Okken>When I was starting the pytest course, I kicked around the idea of having a GitHub group

00:18:50.420 --> 00:18:57.100
<v Brian Okken>whatever like whatever those are uh organization for testing code um i decided not to but it's that

00:18:57.280 --> 00:19:02.100
<v Brian Okken>or that or that like organization still has some of the private code i used for the course

00:19:02.520 --> 00:19:08.520
<v Brian Okken>and i had somebody request me to give it clod access to my private notes no i'm not gonna do

00:19:08.700 --> 00:19:14.100
<v Michael Kennedy>that um no but anyway i'll share one really quick weird clod plus github thing while we're on the

00:19:14.200 --> 00:19:19.240
<v Michael Kennedy>topic then we'll move on um i am working on this project that i was doing something with clod code

00:19:19.260 --> 00:19:24.520
<v Michael Kennedy>on this feature. And I created a GitHub issue with a lot of notes for myself about it on GitHub,

00:19:24.860 --> 00:19:29.000
<v Michael Kennedy>but I didn't connect Claude code to it or anything. And then I was like, hey, Claude,

00:19:29.100 --> 00:19:32.760
<v Michael Kennedy>let's just brainstorm about what it would look like in this code base to add this feature.

00:19:32.980 --> 00:19:38.360
<v Michael Kennedy>And it takes a second that goes, I see that you've considered this, this, and this. And now that now

00:19:38.480 --> 00:19:43.840
<v Michael Kennedy>that I've got that background, I think this I'm like, how do you know that? What it had done is I

00:19:43.800 --> 00:19:47.480
<v Michael Kennedy>I had the GitHub, the GH CLI installed on my computer.

00:19:47.590 --> 00:19:50.460
<v Michael Kennedy>And so it used GH to go explore the GitHub repository

00:19:50.740 --> 00:19:51.680
<v Michael Kennedy>and find the issue.

00:19:52.160 --> 00:19:54.220
<v Michael Kennedy>Issue 1,274 or something.

00:19:54.780 --> 00:19:57.220
<v Michael Kennedy>Yeah, issue 1,274 said you wanted to do it this way.

00:19:57.220 --> 00:20:00.900
<v Michael Kennedy>I'm like, okay, that is insane that it just got in there

00:20:00.900 --> 00:20:02.340
<v Michael Kennedy>and I didn't ask it to, you know what I mean?

00:20:03.220 --> 00:20:03.660
<v Michael Kennedy>Yeah, anyway.

00:20:04.660 --> 00:20:06.420
<v Michael Kennedy>Do I want GH on my computer?

00:20:08.500 --> 00:20:09.940
<v Michael Kennedy>I'm like, how did it figure that out?

00:20:09.990 --> 00:20:12.220
<v Michael Kennedy>It shouldn't have access to that information, but it's okay.

00:20:12.620 --> 00:20:13.540
<v Michael Kennedy>How about we move on?

00:20:13.800 --> 00:20:14.400
<v Michael Kennedy>Extra time.

00:20:14.920 --> 00:20:15.020
<v Michael Kennedy>Yeah.

00:20:15.760 --> 00:20:16.260
<v Michael Kennedy>Do you have any extras?

00:20:16.700 --> 00:20:17.000
<v Michael Kennedy>Yeah, sure.

00:20:17.020 --> 00:20:19.720
<v Michael Kennedy>I got a couple, and then we can flip over to you.

00:20:20.020 --> 00:20:27.620
<v Michael Kennedy>So first of all, remember, Henry Schreiner pointed out that you can use compiled bytecode as a flag to uv.

00:20:28.160 --> 00:20:37.440
<v Michael Kennedy>And it points out in the uv docs here that uv does not compile PY files to bytecode in the Dunder PyCache startup PYC file.

00:20:37.580 --> 00:20:40.800
<v Michael Kennedy>Instead, that is lazily done at module import.

00:20:41.420 --> 00:20:49.060
<v Michael Kennedy>And that really got my attention because all of the Docker deployments that we do, for example, Python Bytes runs on Docker.

00:20:49.370 --> 00:20:52.600
<v Michael Kennedy>So when I deploy a new version of Python Bytes.fm, what happens?

00:20:52.850 --> 00:20:59.800
<v Michael Kennedy>It compiles the code, installs the dependencies with uv, and then it starts, you know, there's other stuff, but effectively,

00:21:00.070 --> 00:21:05.740
<v Michael Kennedy>then it just starts Granian running Python Bytes, right, as a core to app.

00:21:06.000 --> 00:21:12.400
<v Michael Kennedy>And from the time that it actually starts starting until it's all the way started, like the website is unavailable, right?

00:21:12.820 --> 00:21:12.900
<v Michael Kennedy>Yeah.

00:21:13.040 --> 00:21:15.400
<v Michael Kennedy>Because it's not some super complicated Kubernetes thing.

00:21:15.400 --> 00:21:16.840
<v Michael Kennedy>It just restarts the Docker container.

00:21:17.400 --> 00:21:25.320
<v Michael Kennedy>And for me, for the extra simplicity of like having one to two seconds of downtime per couple times a week is totally fine.

00:21:25.560 --> 00:21:42.120
<v Michael Kennedy>But what I realized when Henry said that, and you talked about uv not compiling these things, that that actually means it's got to every time I start the Docker container, literally every time it has to compile the PYC files for every library that it uses.

00:21:42.270 --> 00:21:44.100
<v Michael Kennedy>And it uses like well over 50.

00:21:44.260 --> 00:21:46.300
<v Michael Kennedy>There's a lot of libraries for these web apps, right?

00:21:46.640 --> 00:21:46.720
<v Michael Kennedy>Yeah.

00:21:46.860 --> 00:21:47.440
<v Michael Kennedy>And I'm like, wow.

00:21:47.590 --> 00:21:47.740
<v Michael Kennedy>Okay.

00:21:47.810 --> 00:21:53.280
<v Michael Kennedy>So there's no scenario where it will ever not have to generate those on AppStart, right?

00:21:53.400 --> 00:21:55.400
<v Michael Kennedy>because I don't ever shut down the Docker container

00:21:55.440 --> 00:21:56.100
<v Michael Kennedy>and start it again.

00:21:56.160 --> 00:21:56.860
<v Michael Kennedy>The only time,

00:21:57.080 --> 00:21:59.500
<v Michael Kennedy>the only reason the Docker container will ever shut down

00:21:59.900 --> 00:22:03.700
<v Michael Kennedy>is because it needs a new version of code or dependencies.

00:22:04.240 --> 00:22:07.040
<v Michael Kennedy>So it rebuilds the container from scratch using layers

00:22:07.660 --> 00:22:09.460
<v Michael Kennedy>and then it will bring that back up.

00:22:09.740 --> 00:22:13.460
<v Michael Kennedy>So I added --compile dash bytecode

00:22:13.840 --> 00:22:16.580
<v Michael Kennedy>to all of the uv installs

00:22:16.920 --> 00:22:20.080
<v Michael Kennedy>because I don't care if the build time is one second slower,

00:22:20.480 --> 00:22:22.360
<v Michael Kennedy>if that means the actual launch time,

00:22:22.600 --> 00:22:24.980
<v Michael Kennedy>which involves downtime, is one second faster.

00:22:25.400 --> 00:22:30.080
<v Brian Okken>Okay, so does this pre-compile thing happen

00:22:30.480 --> 00:22:32.880
<v Brian Okken>then at the time you're building the Docker image?

00:22:33.300 --> 00:22:36.540
<v Michael Kennedy>Yes, which has nothing to do with the uptime or anything.

00:22:37.400 --> 00:22:39.380
<v Michael Kennedy>It's not until you say restart the Docker container

00:22:39.500 --> 00:22:42.020
<v Michael Kennedy>with the new image that it actually shuts down the old one

00:22:42.020 --> 00:22:42.660
<v Michael Kennedy>and starts the new one.

00:22:42.920 --> 00:22:45.020
<v Michael Kennedy>So I make the build time one second slower,

00:22:45.200 --> 00:22:47.860
<v Michael Kennedy>but the launch time one second faster, which is awesome.

00:22:48.180 --> 00:22:49.340
<v Brian Okken>And it probably makes, like, what,

00:22:50.220 --> 00:22:51.780
<v Brian Okken>the Docker image a little bit bigger?

00:22:52.320 --> 00:22:57.080
<v Michael Kennedy>probably yeah yeah yeah probably but it would have you know i guess it does make the image a little

00:22:57.280 --> 00:23:02.620
<v Michael Kennedy>bit bigger but i'm not shipping it to docker hub and back so i don't really care yeah just i mean

00:23:02.820 --> 00:23:08.240
<v Brian Okken>even if you were it's that it's that yeah one second faster to do the flip over it's great that's

00:23:08.320 --> 00:23:13.740
<v Michael Kennedy>i think it's and all it is just include --compile dash bytecode on your uv and stuff

00:23:14.280 --> 00:23:19.619
<v Michael Kennedy>yeah sweet so thanks everyone you and henry and whoever else okay two things real quick i talked

00:23:19.640 --> 00:23:25.360
<v Michael Kennedy>about the MCP server for Talk Python and how that works, but I did a nice little write-up about it

00:23:25.540 --> 00:23:30.300
<v Michael Kennedy>over on the Talk Python blog. So I just want to point people to that proper write-up, which has

00:23:30.480 --> 00:23:37.700
<v Michael Kennedy>some background on the MCP server and the LLMs,.txt information there. And another thing, Brian,

00:23:37.900 --> 00:23:43.779
<v Michael Kennedy>people sent me a message and said, so let me get this right. You just recounted the story of

00:23:43.940 --> 00:23:52.500
<v Michael Kennedy>tailwind CSS getting destroyed by AI and then you purposefully added AI stuff to talk Python? Are

00:23:52.500 --> 00:23:59.920
<v Michael Kennedy>you insane? Well, okay, maybe, but I don't think so. So I also wrote a blog post on my personal blog

00:24:00.100 --> 00:24:06.960
<v Michael Kennedy>about why I think, you know, hiding from AI, blocking AI crawlers is probably not going to

00:24:07.050 --> 00:24:12.040
<v Michael Kennedy>serve you in the long term and why that I added these things. So sort of gave my background on

00:24:12.020 --> 00:24:13.620
<v Michael Kennedy>why I thought that was worth doing.

00:24:13.790 --> 00:24:14.680
<v Michael Kennedy>So people are like,

00:24:14.960 --> 00:24:16.540
<v Michael Kennedy>like Michael's kind of got

00:24:17.600 --> 00:24:18.680
<v Michael Kennedy>two contradicting thoughts

00:24:18.750 --> 00:24:20.000
<v Michael Kennedy>in his mind at the same time.

00:24:20.410 --> 00:24:20.960
<v Michael Kennedy>Well, I don't think

00:24:21.100 --> 00:24:22.100
<v Brian Okken>it's contradictory though.

00:24:22.330 --> 00:24:23.260
<v Brian Okken>I think it would be,

00:24:23.520 --> 00:24:24.700
<v Brian Okken>it would be like you,

00:24:25.800 --> 00:24:27.940
<v Brian Okken>you know, doing AI,

00:24:28.240 --> 00:24:29.940
<v Brian Okken>having an AI generated thing

00:24:30.660 --> 00:24:32.060
<v Brian Okken>on all of the content

00:24:32.360 --> 00:24:33.860
<v Brian Okken>of Talk Python training.

00:24:34.780 --> 00:24:34.920
<v Brian Okken>Yeah.

00:24:35.360 --> 00:24:36.120
<v Brian Okken>And you weren't,

00:24:36.170 --> 00:24:36.940
<v Brian Okken>you wouldn't do that

00:24:37.030 --> 00:24:37.440
<v Brian Okken>because that's,

00:24:37.640 --> 00:24:38.860
<v Brian Okken>that's what you make money off of.

00:24:39.080 --> 00:24:39.220
<v Brian Okken>So.

00:24:39.400 --> 00:24:39.920
<v Brian Okken>Exactly.

00:24:40.560 --> 00:24:41.060
<v Michael Kennedy>This stuff is,

00:24:41.960 --> 00:24:44.720
<v Michael Kennedy>basically I'm saying if you have content you would like in Google,

00:24:45.240 --> 00:24:48.760
<v Michael Kennedy>you probably want it in AI indexes as well.

00:24:49.220 --> 00:24:51.560
<v Michael Kennedy>If it's something you don't want publicly available on Google,

00:24:51.660 --> 00:24:53.980
<v Michael Kennedy>then you probably don't want it here as well, right?

00:24:54.160 --> 00:24:57.560
<v Michael Kennedy>But this is like assuming you want to show up in search results

00:24:57.720 --> 00:25:00.400
<v Michael Kennedy>for regular search engines, you probably do with these.

00:25:00.760 --> 00:25:02.180
<v Michael Kennedy>And also just really quick while we're on it,

00:25:02.480 --> 00:25:07.560
<v Michael Kennedy>like putting in the MCP sort of stuff here means it turns questions like,

00:25:07.820 --> 00:25:08.980
<v Michael Kennedy>hey, what guests were on the show?

00:25:09.060 --> 00:25:10.220
<v Michael Kennedy>Or what was this episode about?

00:25:10.380 --> 00:25:13.700
<v Michael Kennedy>or maybe I could find the transcripts for a page or whatever.

00:25:13.820 --> 00:25:17.880
<v Michael Kennedy>It turns that from scraping my website and hitting tons of code

00:25:18.260 --> 00:25:23.060
<v Michael Kennedy>to database index single queries for a small fragment of text.

00:25:23.580 --> 00:25:25.600
<v Michael Kennedy>So if the AI is going to ask questions anyway,

00:25:26.160 --> 00:25:29.680
<v Michael Kennedy>this is way less harm on my server, if you will.

00:25:30.040 --> 00:25:32.880
<v Brian Okken>Well, hopefully they do that instead of doing both, though.

00:25:33.740 --> 00:25:34.140
<v Michael Kennedy>Yeah, I know.

00:25:34.900 --> 00:25:38.540
<v Brian Okken>The other thing is, so is this a process now?

00:25:38.700 --> 00:25:40.980
<v Brian Okken>Do you have to keep this updated on a weekly basis or?

00:25:41.340 --> 00:25:43.020
<v Michael Kennedy>No, it's all just driven by the database.

00:25:43.540 --> 00:25:43.740
<v Brian Okken>Okay.

00:25:44.000 --> 00:25:44.520
<v Michael Kennedy>So, yeah.

00:25:44.740 --> 00:25:47.760
<v Michael Kennedy>And if you look at the, the, my personal post version,

00:25:47.950 --> 00:25:53.800
<v Michael Kennedy>you can actually see some pictures of like how Claude.ai, the chatbot is using.

00:25:53.860 --> 00:25:55.920
<v Michael Kennedy>So I'll ask it like, what are the last five episodes?

00:25:56.140 --> 00:26:00.240
<v Michael Kennedy>You can see it's actually calling the API endpoint, getting recent episodes.

00:26:00.730 --> 00:26:03.080
<v Michael Kennedy>And then, or if you ask it more, it'll like search.

00:26:03.250 --> 00:26:06.540
<v Michael Kennedy>And then based on the search results, it'll get the details and so on.

00:26:06.820 --> 00:26:07.000
<v Brian Okken>Yeah.

00:26:07.460 --> 00:26:10.840
<v Brian Okken>One of my next projects is to, or in the near future,

00:26:11.040 --> 00:26:13.640
<v Brian Okken>is to try to build one of these for internal stuff

00:26:13.810 --> 00:26:16.100
<v Brian Okken>so the internal tools can see internal APIs.

00:26:16.920 --> 00:26:20.000
<v Michael Kennedy>Yeah, it's very neat, and it's not that hard.

00:26:20.060 --> 00:26:24.520
<v Michael Kennedy>Also, you don't need a whole framework like Fast MCP

00:26:24.610 --> 00:26:25.740
<v Michael Kennedy>or one of these things.

00:26:25.900 --> 00:26:28.520
<v Michael Kennedy>It's just a couple of simple web requests.

00:26:29.540 --> 00:26:32.640
<v Michael Kennedy>It's not like implementing your own web sockets or something.

00:26:32.840 --> 00:26:34.360
<v Michael Kennedy>You can just add it to any website.

00:26:34.580 --> 00:26:34.940
<v Michael Kennedy>It's super easy.

00:26:35.000 --> 00:26:35.660
<v Michael Kennedy>Cool. All right.

00:26:37.340 --> 00:26:44.660
<v Brian Okken>any other extras nope over to you okay um i let's see what do i got i got a few um do you remember

00:26:44.760 --> 00:26:53.980
<v Brian Okken>dig i do dig is back um which uh and i'm linking to a tech crunch article and i um there's a bunch

00:26:53.980 --> 00:27:01.320
<v Brian Okken>of articles on it but um it just uh it's i did a quick skim basically they're trying to trying to

00:27:01.280 --> 00:27:08.820
<v Brian Okken>trying to be what dig used to be but not not sucky um and also um uh some interesting people

00:27:09.040 --> 00:27:14.880
<v Brian Okken>kevin rose from um and uh and one of the co-founders from from reddit are putting it together um

00:27:15.700 --> 00:27:22.040
<v Brian Okken>interesting and uh yeah anyway i i'm i'll be interested to watch to see if it becomes a uh

00:27:22.540 --> 00:27:28.240
<v Brian Okken>something that we should care about but um anyway interesting article um also uh there's a python

00:27:28.220 --> 00:27:33.920
<v Brian Okken>community in there just started there's 99 members it's 99 members of python in the world

00:27:34.190 --> 00:27:40.040
<v Brian Okken>um no there's more but in the on the dig community and uh um is put together by somebody that meant

00:27:40.220 --> 00:27:46.180
<v Brian Okken>that actually the same person that sent it to us and said hey so this wigging wigging person uh

00:27:46.440 --> 00:27:51.479
<v Brian Okken>sent it to us which is great and also talked about us python bites podcast yay so yeah thank you

00:27:52.220 --> 00:28:05.260
<v Brian Okken>Another interesting article I ran across was from, I think, I'm sorry, Marieke, why lightweight websites may one day save your life, but basically just owed to lightweight websites.

00:28:06.020 --> 00:28:17.620
<v Brian Okken>And this is a lot to do with if the intent is for people to be able to use your website, even if they're on a cell phone, even if they have like a bad connection, then lightweight websites are a must.

00:28:17.980 --> 00:28:19.180
<v Brian Okken>That's just basically it.

00:28:20.040 --> 00:28:21.220
<v Brian Okken>Think about your target audience.

00:28:21.740 --> 00:28:24.880
<v Brian Okken>If your target audience is on the move, make it light and fast.

00:28:25.480 --> 00:28:25.640
<v Brian Okken>Obvious.

00:28:26.860 --> 00:28:33.020
<v Brian Okken>Last shout out to Wiz to a article called

00:28:33.140 --> 00:28:36.800
<v Brian Okken>How to Parameterize Exception Testing in pytest.

00:28:37.480 --> 00:28:43.320
<v Brian Okken>And I'm glad people are still writing articles about pytest.

00:28:43.660 --> 00:28:48.760
<v Brian Okken>And I'm going to let it slide that he did the capitalization wrong.

00:28:49.040 --> 00:28:50.180
<v Brian Okken>No capitals in pytest.

00:28:50.840 --> 00:28:51.040
<v Brian Okken>Anyway.

00:28:51.050 --> 00:28:51.320
<v Brian Okken>It's fine.

00:28:51.380 --> 00:28:52.060
<v Michael Kennedy>You can fix it.

00:28:52.220 --> 00:28:54.640
<v Michael Kennedy>If you just right-click on that and say inspect, you can fix this website.

00:28:54.940 --> 00:28:56.740
<v Michael Kennedy>You didn't know if you could edit other people's sites, but.

00:28:56.840 --> 00:28:57.640
<v Michael Kennedy>You just pay.

00:28:58.640 --> 00:28:58.860
<v Michael Kennedy>Really?

00:28:58.860 --> 00:28:59.580
<v Michael Kennedy>It doesn't last right now.

00:28:59.940 --> 00:29:02.580
<v Michael Kennedy>Well, for you, but then if you reload or anyone else, it doesn't change.

00:29:03.640 --> 00:29:10.040
<v Brian Okken>The trick here, which is cool, is he's parameterizing whether or not something raises an exception.

00:29:10.520 --> 00:29:19.440
<v Brian Okken>And he's using a thing from context lib called null context and importing it and changing its name to does not raise.

00:29:19.660 --> 00:29:26.420
<v Brian Okken>And this is brilliant because this is very clear code to say, yeah, these cases, that shouldn't raise an exception.

00:29:27.070 --> 00:29:30.800
<v Brian Okken>Other cases should be a zero division error or a type error or whatever.

00:29:31.680 --> 00:29:34.940
<v Brian Okken>Obviously, you're not going to write a test for test division exceptions.

00:29:35.620 --> 00:29:39.460
<v Brian Okken>But to test your own code to make sure that it's raising the right exceptions.

00:29:39.640 --> 00:29:39.840
<v Brian Okken>Yeah.

00:29:40.260 --> 00:29:43.040
<v Brian Okken>And throwing in a couple of cases for when it doesn't raise this,

00:29:43.280 --> 00:29:43.960
<v Brian Okken>this is good,

00:29:44.080 --> 00:29:45.660
<v Brian Okken>clean code and short article.

00:29:45.880 --> 00:29:46.320
<v Brian Okken>So I like it.

00:29:46.860 --> 00:29:47.760
<v Brian Okken>It's a very clean code.

00:29:47.940 --> 00:29:49.040
<v Michael Kennedy>I would have not seen that coming.

00:29:49.380 --> 00:29:49.920
<v Michael Kennedy>That's pretty good.

00:29:50.320 --> 00:29:50.460
<v Michael Kennedy>Yeah.

00:29:50.600 --> 00:29:50.900
<v Michael Kennedy>It's very,

00:29:50.980 --> 00:29:51.240
<v Michael Kennedy>very good.

00:29:52.160 --> 00:29:52.260
<v Michael Kennedy>Well,

00:29:52.940 --> 00:29:53.360
<v Brian Okken>that's it.

00:29:53.660 --> 00:29:54.420
<v Brian Okken>Do we have something funny?

00:29:54.860 --> 00:29:56.820
<v Michael Kennedy>This last thing here,

00:29:57.240 --> 00:30:00.540
<v Michael Kennedy>this joke is really here basically for you,

00:30:00.580 --> 00:30:00.800
<v Michael Kennedy>Brian.

00:30:01.220 --> 00:30:02.640
<v Michael Kennedy>This was sent in by Pat Decker,

00:30:02.920 --> 00:30:03.240
<v Michael Kennedy>I believe.

00:30:03.620 --> 00:30:04.780
<v Michael Kennedy>And I think it's good.

00:30:04.780 --> 00:30:07.620
<v Michael Kennedy>I think you'll appreciate this coming from a testing perspective.

00:30:07.840 --> 00:30:07.920
<v Michael Kennedy>Okay.

00:30:08.300 --> 00:30:08.520
<v Brian Okken>Okay.

00:30:08.600 --> 00:30:10.340
<v Michael Kennedy>So this was on Reddit.

00:30:10.580 --> 00:30:15.280
<v Michael Kennedy>And the idea here is two developers talking or maybe project manager.

00:30:15.320 --> 00:30:15.760
<v Michael Kennedy>I don't know.

00:30:15.780 --> 00:30:18.500
<v Michael Kennedy>It says, your new date picker widget has crashed.

00:30:18.760 --> 00:30:18.900
<v Michael Kennedy>Really?

00:30:19.180 --> 00:30:19.600
<v Michael Kennedy>That's impossible.

00:30:19.780 --> 00:30:23.500
<v Michael Kennedy>I've tested it with negative numbers, special characters, null.

00:30:23.780 --> 00:30:24.720
<v Michael Kennedy>What have you put in it?

00:30:25.460 --> 00:30:25.880
<v Michael Kennedy>A date?

00:30:27.240 --> 00:30:27.720
<v Michael Kennedy>Yes.

00:30:27.920 --> 00:30:28.100
<v Michael Kennedy>Oops.

00:30:29.360 --> 00:30:30.240
<v Brian Okken>Forgot the base case.

00:30:30.620 --> 00:30:35.560
<v Michael Kennedy>So busy testing all the edge cases and the area conditions that I forgot to see if it even worked.

00:30:35.820 --> 00:30:36.140
<v Brian Okken>Yeah.

00:30:37.140 --> 00:30:37.320
<v Brian Okken>Yeah.

00:30:37.640 --> 00:30:38.680
<v Brian Okken>That's a weird thing.

00:30:38.730 --> 00:30:44.500
<v Brian Okken>I think that there's so many people think that testing is just about the complicated edge cases,

00:30:44.880 --> 00:30:48.980
<v Brian Okken>but you've got to get the happy path first and make sure those work also.

00:30:49.400 --> 00:30:50.260
<v Brian Okken>Yeah, absolutely.

00:30:50.560 --> 00:30:50.900
<v Brian Okken>That's funny.

00:30:51.110 --> 00:30:51.500
<v Brian Okken>Pretty good one.

00:30:53.100 --> 00:30:55.200
<v Brian Okken>You've heard that tester walks into the bar, right?

00:30:55.440 --> 00:30:57.240
<v Brian Okken>I think so, but give me your variant.

00:30:58.880 --> 00:31:08.080
<v Brian Okken>a bad memory but tester walks into a or a text test um tester walks into a bar and uh orders uh

00:31:08.460 --> 00:31:14.880
<v Brian Okken>a half a beer and one and a half beers and a negative beer and um and a million beers to see

00:31:14.880 --> 00:31:20.160
<v Brian Okken>what happens and everything everything works fine um uh i thought that bar caught on fire astro

00:31:20.330 --> 00:31:25.479
<v Brian Okken>actual custer comes into the bar orders one beer and barker bar catches on fire there you go there

00:31:25.500 --> 00:31:33.240
<v Michael Kennedy>you go like that it's beautiful it's a beautiful thing it's a uh it's it's like a fable that tells

00:31:33.440 --> 00:31:39.200
<v Brian Okken>the the moral story of testing yeah and then my dad joke version of course the guy walks into a bar

00:31:39.380 --> 00:31:47.220
<v Brian Okken>and says ow all right it does hurt different kind of bar sorry um spoiled your joke but

00:31:47.820 --> 00:31:51.740
<v Brian Okken>all right um that another fun episode talk to you guys next week bye y'all

