Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Python Bytes

Python Bytes artwork

#456 You're so wrong

Nov 3, 202526 minAudio

Topics covered in this episode: The PSF has withdrawn a $1.5 million proposal to US government grant program A Binary Serializer for Pydantic Models T-strings: Python's Fifth String Formatting Technique? Cronboard Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/456

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

Michael KennedyHello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 456, recorded November 3rd, 2025. I am Michael Kennedy. And I am Brian Okken. And Brian, I'm getting Guns N' Roses vibes. It's raining outside, it's November. Come on. Guns N' Roses? That's one of their songs. That's like, once they were kind of cool, then they became some other band that was more of like love ballads. November Rain, it's a Guns N' Roses song.

Brian OkkenOh, okay. November rain. Okay. Got it. I'm like, yeah, it's, it's rainy in the Northwest. That's

Michael Kennedyjust not that much news, but no, that's like, no, I got to go back. We're going to do music that completely entirely encompasses all of Pearl Jam, all the Nirvana, all the Soundgarden period. November rain or rainy in the Northwest, like the whole grunge movement. Right. Yeah, definitely. And I would just, I mean, look, I'm getting some support from the audience here. Rhett out there already saying November Rain is one of the greatest rock ballads of all time. And I agree. Thank you, Rhett. Although I will throw a Tesla out there as the greatest rock ballads of all time band. Alright. Are we

Michael Kennedyoff track yet, Brian? This episode is brought to you by us. We've got a bunch of fun things. We have Tesla the band. Not the scientist. Not the company. We both have awesome books. You should check them out. Brian, yours has been around for a while. I don't know if you're ever going to write another one, but we'll see. And how many How many people write the second book, right? You know, I imagine that you might do something like this. And my book's going really well. The Talk Python in production. Like, hey, maybe we could do simplified, affordable, but still fast and professional.

Michael KennedyPosting of our apps without hyperscale clouds. And 100 services and cloud engineers and all that. And if you want to be part of this show live, you can join us live. Are we changing times, Ryan? It's 11. We're good now, isn't it?

Brian OkkenWell, as far as my work schedule goes right now, 11 works.

Michael KennedyAll right, everyone. I just want you to know what I'm out here doing for you. So I'm going to have to go back and edit 455 episodes where we said, watch the live stream at Monday at 10 a.m. I'm going to have to replace that with watch the live stream at Monday at 11 a.m.

Brian OkkenYou're not actually going to do that, are you? No, I'm not going to do that.

Michael KennedyNonetheless, AI can do it for me. That's not happening. But going forward, if you want to join us for the live stream, please do so at exactly this time, 11 a.m. I'm sure there's some sort of time zone weirdness because we just changed time, but Pacific Standard Time until it becomes daylight time. We'd love to have you. We'd love people in the audience with feedback and thoughts and all that kind of fun stuff. Check out the newsletter. It's really great. We've been telling you about it. Sign up, pythonbytes.fm/. I'll just go there and click the newsletter button. All right, Brian, what are you clicking first?

Brian OkkenSo I want to talk about some news that came out last week. There's on the wrong one. There we go. The PSF, the PSF wanted to try to get, try to get some money from the National Science Foundation. Actually. So this was in January of 20th, January of 2025. There was a, a really kind of an interesting grant under the safety, security, and privacy of open source ecosystems program, which totally seems like a perfect thing for the PSF to try

Brian Okkento get some money for Seth and others to make sure that the PSF and Python code is all secure. Yeah, especially I think the supply chain side, if I remember correctly.

Michael KennedySomething like that.

Brian OkkenHowever, and they put in a ton of work and then our current administration says in order to get this money, you have to agree that you will basically not have any sort of diversity anything is part of your whatever. And, you know, what's going on? You have to affirm that we do not and will not during the term of this financial assistance award operate any programs or advance

Brian Okkenany or promote DEI or discriminatory equity, whatever. All that normal, wacky politics stuff that's going on in the US right now. Well, that's a tough bite for the PSF because it wouldn't just be the security stuff. It would be everything the PSF does. And in the mission statement, the mission statement of the Python Software Foundation is to promote, protect, and advance the Python programming language and to support and facilitate the growth of a diverse and international community of Python programmers. Does that violate? We don't know. So they like,

Brian Okkenyou know, checked with a bunch of people and basically said it's too risky because if the administration decides you violated it, they can take back the money, even if you've already spent it. That's crazy. And I'm glad, basically the PSF said, too high of a risk, and we're not going to do that. So they said no, they took back the proposal.

Michael KennedyI think they basically, they were going to win it, it's my understanding, like it was turned down 1.5 million, which if you think about it is something like 25% of the revenue, that's a really big significant chunk yeah i mean huge amount of money and a small amount of money

Brian Okkenfor the national science foundation huge amount of money for the psf um it's a it's unfortunate but um anyway uh we're gonna link to the uh the psf announcement but there's also um uh simon willison has a a shorter and really good write-up he's um uh he's he's part of the decision too and agrees with it. Apparently it was, it was unanimous. So he's on one of the, one of the board members who voted to reject the funding. And then there's, there's also articles from Mars Technica about

Brian Okkenthis because it's a big news. And also the register has an interesting article on it. So

Michael Kennedywe'll link to those, but yeah, that is a little bit more broad coverage of inside baseball and

Brian Okkenpython than we usually get yeah uh it's unfortunate too but so i'm um i'm gonna bump up my uh my donation to the psf um um and there's a link in most of these are at least in the main article and uh simon wilson has a link there also if you'd like to if you think what they're doing is right and good stuff and i i actually really love the what what well everybody does but um uh bringing seth on board was pretty cool and he's doing some neat things with security and so so are other people. So yeah, anyway, that's that. Yeah. More security is good for us, but yeah, it's got to pay

Michael Kennedyfor it. That's tricky. Talk about serialization and there is no funding or nothing in the serial just straight serialization, Brian. So check this out. So one thing that's really popular, I don't know if you've heard of them before, but Pydantic, it's pretty popular. Some people use it for, they have JSON and they want to get into Python objects. They use this thing called Pydantic. Yeah, it's kind of a big deal. It is, but here's what the Pydantic things do. they exchange JSON, right? And JSON can be extremely verbose, aka takes a lot of memory during caching.

Michael KennedySo let's suppose I have a list of a thousand customers. Each customer has a street address, country, postal code, et cetera, et cetera, right? Those words are repeated a thousand times for how many customers I said, a hundred, a thousand, whatever, right? Those are, they're very verbose. It's great for humans. It's way, way better than XML. Thank you for XML mostly going away, But it's still pretty verbose. So when you say, like, maybe I want to use Pydantic models, but then I want to store those things in, like, some kind of cached setup, right? Like a Redist or a disk cache.

Michael KennedyLike, man, I'm psyched about disk cache these days. So many places I see that I can use it. But if you put the JSON in there, then you're taking up a lot of space. So this project announced on Reddit by Lucky2Yan is called, what's the actual project called? It's called PyByntic, is in Pydantic, so binary Pydantic, which is interesting. So it says, I built a compact binary serializer for Pydantic models that dramatically reduces the RAM and or disk storage for caches compared to JSON.

Michael KennedyThe library is designed for high load systems like Redis caching Valkey. If you're doing Redis, you can also look at Valkey, where millions of models are stored in memory and every byte matters. It serializes Pydantic models into minimal binary formats and deserializes them back with zero extra metadata overhead. Cool. If you look-- is there a graph here? No, there is the graph on the GitHub page. So there is a graph about the size, but it's something like seven times smaller. There's a bunch here. Let's look. It compares to JSON, which is, let's say, 35 gigs.

Michael KennedyAnd then Pybantic-- I'm having problems here-- It is 4.6, which is like nine, eight times smaller than JSON. But that's pretty interesting. But here's what is actually really crazy. It's also four times smaller than MessagePack, five times smaller than BinaryJSON, and half as big as Protobuf. Oh, interesting. And Rhett out there is right there. Thank you, Rhett, for the handoff. So why not just use Protobuf? Well, it's twice as small, so it depends how much you are really worried about that, right?

Michael KennedyAnd how much do you want to just serialize your Pydantic models? So anyway, I thought this was interesting in a way that it would say, look, maybe we don't just necessarily store everything in JSON. Maybe it's this Pybantic thing. Or maybe, as Rhett is pointing out in the audience, maybe you want something more interchangeable and more well-known. Use protobuf. So it's a chance to talk about this new project, which is interesting. But also just to talk about there's interesting, well-known serialization formats that you can use.

Brian OkkenYeah. Yeah. And I think we can get those numbers better. If we come up with a benchmark with really long names, I'll get repeated. Like Boolean objects that are just like, the street that I lived on when I was a kid.

Michael KennedyUnderscore, yeah. Street that I lived on underscore kid as a kid confirmed, true or false, and so on, right? We could crush it in anything that drops the, drop it. So yeah, someone else out there say, all these things sound kind of interesting until you need to open up a REST client and debug the API. I don't believe, yes, that's true. And I don't believe that this is necessarily an API exchange format. This is a caching story, right? Like if I'm going to write it to disk cache or to Redis or Valkey, you know, I'm probably

Michael Kennedynot going to look at it. I'm just going, is it still there or do I just throw it away, right? Maybe you do, but maybe you don't. Right. Anyway, yes, everyone has pointed out some of that. There are certainly trade-offs of binary data, but I think it's pretty interesting. Yeah. As you know, look, the thing is often the very first limit you hit when you're in any sort of cloud computing environment is way, way sooner memory than CPU. Memory is so much more expensive than CPU. And this can give you, you know, half, five times less scale in that regard. So you might be, you know, that's where you start.

Michael KennedyThis is not when I'm just like prototyping my app. Like, let's start with this, right? This is where you're like, we could go from a thousand dollar server to a $50 server. If we didn't have to store this much stuff in memory for caching and it would still be faster. You know, that kind of thing.

Brian OkkenYeah.

Michael KennedyYeah.

Brian OkkenAnd there's still like, I don't know if this would be useful in those cases, but there's still non-web cases where memory is important. Oh, right. What are you talking about?

Michael KennedyInternet things and stuff like that.

Brian OkkenEmbedded systems.

Michael KennedyThere's stuff other than the web? No.

Brian OkkenI know. I'm an old, old crafty guy that actually programs things. Crazy.

Michael KennedyNo, here. What's your next thing? Tell us about it.

Brian OkkenOkay. Well, this is t-strings. These are new. Actually, we've talked about t-strings before, but now everybody can play with them because 3.4, 1.4. 3.14 is out. Yeah, they're officially a thing. But they're a little, I think we're going to cover them probably a few more times because they're a little bit harder to get your head around than everything else before. So I really appreciate, there's an article from Trey Hunter, t-strings, Python's fifth string formatting technique?

Michael KennedyThere should be one and only one way to do things unless it has to do with strings.

Brian OkkenYeah, or lots of other things.

Michael KennedyOr paths, or what else are we talking about?

Brian OkkenSo one of the cool things is, and I haven't really thought about this, is the history of string formatting. He goes through a very brief history. Percent strings, I kind of remember those. Yeah, I totally remember using those, like %s and then % and then the tuple to fill them in and stuff. So those sorts of template strings. You've got string.template, which I actually, to tell you the truth, that came in in 2.4, and I don't think I ever used it because by 2.6, we had.format.

Brian OkkenSo Python.format, we used a lot. I used that a lot over the years.

Michael KennedyIt's still a useful one, actually.

Brian OkkenYeah, definitely. And also in a lot of places where you might grab t-strings now, they're still pretty useful because you can pass those around pretty well and then format them later. And that's sort of that delayed actually formatting part where t-strings are going to be really cool. So then we have f-strings, of course, and everybody loves f-strings. I love them. And what's interesting is I still think of f-strings as a new thing, but they came in at 3.6. That was so long ago. I know. That was real long ago.

Brian OkkenIt's wacky. And then 314 has t-strings. And the different thing about t-strings is they return a template. They do not return a string. So they are different beasts. But the cool thing is, well, so why would you use them? We've talked about this before, but I kind of like that Trey took a whack at explaining this. They're more like you might want to use, I don't remember if he said it or somebody else. It'll be very useful for library authors and framework people to be using t-strings.

Brian OkkenNot sure how many people like in your own code you'll use it because f-strings are still pretty cool in format. But he gives an example of a dedent function that is the issue with f-strings is the when you like that the interpolation of filling in the variables happens earlier and you can delay it with templates. Essentially is what we're talking about. And he goes through a dedent example. And I actually, I'm going to have to just play with it more because I still got lost. But this is a good attempt.

Brian OkkenAnd I think this is cool. And then one of the neat things, I love it when people do this, is why not? If you're used to popping things on PyPI, he went ahead and called this better dident and his example and threw it up on PyPI. So if you want to play with what he came up with, you can just install it, run it.

Michael KennedyOkay. Yeah, very fun. i feel like he should create a not not just a bunch of separate little things that are for his examples but like a mega like a morsels with a complex cli that like lets you dive into the

Brian Okkendifferent examples i mean he he would have but the grant got canceled so oh i see well it's only the security features that wouldn't make it oh yeah right never mind no that's actually a decent idea like because he's got a lot of uh he's got a lot of stuff cool stuff on the python the morsel site so yeah for sure okay let's talk about something called ron

Michael Kennedycron board speaking of putting up a like a 2i or a CLI sort of thing so Brian how many cron jobs have you done at this time they have weird syntax I don't know if you're familiar with it but they have really weird little syntax that you can put in I don't know if there's a good example on this thing but like star star seven star like it's kind of hard to figure out like all the pieces understand what they mean see what ones are on your machine and so on so this thing called cron board is a terminal app written

Michael Kennedywith textual and rich that is basically a shell friendly or ssh friendly tool for understanding and using like look at telling me like what particular things are on here as a cron job what are their settings you can see like it's 10 that 1-10 star star star three star and actually the little thing validates the expression how often that actually means that runs and so on

Brian Okkenisn't this cool yeah it is cool yeah yeah i always have to use some sort of tool to figure this out

Michael Kennedybecause i know i'm like no i'm gonna get it wrong look it's so messy it's so weird i admire the

Brian Okkenold graybeards that used to be able to just do this in their head or on paper but yeah not me

Michael KennedyThat's right. Like this could definitely qualify for it's some form of Elvish joke. Yeah. Right. I mean, we put it on regular expressions, but it could be on cron job expressions as well. Yeah. Anyway, that's all there is to it. There's not a whole lot to say about it. It's written in Python, which is fun.

Brian OkkenSo do you have, do you have, I'm thinking about why you chose this, maybe just for the fun of it, but do you, do you have cron jobs in what you're doing on Talk Python?

Michael KennedyNot exactly. I sort of do, but a lot of it is like background. I think it's more like a background task that checks every hour. And so I've kind of kept it to that because I don't know. I like, I'm sure people get this vibe about me, but like I like stuff more cohesive and stuck together and just like focused and not all spread out all over the place. Like, okay, so this script runs on that cron job and then this part checks the database and this thing over here. You know what I mean? Like, so if I can cram it together and go, the part that needs that can also just run like a background thread and every now and then just go, does that need checked or rebuilt or reindexed or whatever.

Michael KennedyBut I could certainly see places where if I was more comfortable with cron jobs, I would do a better job with them and things would probably be simpler. So there's that. Yeah, cron board. Check it out. Looks fun. Cool. We're on to extras. You're the only extra. I ain't got nothing.

Brian OkkenOkay. Well, there's some exciting news. I just heard this morning. Oh, because it just happened this morning. Barry Warsaw announced an 810 explicit lazy imports. We've been talking about this for a while, and it was not approved yet. It was just a draft, but it is approved now. So steering council happily and unanimously accepted 810 explicit lazy imports. They have some input for the authors, but basically a really nice commentary about...

Michael Kennedyrevise and resubmit and sort of acceptance from the academic side. Like we'll take it, but not as it is.

Brian OkkenYeah, it's okay. Well, I mean, but that's kind of one of the cool things about the steering council, because you can do things like when you submit something, you can like as this is done. Actually, this was a really, really well-written, I thought, well-written PEP. But you can say things like there's a few points, like what keyword do you use? The PEP authors liked lazy, but there was a couple of other options. And the steering council went through and tried to figure out if they could come up with a better name. I mean, if there's options, why not give it to the steering council and say, you guys can decide if you want.

Brian OkkenBut yeah, so pretty cool.

Michael KennedyI wonder what that means for anybody that has a global variable named lazy in terms of compatibility.

Brian OkkenI mean, it would be fine as long as they don't use it in the import statement. I think it probably would not do anything at all.

Michael KennedyI know the early Python parser had a hard time with disambiguating that kind of stuff. but I think maybe the peg parser is more advanced. Well, no, the peg parser is more advanced. Maybe it can handle it. Like in C#, they have certain words that they themselves are not keywords, but taken as a pair, they are keywords, like lazy space import. So in C#, you have yield return is a keyword thing, but you can have a variable named yield as well, and they will be understood as different by the parser.

Michael KennedyAnd I think that that was not true in early Python, but I could be wrong about that.

Brian OkkenWell, luckily we have listeners like, and people, Hugo is listening, which is great. And in the, in the chat says lazy will be a soft keyword. So you could reuse it later.

Michael KennedyOkay, good.

Brian OkkenAnd also I forgot to give Hugo a shout out as his post on, on social media that announced that I, the reason why I saw the announcement was from Hugo. So thanks Hugo.

Michael KennedyYeah. Awesome. And thanks for all the stuff, Hugo. You give us a lot of good pointers either directly or just by writing. Okay, cool. Yeah. So I think I'm excited about it. The other thing, which this is me not reading the PEP end to end, but I'm curious. I'm going to be curious to see how it unfolds with typing. Because I know that you highlighted, you can say, if type checking, then you can do regular imports versus lazy imports. But if the next line I write is, my function takes an object of one of the things that was lazily imported, does that execute its import effectively? I don't know.

Michael KennedyWe're going to find out.

Brian OkkenWe'll find out. I'm guessing the steering council probably thought about that.

Michael KennedyI do. I would say so because that was a real big problem when they were trying to change the way imports worked a little bit earlier or things like Pydantic, you know, bringing that back around. Right. They're like, oh, this is going to be really bad. We won't know what things are anymore. Help. Yeah. Okay. So that's the really big news for everybody. And then I have really big news that mostly applies to me.

Brian OkkenThe big news is that I've started writing again. And I've actually decided I am a big proponent of lean, like lean philosophy and everything. And part of lean is actually just getting the whole pipeline, the entire chain, top to bottom, in place early. And so I've decided to do that with the book. So the entire purchase process, at least for this, is already in place. I've got a lean TDD site up.

Brian OkkenThere's actually a table of contents figured out already. I've got, I know what I'm going to write. There's not much there yet. There's like 10 pages written of introduction. But if you want to get updates every time I go through it, you can go ahead and grab a copy if you want. And I'll send you the, well, the system will send you updates every time I have something new. I'm also, it took me what, a year? The process from I want to write a book to it's out for the Python testing with pytest for both editions was a year and a half.

Brian OkkenI don't want to take that long. I'd like to get this one through the first draft and a pretty good state of the first draft. It'd be more like a beta thing by the end of the year. That's my goal. Awesome. Congratulations. That's awesome. Thanks. Also, with all of this extra junk around, like getting a landing page and all that stuff, it wasn't tons of work. But it takes away from writing. So I'm glad that I can get back to writing and get this thing kicked out.

Michael KennedyYeah, people don't necessarily-- even when it's your project, you don't think about how much those little extra things are going to take. It's like, oh, I can just put this app up. And oh, people have to reset their password. That means I got to support email. Oh, OK. Well, how am I going to do email? I don't want to send email. But here I am writing an email service, because apparently people have to log in or something.

Brian OkkenYeah, and I'm also-- I'm reviewing it. One of the things I didn't-- I'm not thrilled with how the pie test book shows up on Kindles. So I'm checking out the book from a Kindle. That's where I'm doing my proofreading to make sure that that's like an e-book first way to produce the book. So, yeah, awesome.

Michael KennedyI love it. All right. Cool.

Brian OkkenHow about something funny?

Michael KennedyYeah, let's round it out with a joke, huh? Yeah. OK, so we used to talk a lot about Stack Overflow and Stack Overflow had this reputation. still does just we talk about it less that stack overflow people were kind of mean you'd ask a

Brian Okkenquestion well the people in stack overflow i think the actual stack overflow people were fine yeah i

Michael Kennedymean the part i mean the community members a lot of the people were they would be quick to judge quick to say that question's already been asked and answered it was asked three years ago you know not not amazing right yeah um and it can be really daunting especially newcomers and so the feel for Stack Overflow might be, you're absolutely wrong, might be a subtitle. Right? But these days, no, we can feel all good about it. You're absolutely right, says ChatGPT. See, it's good to be a programmer now because instead of you're absolutely wrong, you're absolutely right. They

Michael Kennedyboth could be wrong, but they're sure that you're wrong or you're right, depending on who you ask.

Brian OkkenYeah. My daughter even ran into that. She was stuck on some chemistry homework and she asked asked chat to ask something. I don't know if I think it was ChatGPT. And she got like an answer back. She's like, that just doesn't look right. And it said, oh, you're right. It's wrong. And then it came up with a different answer. And she's like, this is ridiculous. How do I trust it then? Yeah, exactly.

Michael KennedyI do think that's why it works better for programmers than for many other groups, because you can run the code and at least see if it runs or doesn't run. And that's a form of a check. or if you're doing some compiling, you see if it compiles or parses or whatever. Whereas if it does like a chemistry theory, you're like, well, I guess I could do a year's worth of research and see if this is right or wrong, but I don't know. You know, I mean, go to the lab and start doing experiments. Like it's just, it's just the feedback loop is real quick for us. So, but it's still, you're absolutely right. Like,

Michael Kennedyno, I'm actually wrong. Just what are you doing? Anyway, we live in weird times. It was a fun joke about it.

Brian OkkenYeah. Oh, I'm going to throw, I'm going to grab the screen again.

Michael KennedyOh,

Brian OkkenI already took it down. Never mind. I'll do an extra next week, another extra.

Michael KennedyAll right.

Speaker 3Well, with that, we're going to have something to look forward to, right? Yeah. Yeah. So cool. All right. Catch you later. Bye, Brian. Thanks, everyone.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. #505 Introducing diskcache-oxide

    Nov 17, 202640 minAudio

    Topics covered in this episode: tinyjobs: a SQLite job queue goes free-threaded funkycache: cache Python functions in SQLite Ghostman - a keyboard-driven terminal API client diskcache-oxide: A shared, durable disk cache...

    Credit the people on this episode

  2. #504 Who turned the GIL back on?

    Nov 10, 202630 minAudio

    Topics covered in this episode: PyPI's redesigned project pages now warn when provenance changes gilguard catches the import that turns the GIL back on pip 26.3: pylock extras, and pip says plainly that untrusted wheels...

    Credit the people on this episode

  3. #503 It’s not 85% HTML

    Nov 3, 202630 minAudio

    Topics covered in this episode: Your GitHub language bar is lying (how to fix it) Python Typing Survey 2026: developers mix type checkers, and AI is writing the hints Flask Vibe - Build Apps You Can Understand Python on...

    Credit the people on this episode

  4. #502 Introducing chameleon-rs

    Oct 27, 202634 minAudio

    Topics covered in this episode: PHP wasn’t the only problem last week chameleon-rs Bringing uv and ty together Stlite runs Streamlit apps entirely in the browser Extras Joke Watch on YouTube About the show Connect with...

    Credit the people on this episode

  5. #501 A Nod to Sir-Mix-Alot

    Oct 20, 202638 minAudio

    Topics covered in this episode: Nod: pause your Python program and open a notebook at any line Polars 2.0 ships: streaming engine by default, spill-to-disk, and a row-order gotcha django-cachalot caches your ORM queries...

    Credit the people on this episode