Brian Okken: Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
Brian Okken: This is episode 467, recorded January 26, 2026.
Brian Okken: Ooh, that's a lot of 26s.
Brian Okken: I'm Brian Okken.
Michael Kennedy: I'm Michael Kennedy.
Brian Okken: This episode is sponsored by all of us, all of you, and the products that we have going at Python Bytes,
Brian Okken: and I guess not at Python Bytes, but Talk Python Training, and at pythontest.com,
Brian Okken: We've got the pytest course and LeanTDD, but Michael's got courses and books and all sorts of fun stuff.
Brian Okken: And also, of course, Patreon supporters.
Brian Okken: We still love you.
Brian Okken: And yeah, if you'd like to connect with us and send us topics, maybe topics for the show, we love that.
Brian Okken: You can just send us through the contact form at pythonbytes.fm, but you can also find us on the socials.
Brian Okken: And the links are in the show notes.
Brian Okken: We're on Bluesky and Mastodon.
Brian Okken: Yeah, and if you'd like to see what we look like
Brian Okken: or watch us live or tape recorded,
Brian Okken: you can go to pythonbytes.fm/live
Brian Okken: and yeah, check out that.
Brian Okken: And it tells you when we're going to show next time.
Michael Kennedy: Yeah, they can even check out a glimpse
Michael Kennedy: of the Python staff of power just behind you there.
Brian Okken: Yeah, that's right.
Brian Okken: Yeah, there it is.
Brian Okken: Yeah, and I'm still on the fence
Brian Okken: about going to PyCon this year.
Brian Okken: And if I go to PyCon,
Brian Okken: I'll definitely bring the staff of power.
Michael Kennedy: My fence has been built and decided upon.
Michael Kennedy: I bought my tickets and I got actually a pretty amazing deal on Expedia.
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.
Michael Kennedy: So I'm going.
Brian Okken: Oh, nice.
Brian Okken: Yeah.
Brian Okken: I'm going to try to ask work if I can get away with not having to take vacation time to go.
Michael Kennedy: Yeah, wouldn't that be nice?
Michael Kennedy: Hey, they talk about pytest there.
Michael Kennedy: I know you're doing a lot with that.
Michael Kennedy: Yeah.
Michael Kennedy: So, all right.
Michael Kennedy: Well, should we do some topics for the show?
Michael Kennedy: Let's talk.
Michael Kennedy: Oh, I have the toad up.
Michael Kennedy: That is not what I want to talk about.
Michael Kennedy: I want to talk about this thing called the Gray Noise IP Check.
Michael Kennedy: Okay.
Michael Kennedy: So Gray Noise is a company that does research on cyber security breaches,
Michael Kennedy: et cetera, et cetera, right?
Brian Okken: Yeah.
Michael Kennedy: So they have published this thing called the Gray Noise IP Check.
Michael Kennedy: And if you just go to check.labs.greynoise.io or way simpler, click the link in the show notes.
Michael Kennedy: It will take you to this place that says your IP address is whatever your IP address is.
Michael Kennedy: And your IP address is clean.
Michael Kennedy: Your IP has not been observed scanning the internet or contained in the common business services data set.
Michael Kennedy: So what is this for?
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.
Michael Kennedy: Like my kid is pretty good.
Michael Kennedy: She says, dad, is it okay if I install this?
Michael Kennedy: Yes, it's okay or no.
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.
Michael Kennedy: So, you know, not knocking the kid or anything.
Michael Kennedy: But kids install stuff.
Michael Kennedy: Other people install stuff.
Michael Kennedy: Your TV, your smart power thing that goes to that lamp in the corner.
Michael Kennedy: You know, there's a crap ton of stuff that is on your network.
Michael Kennedy: And even if you run some sort of virus check on your computer,
Michael Kennedy: having that come up empty doesn't mean that there's not a problem
Michael Kennedy: with things that you are in control of, right?
Michael Kennedy: So basically the idea of this thing is you can go here
Michael Kennedy: and it will tell you if something on your network has been being bad.
Michael Kennedy: Okay.
Michael Kennedy: Yeah.
Michael Kennedy: And I don't know, for me, I thought that was pretty cool.
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.
Michael Kennedy: If your IP address just changed recently, it's very plausible that you could get a warning.
Michael Kennedy: And it was whoever had it before.
Michael Kennedy: You know what I mean?
Michael Kennedy: Like we had a power outage for just a couple hours.
Michael Kennedy: Some sort of, I think I talked about this last time because my mic had gotten all reset.
Michael Kennedy: Because everything got powered 100% down because some sort of transformer thing exploded.
Michael Kennedy: We got a new IP address from then.
Michael Kennedy: Right. But, you know, a couple of weeks ago.
Michael Kennedy: And so it turns out that I guess things are still good.
Michael Kennedy: That's good to know.
Michael Kennedy: But if you just had your IP address change,
Michael Kennedy: then it could be picking up issues from whoever had it before.
Michael Kennedy: Right. Kind of like you keep getting spam with that new phone number you got.
Michael Kennedy: Yeah. But these, I don't know about you,
Michael Kennedy: but my IP address is pretty much rock solid stable.
Michael Kennedy: Unless something goes wrong with the internet or with power,
Michael Kennedy: then it may change.
Michael Kennedy: But other than that, it's the same for quite a while.
Brian Okken: I'm slightly embarrassed to say I usually don't know my IP address.
Brian Okken: And I actually don't quite get how, I mean, I get how IP addresses work.
Brian Okken: But like for a house, is your whole house like the same IP address?
Brian Okken: Or I don't know how that works.
Brian Okken: Also, like, does this, can you use this?
Brian Okken: Like if you're at a cafe to check to see if there's other like bad actors there?
Michael Kennedy: Yeah, I guess you probably could actually.
Michael Kennedy: Yeah.
Brian Okken: So, yeah.
Brian Okken: Anyway.
Brian Okken: Interesting.
Michael Kennedy: Okay.
Brian Okken: Well, I'll have to check it out.
Michael Kennedy: And I know more because I have a lot of my stuff gated behind IP addresses, like the server.
Michael Kennedy: You can't even SSH to the server unless your IP address is on a whitelist, right?
Michael Kennedy: So periodically when it changes, I'm like, oh, what is my IP address again?
Michael Kennedy: So then I go copy.
Michael Kennedy: I don't really pay too much attention, but because of that, I kind of got to pay a little attention.
Brian Okken: Yeah, I'm like a very data in the cloud sort of person.
Brian Okken: So I guess.
Brian Okken: Perfect.
Michael Kennedy: All right.
Michael Kennedy: Well, I'm very excited about this next topic that you have because I also saw it and said, that is killer.
Michael Kennedy: It is killer.
Brian Okken: Yeah.
Brian Okken: So what we're talking about is TPROF.
Brian Okken: This is from, or TPROF?
Brian Okken: I think it's TPROF.
Brian Okken: It's the targeting profiler from Adam Johnson.
Brian Okken: And we've got a link to the PyPA site.
Brian Okken: But it just mostly says, yeah, it's a targeting profiler.
Brian Okken: But we're also going to link to his article introducing it.
Brian Okken: introducing tprof a targeting profile profiler so that yeah so it's it almost speaks for itself
Brian Okken: what the what he's talking about is if you run a profiler on your program it gives you everything
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
Brian Okken: are you spending your time and that's what you use profilers for to see where you know where you
Brian Okken: maybe could could optimize some of your some of your code and so but and once you pinpointed what
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
Brian Okken: his pain point was running running it over the whole program again and again and again and you
Brian Okken: don't really need to so his is a targeting profiler and you give it exactly the function that you're
Brian Okken: caring about or the functions multiple and it'll report what the times are like the minute max and
Brian Okken: stuff. And then he went further and said, there's a lot of times where you're just going to want to
Brian Okken: do like a before and after function. And it probably won't be before and after, but you can
Brian Okken: like my search routine old and my search routine new or something like that. And you can have those
Michael Kennedy: be targeted and run the results and compare those. Nice. It's like a showdown, right? Instead of
Michael Kennedy: trying to remember the results, you just say, here's the old way, here's the new way. How'd that
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
Brian Okken: past the functions that you want to want to look at on the command line. So you don't even
Brian Okken: have to actually change anything in your code to do this. You can just, you can just target a couple
Brian Okken: functions and, and call those. And then, but you can also do a dash X for a compare and it'll do
Brian Okken: a delta time, like a percent faster or a percent slower,
Brian Okken: which is pretty cool.
Brian Okken: Or you can not have to do the command line thing too much
Brian Okken: and just do as a context manager.
Brian Okken: You can say which ones you're going to compare
Brian Okken: and run those before and after with tprof.
Brian Okken: All those are, I probably use all of those
Brian Okken: at different times, but I'm really excited to try this
Brian Okken: to use, to optimize some code that I've been working on.
Brian Okken: So it's pretty neat.
Michael Kennedy: Apparently uses the new Python 3.12 profiling API, which is really nice.
Michael Kennedy: So a little using the modern lower touch profiler as well.
Brian Okken: Yeah.
Brian Okken: So of course, you have to run it with 3.12 or above,
Brian Okken: but that doesn't mean that the code that you're testing against
Brian Okken: is necessarily just 3.12 and above.
Brian Okken: It's just when you're running it, it'll be 3.12.
Michael Kennedy: You know what? 3.12 is almost obsolete.
Michael Kennedy: I'm serious.
Michael Kennedy: Like how insane is that?
Michael Kennedy: What?
Michael Kennedy: I mean, 3.10 is the oldest that is even allowed.
Michael Kennedy: Like 3.9 has gone into, like, we don't even do security patches anymore.
Brian Okken: Yeah, yeah, that's true.
Michael Kennedy: 3.10 is on the shadow, and then, like, it's a few years until all that thing's gone.
Michael Kennedy: So it's not that old.
Michael Kennedy: And we don't even mention 2.7 anymore, the legacy.
Michael Kennedy: So good.
Michael Kennedy: So good to be past those days, right?
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.
Michael Kennedy: and then it stops and you're like,
Michael Kennedy: the thing only takes 50 milliseconds,
Michael Kennedy: but I've got profiling for like two seconds.
Michael Kennedy: And what is going on?
Michael Kennedy: It's just so lost in the noise.
Michael Kennedy: And then this one, you can just say, run it,
Michael Kennedy: let all that, just ignore all that junk.
Michael Kennedy: When you get to this function, start,
Michael Kennedy: when you're done with the function, stop.
Michael Kennedy: You know what I mean?
Brian Okken: Yeah, and that's actually, oh,
Brian Okken: that part of it's overwhelming to me.
Brian Okken: Every time I've had to reach, I don't have to,
Brian Okken: you know, it's like a lot of debugging tools.
Brian Okken: You don't have to reach for them all the time.
Brian Okken: But when you do, it's a little overwhelming to look at all that profiling output.
Brian Okken: And I still haven't got my head around flame graphs.
Brian Okken: But, you know.
Brian Okken: Yeah.
Michael Kennedy: Catch them.
Michael Kennedy: They're hot.
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.
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.
Michael Kennedy: But now maybe it really is.
Michael Kennedy: Thanks, Adam.
Michael Kennedy: Yeah, thank you, Adam.
Michael Kennedy: And then one more thing is like a lot of times some things are slower the very, very first
Michael Kennedy: times they run.
Michael Kennedy: So it might be worth writing a function that actually like runs it a bunch of times or
Michael Kennedy: runs it once before you get to it and then profile.
Michael Kennedy: You know what I mean?
Michael Kennedy: Like just like, because it might be the module loading that actually overwhelms the compute,
Michael Kennedy: but that only happens once or, you know, do I see compilation?
Brian Okken: The context manager one would be great for that.
Brian Okken: then you could just, you could call both,
Brian Okken: like both the new and the old function once.
Brian Okken: Exactly.
Brian Okken: And then do a loop and do like a hundred times
Brian Okken: to the other two.
Brian Okken: Yeah, that would be totally perfect.
Brian Okken: That would be really, really good.
Michael Kennedy: You know what we don't talk enough about though, Brian?
Michael Kennedy: Honestly, I mean, toads.
Michael Kennedy: Let's talk about toads.
Brian Okken: I know, and we live in Oregon.
Brian Okken: We got them all over the place.
Brian Okken: We do.
Brian Okken: We do got them all over the place.
Brian Okken: Or frogs at least.
Brian Okken: I don't know if we have toads.
Michael Kennedy: I don't, you know what.
Michael Kennedy: So with Toad, this comes from Will McGuggan.
Michael Kennedy: It's kind of his next big thing that he's been working on
Michael Kennedy: since Textual.
Michael Kennedy: And the idea is it's kind of like a UI for Claude Code type
Michael Kennedy: things.
Michael Kennedy: It actually works with something called OpenHands.
Michael Kennedy: It works with Claude Code.
Michael Kennedy: It works with Gemini CLI, probably others
Michael Kennedy: that I don't know about.
Michael Kennedy: When I first saw this, I'm like, OK, well,
Michael Kennedy: I already have a terminal.
Michael Kennedy: I can do this.
Michael Kennedy: Like, what-- I'm not really entirely sure what I need this
Michael Kennedy: for.
Michael Kennedy: But the more I looked into it, it looks really quite neat.
Michael Kennedy: So if you go through, it obviously renders pictures.
Michael Kennedy: Apparently not there.
Michael Kennedy: It renders pictures.
Michael Kennedy: Like one of the pictures is the Mandelbrot set drawn.
Michael Kennedy: Cool.
Michael Kennedy: And it has really nice, basically better input.
Michael Kennedy: One of the challenges with things like Claude Code and friends
Michael Kennedy: is you're just in the terminal.
Michael Kennedy: And so can you use the mouse to select part of your text
Michael Kennedy: and cut it?
Michael Kennedy: No, it's the terminal, right?
Michael Kennedy: And the arrow keys work right and all those kinds of things.
Michael Kennedy: So it has a really nice, I'll just put this little video in the background while it's
Michael Kennedy: going here.
Michael Kennedy: I can get it to play and it doesn't want to play.
Michael Kennedy: Well, it has a really nice input for that kind of behavior, right?
Michael Kennedy: Has a nice little web server that runs.
Michael Kennedy: Let's see, a few more.
Michael Kennedy: It uses fuzzy search.
Michael Kennedy: So something you do all the time or should do all the time.
Michael Kennedy: And if you're not, you're totally missing out.
Michael Kennedy: adding files a specific context to what you're working on.
Michael Kennedy: So you might say, hey, I'd like to work on the login page.
Michael Kennedy: And here are the notes that I, you know, use the notes that I took.
Michael Kennedy: How well is it going to work?
Michael Kennedy: We don't know.
Michael Kennedy: You could say, I'd like to work on at login.html.
Michael Kennedy: And please see at login requirements.md, right?
Michael Kennedy: And that will actually pop up a select.
Michael Kennedy: And so this uses really nice fuzzy search and UI dropdowns in the terminal.
Michael Kennedy: It says better prompt input.
Michael Kennedy: It has support for terminals within terminals.
Michael Kennedy: So if you ask it to run a command that is like complex terminal output,
Michael Kennedy: it will actually embed that, which is really sweet.
Michael Kennedy: So people should give this a look.
Michael Kennedy: I think it's pretty nice.
Michael Kennedy: You know, pip install, I believe.
Michael Kennedy: I'm going to check it out.
Michael Kennedy: No, curl.
Michael Kennedy: Curl install it.
Michael Kennedy: Get it.
Michael Kennedy: That's the new way, right?
Michael Kennedy: UV is showing us the way.
Michael Kennedy: But you can also uv tool install it if you prefer.
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.
Michael Kennedy: So check out Toad if you're doing like CLI cloud code like things.
Brian Okken: Yeah, cool.
Brian Okken: Yeah.
Brian Okken: Batrachain.
Brian Okken: I don't know.
Brian Okken: The girl is pulling it from a URL called B-A-T-R-A-C-H-I-A-N.
Michael Kennedy: Yeah.
Brian Okken: That's.
Brian Okken: Is that him?
Brian Okken: That's where he's got it.
Brian Okken: Yeah, that's him.
Michael Kennedy: Nice.
Michael Kennedy: Cool.
Michael Kennedy: You've even got your animated Zoom.
Michael Kennedy: Oh, yeah.
Michael Kennedy: It's got the codex as well.
Michael Kennedy: I'm going to stroll.
Michael Kennedy: Unified experience for your terminal.
Michael Kennedy: Nice.
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
Michael Kennedy: know.
Brian Okken: Well done.
Brian Okken: Well done, Will.
Brian Okken: It was the inkblot.
Brian Okken: What do you see here?
Brian Okken: I see a Toad.
Brian Okken: Exactly.
Brian Okken: Well, I want to talk about something that sort of AI related as well.
Brian Okken: So FastAPI just made, I'm linking to a merge request,
Brian Okken: and we'll link to the actual page too.
Brian Okken: But in the contributing to FastAPI page,
Brian Okken: there was a new change to talk about contribution instructions
Brian Okken: about LLM generated code and comments and automated tools for PRs.
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.
Brian Okken: I don't know.
Brian Okken: But there's some really good highlight here.
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.
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.
Brian Okken: And it's, so we'll link to the contributing guideline, developing, contributing, and there's an automated code and AI section.
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.
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.
Brian Okken: So please put a person in the middle.
Brian Okken: So there's things like they will automatically, they will close things that look like automated pull requests from bots and whatever.
Brian Okken: And there is a, there's, they have a section on human effort denial of service.
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.
Brian Okken: be very little effort for a person submitting the pr that generates a large amount of effort on our
Brian Okken: side please don't do that um so i think this is uh completely fair and it said uh we will block
Brian Okken: accounts that spam us with repeated automated prs or comments use tools wisely and a nice um nice
Brian Okken: i think what is this spider-man comment come quote uh with great power i mean tools comes great
Brian Okken: responsibility. So I just think this was good on their part to throw this in of, yes, use tools,
Brian Okken: but know that there's a human on the other side having to deal with it.
Michael Kennedy: Yeah. Keep it focused, right? Don't submit a 7,000 line PR and say, I made it better.
Michael Kennedy: There was probably some small little part that need changed and stay on target, right?
Brian Okken: Yeah. Now that you bring that up, it is very easy now to say, oh, I want to refactor
Brian Okken: this function to be a new, like even with, without AI, I want to refactor this function to be a new,
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,
Brian Okken: even if it hits like hundreds of files, if it's just that one thing, like separate those up so
Brian Okken: that, so that code reviewers can go, oh yeah, you just changed that function name. That's fine. But
Brian Okken: if you do that plus, oh, plus I, you know, formatted with black and plus I like, you know,
Brian Okken: optimize this one function.
Brian Okken: It's terrible to combine those together.
Michael Kennedy: And, you know, let's see.
Michael Kennedy: And AI, it's very common for it to just churn through that kind of stuff
Michael Kennedy: and generate a bunch of changes.
Michael Kennedy: The curl team actually has blocked all AI contributions, period, for the same reason.
Michael Kennedy: It's like, this is out of control.
Michael Kennedy: We're not doing it.
Brian Okken: I got a weird request for a private repository.
Brian Okken: When I was starting the pytest course, I kicked around the idea of having a GitHub group
Brian Okken: whatever like whatever those are uh organization for testing code um i decided not to but it's that
Brian Okken: or that or that like organization still has some of the private code i used for the course
Brian Okken: and i had somebody request me to give it clod access to my private notes no i'm not gonna do
Michael Kennedy: that um no but anyway i'll share one really quick weird clod plus github thing while we're on the
Michael Kennedy: topic then we'll move on um i am working on this project that i was doing something with clod code
Michael Kennedy: on this feature. And I created a GitHub issue with a lot of notes for myself about it on GitHub,
Michael Kennedy: but I didn't connect Claude code to it or anything. And then I was like, hey, Claude,
Michael Kennedy: let's just brainstorm about what it would look like in this code base to add this feature.
Michael Kennedy: And it takes a second that goes, I see that you've considered this, this, and this. And now that now
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
Michael Kennedy: I had the GitHub, the GH CLI installed on my computer.
Michael Kennedy: And so it used GH to go explore the GitHub repository
Michael Kennedy: and find the issue.
Michael Kennedy: Issue 1,274 or something.
Michael Kennedy: Yeah, issue 1,274 said you wanted to do it this way.
Michael Kennedy: I'm like, okay, that is insane that it just got in there
Michael Kennedy: and I didn't ask it to, you know what I mean?
Michael Kennedy: Yeah, anyway.
Michael Kennedy: Do I want GH on my computer?
Michael Kennedy: I'm like, how did it figure that out?
Michael Kennedy: It shouldn't have access to that information, but it's okay.
Michael Kennedy: How about we move on?
Michael Kennedy: Extra time.
Michael Kennedy: Yeah.
Michael Kennedy: Do you have any extras?
Michael Kennedy: Yeah, sure.
Michael Kennedy: I got a couple, and then we can flip over to you.
Michael Kennedy: So first of all, remember, Henry Schreiner pointed out that you can use compiled bytecode as a flag to uv.
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.
Michael Kennedy: Instead, that is lazily done at module import.
Michael Kennedy: And that really got my attention because all of the Docker deployments that we do, for example, Python Bytes runs on Docker.
Michael Kennedy: So when I deploy a new version of Python Bytes.fm, what happens?
Michael Kennedy: It compiles the code, installs the dependencies with uv, and then it starts, you know, there's other stuff, but effectively,
Michael Kennedy: then it just starts Granian running Python Bytes, right, as a core to app.
Michael Kennedy: And from the time that it actually starts starting until it's all the way started, like the website is unavailable, right?
Michael Kennedy: Yeah.
Michael Kennedy: Because it's not some super complicated Kubernetes thing.
Michael Kennedy: It just restarts the Docker container.
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.
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.
Michael Kennedy: And it uses like well over 50.
Michael Kennedy: There's a lot of libraries for these web apps, right?
Michael Kennedy: Yeah.
Michael Kennedy: And I'm like, wow.
Michael Kennedy: Okay.
Michael Kennedy: So there's no scenario where it will ever not have to generate those on AppStart, right?
Michael Kennedy: because I don't ever shut down the Docker container
Michael Kennedy: and start it again.
Michael Kennedy: The only time,
Michael Kennedy: the only reason the Docker container will ever shut down
Michael Kennedy: is because it needs a new version of code or dependencies.
Michael Kennedy: So it rebuilds the container from scratch using layers
Michael Kennedy: and then it will bring that back up.
Michael Kennedy: So I added --compile dash bytecode
Michael Kennedy: to all of the uv installs
Michael Kennedy: because I don't care if the build time is one second slower,
Michael Kennedy: if that means the actual launch time,
Michael Kennedy: which involves downtime, is one second faster.
Brian Okken: Okay, so does this pre-compile thing happen
Brian Okken: then at the time you're building the Docker image?
Michael Kennedy: Yes, which has nothing to do with the uptime or anything.
Michael Kennedy: It's not until you say restart the Docker container
Michael Kennedy: with the new image that it actually shuts down the old one
Michael Kennedy: and starts the new one.
Michael Kennedy: So I make the build time one second slower,
Michael Kennedy: but the launch time one second faster, which is awesome.
Brian Okken: And it probably makes, like, what,
Brian Okken: the Docker image a little bit bigger?
Michael Kennedy: probably yeah yeah yeah probably but it would have you know i guess it does make the image a little
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
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
Michael Kennedy: i think it's and all it is just include --compile dash bytecode on your uv and stuff
Michael Kennedy: yeah sweet so thanks everyone you and henry and whoever else okay two things real quick i talked
Michael Kennedy: about the MCP server for Talk Python and how that works, but I did a nice little write-up about it
Michael Kennedy: over on the Talk Python blog. So I just want to point people to that proper write-up, which has
Michael Kennedy: some background on the MCP server and the LLMs,.txt information there. And another thing, Brian,
Michael Kennedy: people sent me a message and said, so let me get this right. You just recounted the story of
Michael Kennedy: tailwind CSS getting destroyed by AI and then you purposefully added AI stuff to talk Python? Are
Michael Kennedy: you insane? Well, okay, maybe, but I don't think so. So I also wrote a blog post on my personal blog
Michael Kennedy: about why I think, you know, hiding from AI, blocking AI crawlers is probably not going to
Michael Kennedy: serve you in the long term and why that I added these things. So sort of gave my background on
Michael Kennedy: why I thought that was worth doing.
Michael Kennedy: So people are like,
Michael Kennedy: like Michael's kind of got
Michael Kennedy: two contradicting thoughts
Michael Kennedy: in his mind at the same time.
Michael Kennedy: Well, I don't think
Brian Okken: it's contradictory though.
Brian Okken: I think it would be,
Brian Okken: it would be like you,
Brian Okken: you know, doing AI,
Brian Okken: having an AI generated thing
Brian Okken: on all of the content
Brian Okken: of Talk Python training.
Brian Okken: Yeah.
Brian Okken: And you weren't,
Brian Okken: you wouldn't do that
Brian Okken: because that's,
Brian Okken: that's what you make money off of.
Brian Okken: So.
Brian Okken: Exactly.
Michael Kennedy: This stuff is,
Michael Kennedy: basically I'm saying if you have content you would like in Google,
Michael Kennedy: you probably want it in AI indexes as well.
Michael Kennedy: If it's something you don't want publicly available on Google,
Michael Kennedy: then you probably don't want it here as well, right?
Michael Kennedy: But this is like assuming you want to show up in search results
Michael Kennedy: for regular search engines, you probably do with these.
Michael Kennedy: And also just really quick while we're on it,
Michael Kennedy: like putting in the MCP sort of stuff here means it turns questions like,
Michael Kennedy: hey, what guests were on the show?
Michael Kennedy: Or what was this episode about?
Michael Kennedy: or maybe I could find the transcripts for a page or whatever.
Michael Kennedy: It turns that from scraping my website and hitting tons of code
Michael Kennedy: to database index single queries for a small fragment of text.
Michael Kennedy: So if the AI is going to ask questions anyway,
Michael Kennedy: this is way less harm on my server, if you will.
Brian Okken: Well, hopefully they do that instead of doing both, though.
Michael Kennedy: Yeah, I know.
Brian Okken: The other thing is, so is this a process now?
Brian Okken: Do you have to keep this updated on a weekly basis or?
Michael Kennedy: No, it's all just driven by the database.
Brian Okken: Okay.
Michael Kennedy: So, yeah.
Michael Kennedy: And if you look at the, the, my personal post version,
Michael Kennedy: you can actually see some pictures of like how Claude.ai, the chatbot is using.
Michael Kennedy: So I'll ask it like, what are the last five episodes?
Michael Kennedy: You can see it's actually calling the API endpoint, getting recent episodes.
Michael Kennedy: And then, or if you ask it more, it'll like search.
Michael Kennedy: And then based on the search results, it'll get the details and so on.
Brian Okken: Yeah.
Brian Okken: One of my next projects is to, or in the near future,
Brian Okken: is to try to build one of these for internal stuff
Brian Okken: so the internal tools can see internal APIs.
Michael Kennedy: Yeah, it's very neat, and it's not that hard.
Michael Kennedy: Also, you don't need a whole framework like Fast MCP
Michael Kennedy: or one of these things.
Michael Kennedy: It's just a couple of simple web requests.
Michael Kennedy: It's not like implementing your own web sockets or something.
Michael Kennedy: You can just add it to any website.
Michael Kennedy: It's super easy.
Michael Kennedy: Cool. All right.
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
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
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
Brian Okken: trying to be what dig used to be but not not sucky um and also um uh some interesting people
Brian Okken: kevin rose from um and uh and one of the co-founders from from reddit are putting it together um
Brian Okken: interesting and uh yeah anyway i i'm i'll be interested to watch to see if it becomes a uh
Brian Okken: something that we should care about but um anyway interesting article um also uh there's a python
Brian Okken: community in there just started there's 99 members it's 99 members of python in the world
Brian Okken: um no there's more but in the on the dig community and uh um is put together by somebody that meant
Brian Okken: that actually the same person that sent it to us and said hey so this wigging wigging person uh
Brian Okken: sent it to us which is great and also talked about us python bites podcast yay so yeah thank you
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.
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.
Brian Okken: That's just basically it.
Brian Okken: Think about your target audience.
Brian Okken: If your target audience is on the move, make it light and fast.
Brian Okken: Obvious.
Brian Okken: Last shout out to Wiz to a article called
Brian Okken: How to Parameterize Exception Testing in pytest.
Brian Okken: And I'm glad people are still writing articles about pytest.
Brian Okken: And I'm going to let it slide that he did the capitalization wrong.
Brian Okken: No capitals in pytest.
Brian Okken: Anyway.
Brian Okken: It's fine.
Michael Kennedy: You can fix it.
Michael Kennedy: If you just right-click on that and say inspect, you can fix this website.
Michael Kennedy: You didn't know if you could edit other people's sites, but.
Michael Kennedy: You just pay.
Michael Kennedy: Really?
Michael Kennedy: It doesn't last right now.
Michael Kennedy: Well, for you, but then if you reload or anyone else, it doesn't change.
Brian Okken: The trick here, which is cool, is he's parameterizing whether or not something raises an exception.
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.
Brian Okken: And this is brilliant because this is very clear code to say, yeah, these cases, that shouldn't raise an exception.
Brian Okken: Other cases should be a zero division error or a type error or whatever.
Brian Okken: Obviously, you're not going to write a test for test division exceptions.
Brian Okken: But to test your own code to make sure that it's raising the right exceptions.
Brian Okken: Yeah.
Brian Okken: And throwing in a couple of cases for when it doesn't raise this,
Brian Okken: this is good,
Brian Okken: clean code and short article.
Brian Okken: So I like it.
Brian Okken: It's a very clean code.
Michael Kennedy: I would have not seen that coming.
Michael Kennedy: That's pretty good.
Michael Kennedy: Yeah.
Michael Kennedy: It's very,
Michael Kennedy: very good.
Michael Kennedy: Well,
Brian Okken: that's it.
Brian Okken: Do we have something funny?
Michael Kennedy: This last thing here,
Michael Kennedy: this joke is really here basically for you,
Michael Kennedy: Brian.
Michael Kennedy: This was sent in by Pat Decker,
Michael Kennedy: I believe.
Michael Kennedy: And I think it's good.
Michael Kennedy: I think you'll appreciate this coming from a testing perspective.
Michael Kennedy: Okay.
Brian Okken: Okay.
Michael Kennedy: So this was on Reddit.
Michael Kennedy: And the idea here is two developers talking or maybe project manager.
Michael Kennedy: I don't know.
Michael Kennedy: It says, your new date picker widget has crashed.
Michael Kennedy: Really?
Michael Kennedy: That's impossible.
Michael Kennedy: I've tested it with negative numbers, special characters, null.
Michael Kennedy: What have you put in it?
Michael Kennedy: A date?
Michael Kennedy: Yes.
Michael Kennedy: Oops.
Brian Okken: Forgot the base case.
Michael Kennedy: So busy testing all the edge cases and the area conditions that I forgot to see if it even worked.
Brian Okken: Yeah.
Brian Okken: That's a weird thing.
Brian Okken: I think that there's so many people think that testing is just about the complicated edge cases,
Brian Okken: but you've got to get the happy path first and make sure those work also.
Brian Okken: Yeah, absolutely.
Brian Okken: That's funny.
Brian Okken: Pretty good one.
Brian Okken: You've heard that tester walks into the bar, right?
Brian Okken: I think so, but give me your variant.
Brian Okken: a bad memory but tester walks into a or a text test um tester walks into a bar and uh orders uh
Brian Okken: a half a beer and one and a half beers and a negative beer and um and a million beers to see
Brian Okken: what happens and everything everything works fine um uh i thought that bar caught on fire astro
Brian Okken: actual custer comes into the bar orders one beer and barker bar catches on fire there you go there
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
Brian Okken: the the moral story of testing yeah and then my dad joke version of course the guy walks into a bar
Brian Okken: and says ow all right it does hurt different kind of bar sorry um spoiled your joke but
Brian Okken: all right um that another fun episode talk to you guys next week bye y'all