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

#499 So many questions??

Oct 6, 202633 minAudio

Topics covered in this episode: PEP 824 brings ?? and ??= to Python for None handling Python 3.15 gets a surprise RC3, and Python 3.10 reaches end of life asyncio.shield Pyxel: the retro game engine for Python Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Consulting from Six Feet Up Connect with the hosts Michael: Mastodon / BlueSky / X / LinkedIn Calvin: Mastodon / BlueSky / X / LinkedIn Show: Mastodon / BlueSky / X Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesday at 7am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: PEP 824 brings ?? and ??= to Python for None handling PEP 824, a new draft from Marc Mueller sponsored by Guido van Rossum, proposes None-coalescing operators for Python 3.16. The ?? operator returns its left-hand side unless that value is None, and ??= assigns a fallback only when the target is None. It revives the long-deferred PEP 505 from over a decade ago, trimmed to just these two operators, with None-aware access split off into PEP 823. The goal is replacing verbose is None checks with something closer to or, but keyed on None instead of truthiness. Every Python codebase has piles of if x is None fallback code, and this is the first serious move in ten years to give it real syntax. user.age ?? "unknown" is like or but only falls back on None, so 0, "", and [] pass through instead of getting clobbered user.name ??= "unknown" replaces the two-line check-then-assign pattern, with left-side subexpressions evaluated and cached exactly once Precedence sits between or and conditional expressions, matching JavaScript and C#, and ?? lands as a BoolOp in the AST next to and and or Unlike +=, ??= is a conditional assignment that skips the right side entirely, which is why it gets its own AST node rather than AugAssign Still draft status targeting 3.16, with a working reference implementation and an online demo to try, and it notably rejects a soft keyword like otherwise in favor of the familiar ?? Discussion-worthy: the PEP answers the old objection that making None easier will proliferate its use, pointing out None is already everywhere and the status quo just produces uglier code # OG way user = db.get_user() city = None if user is not None: if user.address is not None: if user.address.city is not None: city = user.address.city # Michael's preferred way user = db.get_user() city = user?.address?.city Calvin #2: Python 3.15 gets a surprise RC3, and Python 3.10 reaches end of life The release team added a surprise third release candidate for Python 3.15 to fix last-minute lazy-import release blockers. They wanted time to test the fixes properly. That pushes the 3.15.0 final release from October 2 to October 9, 2026. RC3 has about 156 fixes from 82 contributors. The headline features are explicit lazy imports (PEP 810), the new frozendict (PEP 814) and sentinel (PEP 661) built-ins, and UTF-8 as the default encoding (PEP 686). No more ABI changes are coming, so library authors should be building 3.15 wheels now. uv 0.12.23 already added CPython 3.15.0rc3. On October 1, Python 3.10.22, 3.11.17, 3.12.15, 3.13.16 and 3.14.8 shipped together with nine common security fixes. They cover SSL validation, tarfile and zipfile handling, and urllib credentials. Python 3.10.22 is the final 3.10 release. After five years it gets no more security updates, so anyone still on 3.10 should upgrade. Python 3.13.16 is the last full maintenance release of 3.13, which now moves to security-only fixes. Only 3.13.16 and 3.14.8 have Windows and macOS installers, and the older releases are source-only. Python 3.11 gets security fixes through October 2027, and 3.12 through October 2028. A natural way to tie the two together: one version is nearly out the door and one is officially gone, and the same week is the time to test your code on 3.15 and move off 3.10. Michael #3: asyncio.shield Where async code can be cancelled In async Python, every await is a point where your coroutine can be stopped. If someone cancels the task, asyncio raises CancelledError at whichever await the coroutine is paused on, and nothing after that line runs. Quart does this on purpose. When the client disconnects, it cancels the request's task. From quart/asgi.py: elif message["type"] == "http.disconnect": self._disconnected = True request.body.disconnect() request_task.cancel() That's reasonable for a slow page nobody is waiting on anymore. It's a problem for a handler that writes to the database in two steps: await downloads.insert_one(event) # 1. log the download await totals.update_one(..., {'$inc': ...}) # 2. bump the episode's total A podcast app requests the MP3, gets what it needs, and hangs up. If it hangs up while step 2 is in flight, step 1 has already landed and step 2 never runs. Nothing is logged and nothing reaches Sentry, because a cancelled request isn't an error. The two collections just drift apart. Under WSGI this couldn't happen. A disconnect didn't stop your view; the view finished both writes and the server only failed later, when it tried to send the response. The demo I ran this on Python 3.14. The "client" hangs up 15 ms into a pair of 10 ms writes: async def record_download(): await db_write('events') await db_write('total') _pending: set[asyncio.Task] = set() async def record_download_shielded(): task = asyncio.create_task(record_download()) _pending.add(task) task.add_done_callback(_pending.discard) await asyncio.shield(task) record_download events=1 total=0 record_download_shielded events=1 total=1 The unshielded version loses the increment. The shielded version finishes it, even though the request was cancelled. The full script is in the scratchpad as shield_demo.py if you want it for the show. What asyncio.shield does, and its traps shield(task) protects the inner task from a cancellation aimed at the outer one. The handler still gets CancelledError immediately, so nothing after that line runs, but the inner task keeps going until both writes finish. The traps: Keep a reference to the task. The event loop only holds weak references to tasks, so a task with no other reference can be garbage-collected mid-run. The asyncio docs warn about this. That's what _pending is for. Its errors go nowhere by default. If a shielded write fails after the handler has already been cancelled, nobody awaits the result. You only get a "Task exception was never retrieved" warning. Log errors from inside the task, or in the done callback. It doesn't survive a process shutdown. If the event loop is closing, as during a Granian worker recycle or a deploy, pending tasks are still cancelled. The window is tiny, but it isn't zero. It hides hangs. A shielded write to a stuck database lives forever. Put a timeout inside the shielded task (asyncio.timeout(...)), not outside it. It makes the pair finish, not atomic. A crash between the two writes still splits them. The real fix is one operation that can't half-happen. That's what the SQLite move gets: an insert and an upsert in one synchronous transaction, with no await in the middle. Shield is the right patch for the Mongo code until then. The general lesson: in async code, related writes made one after another are only as reliable as the client's patience. Before shipping something like that, check whether your framework cancels on disconnect. Quart does, and I believe Django 5's async views do too. I don't think Starlette cancels a plain endpoint, but I haven't checked any of these other frameworks' source, so verify them before you say it on air. Calvin #4: Pyxel: the retro game engine for Python Pyxel is a free, MIT-licensed retro game engine for Python, built and maintained by a single developer. It has been in development since 2018 and has passed 18,000 GitHub stars. It's modeled on classic game consoles and deliberately limits you to 16 colors and 4 sound channels, which keeps scope small and games finishable. Built-in editors cover pixel art, tilemaps, sound and music, so you can make the graphics, audio and game logic in one place. The engine is implemented in Rust and compiled to WebAssembly, but you write your games in plain Python. Pyxel Code Maker is a browser playground with a code editor, resource tools and a run button. It loads projects from local files, GitHub Gists or URLs, and saves back to a Gist for sharing. Games can also run on the web, so sharing one can be as simple as sending a link. It's a fun, low-barrier way into game development, good for beginners and for teaching kids. Extras Calvin: Python Lang Summit 2026 discusses a sys namespace Be Careful Updating Your Refrigerator Michael: New Siri is No Bueno Who out there is doing interesting work with sqlite and litestream? Trying to put an episode together on it. Tinymongo shoutout https://tinymongo.org Joke: I was there.

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.

Calvin Hendryx-ParkerHello, and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 499, recorded Monday, October 5th, 2026. I'm Calvin Hendryx-Parker.

Michael KennedyAnd I'm Michael Kennedy.

Calvin Hendryx-ParkerGlad to have you, Michael. Please support this show and all the sponsors. Make sure you support our work. Michael and I are doing lots of interesting things out in the community. So support the courses at talkpython.fm. So head over there. There's some really interesting new stuff, some Rust stuff, some web stuff. There's all kinds of data stuff. So check out Michael's courses online at talkpython.fm and check out the consulting from Six Feet Up. So I am co-founder and CTO of Six Feet Up.

Calvin Hendryx-ParkerWe are a Python AI shop who loves solving hard problems. So if you've got a hard problem and you'd love to talk about it, I'd love to talk to you about it. So let's move right along with connecting with us. you can find Michael and myself on Mastodon, Bluesky X, and LinkedIn. And the show is on Mastodon, Bluesky, and X. So check us out over there at Python Bytes. Join us on YouTube for pythonbytes.fm slash live to be part of the audience. You can actually participate live, ask questions. We may put them on the air and answer them in real time.

Calvin Hendryx-ParkerUsually it's Tuesdays at 7 a.m. Pacific. Older versions are available there too. And finally, if you want an artisanal handcrafted digest of every week's episode show notes and email form put your email in the friends of the show and we will give you a beautiful email summary actually includes lots of little extras I kind of like that summary very meta but I like the meta-ness of it and we'll never share your email address so it's safe with Michael and I all right Michael uh I've got questions so many

Michael Kennedyquestions question so many question marks so many so many question marks hey before we jump into the questions I just want to say I just came from a place with large buildings outside my hotel window and you have large buildings outside your hotel window.

Calvin Hendryx-ParkerI do. I'm in New York City today.

Michael KennedyThat's awesome. Where were you, Michael? I was in San Francisco. I want to give a downtown San Francisco. I'm going to give a shout out to PiBay. That conference just happened two days ago and was tons of fun. And all the sessions were recorded. So they're going to be up. And I think it'll be really fun for everyone. We'll give the videos a shout out when they're up. So that was really nice.

Calvin Hendryx-ParkerNice. PiBay's on my bucket list of conferences to attend. I've never been.

Michael KennedyWell, it was fun, I can tell you.

Calvin Hendryx-ParkerNice.

Michael KennedyBut you have questions. you say questions there are question marks there questions there are questions now this topic is really interesting to me so there was a PEP 505 is this yeah 505 now often you'll hear this referred to as the idea is i'm dealing with variables that have no values and so you'll get like attribute errors because none type doesn't support whatever you're trying to do you know what i mean and so you got to check right is this thing not none then i can do thing with it right often these are referred to as null coalescing operators because like most programming languages call nothing for pointers

Michael Kennedynull but by then we call it none so we have none coalescing operators so this was a proposal from 10 years ago and it's revived as an idea for 3.16 by mark muller with sponsor none other than guido van rossom and the idea is let's go back to 505 from 10 years ago and just do like a really simple bit. Now I don't just have questions. I got, I got ideas. I have opinions. So, but let's, let's go with what it is first before I,

Calvin Hendryx-ParkerI,

Michael Kennedyum, there was a lot of ideas in 505, 10 years ago for this one. It's very short and simple. There's two things, question mark, question mark is the operator. Hence the comment, the opening transition and question mark, question mark equal. So you got to scroll, scroll, scroll, scroll, scroll. Here it is. It comes down to something than like this line age. If you're going to get a user, maybe you got the user from a database. This example is bad. Example in the, in the thing is not good because that's what is the type safety say about this?

Michael KennedyCan it be none? I have a user colon user, like lowercase user, uppercase user. Python's type system says if something could ever, ever possibly be none, it must be marked as optional or, you know, type pipe, none, if you prefer the union variant of that. I don't like it, but you know what? I also have opinions there. So basically the way this thing is typed, it's literally not necessarily to check necessarily to use a null check, because if the type system is cohesive and you're running things like T Y or whatever, and they pass, then you would be good. But the example is what it is.

Michael KennedyAnd so, so we take a user, but the user might be null or none, even though it says it can't be none. Um, it says, well, we're going to need to check. You might need to write if I'm up here, if you know, the user is itself not none, then, oh, wait, sorry. This is actually, so this is different. So no, this is still fine. It says if user.age, trying to get the age from the user. So instead of saying if user is not none, if user.age is not none, well, just user.age is not none.

Calvin Hendryx-ParkerDone that so many times in my life. Other,

Michael Kennedyyes, I know. Other, otherwise, if I got a user and it has no age set, then instead of saying I have an if statement where I set the value, I can say question mark, question mark, unknown age. Okay. I'm not, I'm not against this. my opinions are not saying this is bad. It doesn't seem to buy me very much, right? I mean, you could say user.age if user.age is, you know, else unknown or whatever. Like it's, you can still kind of one line it

Michael Kennedyin not much more effort. You don't, as a ternary sort of expression or something.

Calvin Hendryx-ParkerYeah, I was thinking like ternary would be appropriate.

Michael KennedyYeah, that's how you would have done it before if you wanted one line. But, you know, it's fine. I think it's, I think it's okay. Now, if we go back to 505 from 10 years ago, there's other things as well, like question mark dot. And now this one I think is actually, if they're going to pick one thing in the language and use, and like, so we're going to add a little bit of null or none help here. This one is the one that makes such a difference. So in the show notes, I put a little example, um, down here where you'd have to do it the old way or you have to do it the new way.

Michael KennedyAnd this little example here lost my comments, but the comments are in the show notes. So I go to the database I get a user, I may or may not be logged in. So this could be, could be a user object or it could be none right. And I have a city, I want to set the city to a value. But if I don't set it to a value, I want the city to be none. So I have to say, if user is not none, then I can run the test if user.address is not none, then I can run the test. If user.address.city is not none, then say it equals user.address.city and I mean like this, this is a lot.

Calvin Hendryx-ParkerYeah.

Michael KennedyWhat was in the original one and what I wish was here, if they could add one more thing, just one little bit would be this one line here. City equals user question mark dot address question mark dot city.

Calvin Hendryx-ParkerI can see why this is controversial.

Michael KennedyIs it, you have opinions now? So the way this works, the way this works in other languages is when you, instead of saying dot for attribute access or function calls or whatever, you say question mark dot. And if the thing that you're trying to do attribute access on itself is none, so like user question mark dot. So if user is none, then you just short circuit and return none. If user is not none, but user address is none, you short circuit that and you return none. Otherwise, you just give the value of city, none or not.

Calvin Hendryx-ParkerA little opaque for me. A little.

Michael KennedyOkay.

Calvin Hendryx-ParkerYeah. I mean, I agree that the verboseness of the example given there is a lot of what feels like boilerplate to get the same thing done. So I can understand why they didn't go all the way for this version of this index.

Michael KennedyYes. So to be...

Calvin Hendryx-ParkerI mean, if you thought the walrus was contentious.

Michael KennedyI know, it's true. The walrus has left scars. But here's the thing. So how much does this, I don't know, how much does this new addition here help, right? This user.age? ?unknown. You know, how do you solve problems? It doesn't really solve problems like that one. It just compresses ternary expressions, right? it doesn't actually alleviate the none checking. Like if you wanted to check is user none or age none.

Calvin Hendryx-ParkerYeah, but maybe I don't I don't see.

Michael KennedyYeah, I don't see any way to

Calvin Hendryx-Parkerthis feels cleaner for the ternary version of that.

Michael KennedyYeah,

Calvin Hendryx-Parkeryeah, let's see. We got some again, this is this is personal opinions. I think both of us are

Michael Kennedyabsolutely I'm okay without it. But if you're gonna add no operator, like no operations to the language, The biggest one is the if this is not, if this is like just the sawtooth of four things, ifs. Kiva out there says, when I went from C# to Python, I really, really missed the null coalescing operators more than anything else, even the type system.

Calvin Hendryx-ParkerYeah.

Michael KennedyYeah, yeah, yeah.

Calvin Hendryx-ParkerBut like you just mentioned with the sawtoothing, the flat is better than nested Python, you know, to tenant. Really, I believe in that one. And that breaks it when you go that deep like that.

Michael KennedyYeah. Yeah. So you would, I mean, what would I do? All right. We're in the danger of going too deep. So what I would do is I would use for this, this, like the way it has to work now, not Michael's beaver dream of null checking. You've got to use what are called guarding clauses, right? You say, if user is none, return, return something like none or whatever. And then if user.address is none, return something else. And then finally you can get the city and you know, you can flatten it with the right patterns.

Calvin Hendryx-ParkerThat's the Vincent of Python pattern I would have used.

Michael KennedyYeah. All right. That's enough for this. People, this is a proposal, a draft for 3.6. We have had opinions and we've shared them and now you can have yours. Over to you, Calvin.

Calvin Hendryx-ParkerYep. Well, speaking of language features and new versions that are out. So we've been talking about Python 3.15 for at least the last month of episodes, hoping it would have been out October 1st, but that got moved. So we actually have got Python 315 RC3 that came out this week. So if you are keeping track, you should probably notice that there's not been a formal release, but it will be coming. I believe they're saying final is scheduled here for the ninth. So before the next

Calvin Hendryx-Parkerepisode, we will have Python 315 that is out. The showstopper roadblock that was going on in there was basically some support or fix for what was lazy import release blockers. So the kind of one of the really nice new features of Python 3.15 that you probably should check out. And if you wanted to go use what's newt to do a dungeon crawler and explore those features. But the lazy imports had a last minute bug. So they want to make sure they get the fixes tested properly.

Calvin Hendryx-ParkerSo if you aren't familiar again, lazy imports means that you can say lazy import from blah, blah, blah, blah, blah. And when you go to use it is actually when it'll import at that point in time. So you could actually have imports at the top that actually never get imported based on conditions, which might actually be preferable given your stance on memory usage or loading things for security reasons or lots of other things that could be basically be wrapped into that.

Michael KennedyI'm very excited about the lazy imports.

Calvin Hendryx-ParkerYeah, I am too. So I think the lazy imports and then the frozendicts that we get now as well. I think that's the other major one that was going in there. But there's no major ABI changes for this RC. It's just making sure dotting the I's and crossing the T's and making sure that the version 3.15 is very, very solid. So that's part of the news I wanted to cover on this one. The other piece that I wanted to cover was that on October 1st, they also released the last version of 3.10.

Calvin Hendryx-ParkerSo if you see right here, Python 3.10, .22, 11, da, da, da, da, da, all the minor releases there for 10 through 14 are now available. The most important piece I think of this release that I wanted to bring it up during this segment was there'll be no more releases of Python 3.10. This is the EOL final end of line. There'll be no more security releases for 3.10. So if you've got code in production that is running 3.10, you've been warned, you've been told probably many, many, many, many times, along the way that this is coming,

Calvin Hendryx-Parkerbut it's become, we're here. So for example, there was nine common security fixes in this October 1st release. There was things like SSL validation, that tar file and zip file handling, URL lib credentials. Those all sound pretty important. And those are the kinds of things you're going to want to have fixes for inside your code, especially given the state of credentials. AI and all the things that are kind of coming out after it. So it's been five years. It's time-free to upgrade. There's going to be no more 3.10.

Michael KennedyThat's wild because I'll tell you that 3.10 sounds pretty modern to me.

Calvin Hendryx-ParkerSame for me. I mean, I think we are of an age and have been in the Python community long enough that five years passes before your eyes, before you know it. But 3.15 is about to become very much a reality. 3.14 is very stable. 3.11 has all the things you probably want and probably is most likely a drop in. These releases of Python, I don't believe there's been too many backward compatible breaking changes in there. So there's not really much of a reason not to. If you've got great test suites and you can go and do a Nox style test against all of them, find out which

Calvin Hendryx-Parkerone doesn't break for you quickly through your CI pipeline and get your code updated for the latest versions of Python. Now that said, Python 3.11 will get security fixes through October of 2027. So you got another year on 11 and another year after that for 12. But why not just go to the 315? It'll be out later this week.

Michael KennedyIf you're already doing the work,

Calvin Hendryx-Parkeryou might as well get yourself another five year lease on this work.

Michael KennedyRun Knox, run all of them. Run all of them. See if they all pass or if there's issues and either fix or just go back to the, you know, 313 or whatever that works. Yeah.

Calvin Hendryx-ParkerI just, again, I hate, I put this one here because I really do not want to see anyone be a headline on Hacker News or any other major news outlet, I've got an extra that's kind of related to this, that you shouldn't, don't be a victim. Keep up to date. Python is very, the Python community is very good about compatibility, updating, having updating notes. We learned a lot of lessons in the two to three history of Python. So go out there and get yourself upgraded. But Michael, that's what I got for.

Michael KennedyOne of those lessons was waiting for a very long time for the world to sort itself out. It doesn't necessarily treat you that well.

Calvin Hendryx-ParkerYeah, that's true.

Michael KennedyMaybe stay on top of things as they're changing rather than like waiting eight years to go, oh gosh, we got to upgrade. Like you should have a shield. Let me just put up like a shield sort of thing.

Calvin Hendryx-ParkerIs there a shield people could use?

Michael KennedyThere is a shield people can use and I've got details for you. So I've been experimenting with ideas, some crazy ideas and I'm not ready to share with you. Well, I might share with you privately, of course, Calvin, But I'm not ready to share with you, dear listeners as a broad world until I have more info on it. But it's pretty wild. So I've been doing a lot of testing on like different database type systems and so on a couple of the websites. And I have this place where I write basically an analytics entry.

Michael KennedyYou know, someone's downloaded this or they watched a video or something like that. And then I increment it somewhere else because, you know, 50 million records, you don't want that to be operational. Like who has done this thing? You might want it like a little more concise or how many people downloaded that thing or whatever. So it writes it once to this kind of summary table that the websites use. And then it writes this, this analytics one. Well, it turned out that out of many, many millions, there was 1,200 missing entries, where, where did they go? It says right here. And then it says right there.

Michael KennedyWell, these came into existence once I switched to an async web framework court, but it could be FastAPI. It could be Litestar. It's not anything necessarily specific with court, not necessarily. So what happens is with court, if somebody makes a request and the request is in flight and they decide they're not doing that anymore, or they're going to cancel that, or they're going to go somewhere else, court itself does a request.cancel. So it says, oh, did somebody disconnect? Like here's the LF literally says disconnected,

Michael Kennedyrequest body disconnect. And the last thing is request task.cancel in the court ASCII.py file. Well, what happens is if you're writing one event and you're awaiting it and you're writing another event and you're awaiting it, if this first one has not, has finished, but it hasn't quite gotten done, it hasn't finished awaiting. Well, this thing just raises a task canceled exception and that one doesn't run. Or maybe this one's starting, the second one is starting to do a database negotiation. Like, hey, give me something on the connection pool and I'm going to start talking.

Michael KennedyI'm out. And so these don't have to happen atomically. Right. So there's different things you can do to do that. Obviously you could use a transaction, but then you would lose the first one, which maybe like a request did come in. Maybe you want to save them both, right? So what are you going to do? You can bust out the asyncio dot shield and this, I've done a lot of asyncio stuff. And this is surprising to me. So what you can actually do is with this asyncio shield, it basically says this sub, this async subroutine. I do not want it.

Michael KennedyEven if the outer task gets canceled, I want this to either not run or completely run, right? So I can do like record download. I can say await. Instead of wait, just the task, I await asyncio shielding the task and you get consistent.

Calvin Hendryx-ParkerYeah, you get more intentional control over the specific use case because that can happen in your, like you said, your left scratch in your head.

Michael KennedyWhy? It doesn't make any sense. Like it's either running or it's not running. Well, apparently the web framework unwinds it partway through, which is reasonable so that they can go handle requests that are not disconnected.

Calvin Hendryx-ParkerI mean, it's more than reasonable. It cleans up after itself 'cause it allows you then to perform other cleanup operations that may have happened along the way too.

Michael KennedyYeah, exactly. So this is not a third party thing. This is just built into the asyncio module. But to me, this was a mystery until I learned about it.

Calvin Hendryx-ParkerYeah, I've never explored this before. This is really cool.

Michael KennedyYeah, yeah. And the other thing that's really noteworthy here is you need to make sure that you have something holding onto the task, right? So here you can see the task is created And then it adds it to the pending tasks. Because I remember where I wrote about this. Let's see. Fire and forget. Not ever, never. So both I wrote about this and Will McGugan wrote about this. But it turns out that if you start a task and you don't hold on to a reference to it,

Michael Kennedythe asyncio event loop uses weak references. So it's very likely that once you create a task and start it, If you don't hang on to it, there might be a garbage collection or some sort of reference kind of thing that just drops it halfway through. So kind of got to keep this in mind plus that. So it's a little, not super obvious. Like, so that's what this pending task thing is about. Anyway, it doesn't solve all your problems. Like you've got to keep a reference to the task. Errors go nowhere by default, because now you've, you basically said the outer thing that called it, I don't want it to see that anymore.

Michael KennedyDon't worry about it. Doesn't survive shut down. If something hangs while you told it, it can't cancel. so it's not going to cancel if you keep going and um it'll make him both finish but it's not necessarily atomic right if there's an exception that's different than just avoiding cancellation

Calvin Hendryx-Parkerso anyway i feel like you solved one one interesting edge case you've only solved one interesting edge case but potentially introduced like six more in the traps and current traps and

Michael Kennedybe careful i'm tired of it i don't want to do any more let's just go play games you want to play

Calvin Hendryx-Parkergames yeah okay let's play some games this is a so this is not a new framework necessarily but it's been getting a lot of uh exposure recently on the interwebs and so it's called pixel it is a retro game engine for python it's a free mit licensed game engine that you use python to build games in uh what kind of attracted to me is i am obviously a fan of the retro looking game aesthetic So it's kind of like how Twitter used to deliberately limit you to 140 characters.

Calvin Hendryx-ParkerThis deliberately limits you to 16 colors and four sound channels. So you are basically operating in the world of classic game consoles like the NES and so on. So it keeps the scope small. And one of their goals was to make the games finishable as a programmer, not as the player, but as the person building the game. So you're not getting, you don't get into me the traps of all the features and all the 3D and all the other kind of things. It's been in development since 2018. It's got 18,000 GitHub stars on there.

Calvin Hendryx-ParkerIt has built-in editors for the pixel art, which is also something I, is near and dear to my heart, which is like the art and the aesthetic behind the game. So you can build art and the tile maps. It's got editors for the sound and the music. So you can make graphics, audio, and the game logic in one place. So again, not to get distracted by going to five other tools to get something done. That's a great way to do all that stuff in one tight place for that. What's awesome is that actually the engine behind the scenes is implemented in Rust.

Calvin Hendryx-ParkerAnd so we've been hearing a lot about Rust lately. It gets compiled into WebAssembly, which you can launch the games locally on your computer, compiles down into a locally executable Rust binary. But you can also play the games on your web browser. So it uses WebAssembly to deploy these or make them deployable into your web browser. So the CodeMaker has a browser playground with the code editor and all the tools built into it. You can load programs from local files, GitHub Gists or URLs.

Calvin Hendryx-ParkerActually, I'll show you a quick demo of this right here. So in the showcase, you can just run uvx pixel copy examples, and it will pull these examples to your local computer where you can run them. or you can just go into the docs over here and they've got the pixel showcase where these are the exact same examples from that copy examples I was running locally on my machine. These will run here. I'm going to run one. I'll run the platformer. It's kind of fun. This is WebAssembly. This Python code compiled to run in my browser. And so you can see here,

Calvin Hendryx-Parkerit's got sound a whole bit. You can't obviously hear the sound, I think because I didn't share it over there.

Michael KennedyThat's so cool.

Calvin Hendryx-ParkerBoom, there you die. So it's fun.

Michael KennedyYou know what we got to do? Did you ever play the game Lemming?

Calvin Hendryx-ParkerYes.

Michael KennedyOh my God. That's one of the best games of the genre in my opinion. And it has to come back.

Calvin Hendryx-ParkerYeah. Let's see if I can find my mouse again.

Michael KennedyWasn't the original Prince of Persia a little like this as well? Very original. Yeah. These are good.

Calvin Hendryx-ParkerYeah. They got some nice, interesting examples. And then there's a whole like gallery of examples on the site for pixel as well. If you come down here and you can see these a bunch of examples that run. They're cross-platform, obviously. They run Windows, Mac, Linux, Web. They don't care. They run everywhere. It's great for, like, if you want to teach people how to code and program, some of the most popular sessions we've ever done in our IndyPy user group have always been like the arcade library or the PyGaming libraries,

Calvin Hendryx-Parkerbecause people can relate to and know that if they can build games like this, they can learn how to program and do really, really cool stuff. It's a fun low barrier way into game development. Good for beginners, good for teaching kids again, because it all runs in one spot. You're not having them install a bazillion different things. Actually, I think if we go. Yeah, here we go. I've got the examples over here. You just run like that. That's the same platformer. And it launched a rich looking app right on my desktop.

Michael KennedyYeah, that's awesome.

Calvin Hendryx-ParkerLet's see if I can get right. I can't. Oh, there we go. I'll get a little further.

Michael KennedyOh, you know what reminds me of? I was going to say Flappy Bird, but that's not what it is. It reminds me of Joust, but bird form.

Calvin Hendryx-ParkerBut you can even come in here and run like the hello world. Oops, not 1.py. Let's say there's like the 01, obviously. And then this one's just like the hello world of pixel. Hello, pixel.

Michael KennedyAnd there's a link tag.

Calvin Hendryx-ParkerYeah, yeah, yeah. And so if we just bat the 01 hello, you can see here 20 lines of Python code that run on the Rust engine using pixel.

Michael KennedyYeah.

Calvin Hendryx-ParkerSo super fun, very easy way to get started and go run some cool Python code.

Michael KennedyI love it.

Calvin Hendryx-ParkerYeah.

Michael KennedyVery fun.

Calvin Hendryx-ParkerIt was very fun. I don't know if you've got any extras, Michael, you wanted to cover real quick?

Michael KennedyI got a couple, actually. Let's jump in here. So where do we want to go? These are both pretty small. So first of all, we're back from Stefan on Tiny Mongo.

Calvin Hendryx-ParkerThis Mongo one's got a lot of legs.

Michael KennedyIt's got legs. Well, because we worked for weeks on getting this thing almost performance compatible and API compatible with MongoDB a sequel light rapper it was incredible so we talked about it on the podcast last week and he's like i loved it so much i gave you guys a little bit of shout out so here check this two things one nice little shout out to watch you and me debate it from or to discuss it last time but also this this click here to like give you something help me use tiny mongo here's the thing that it had it on

Michael Kennedyright you just copy this give it to your ai coding agent this gets started by copying a prompt give it to your AI coding agent and let them get you going using tiny mongos. Pretty sweet.

Calvin Hendryx-ParkerI like the way to bootstrap people into success.

Michael KennedyYes, I do too.

Calvin Hendryx-ParkerBecause otherwise you're kind of stuck with the blank sheet of paper syndrome, like where you're just like, oh, it's a big blank sheet. I don't know what to do. Here you go. Get started.

Michael KennedyExactly.

Calvin Hendryx-ParkerYou get to go.

Michael KennedyYeah, you get to go. Then the other one is I've become kind of fascinated with Lightstream. Are you familiar with Lightstream?

Calvin Hendryx-ParkerLightstream. I don't know if I've ever used Lightstream. No.

Michael KennedySo it's super interesting. There's this video that I'm going to link to called Lightstream plus SQLite. Scale to a million users without Postgres or CloudBills. And this video, this guy puts this together. Let me see if I can get it to skip ahead. But there's really cool animated sort of architectural tech talks, usually like 10 minutes. This guy's called Claude Codes. Now, it's AI text-to-speech generated. I don't know that it's AI generated, but it is. I think a person's behind it,

Michael Kennedybut I think it's spoken by an AI. So it says Litstream, even though it's not pronounced that way, I don't believe. That said, I'm recommending it anyway because it's so good. This is such an interesting topic. So Lightstream is a thing that you can put next to any app that runs on SQLite. If you turn on the write-ahead log wall mode, which is the durability mode of SQLite anyway, if you turn that on and you run Lightstream next to it, it will take the write-ahead log and it will stream it to somewhere like S3 or anywhere else.

Michael KennedyAnd the way it works is it will eventually compact those. So instead of just having a bunch of write logs, it'll say, okay, it's been, I don't know, an hour. So I'm going to take all of those and like merge them into a SQLite file and then some more and some more. So you get within a few seconds of my SQLite file is now backed up somewhere else. And if for whatever reason it fails, you know, I could just restore it in reverse, which is pretty interesting.

Calvin Hendryx-ParkerThat's really cool.

Michael KennedyYeah. So they talk about some other projects like, Expensify does something like 4 million rights a second on SQL light or something like an incredible thing they set up. So why do I bring this up? What does this have to do with an extra? Why is it not a topic? I'm trying to do an episode with somebody from light stream. I reached out to the creator, Ben, who has, um, just completely ghosted me. I sent him like three or four different channels of messages, not interested.

Calvin Hendryx-ParkerThis is a plea for help.

Michael KennedySo my, it is a plea to like, Hey, If someone out there is doing cool stuff with Lightstream and SQLite embedded data and wants to come on Talk Python and talk about it, shoot me a message and maybe we'll make that happen. My traditional channels have run dry.

Calvin Hendryx-ParkerAll right. You heard the man.

Michael KennedyIt's a plea.

Calvin Hendryx-ParkerIf you'd like to do that, come on down. I got a couple quick extras. One of them I didn't make a segment as part of my Python language bits, which was there's a new namespace potentially coming to Python called Sys. So if you have ever made a file in your directory that conflicted with the name of a standard library module, you may have experienced this bug. So you can see here that if you cat the game.py, it imports random. And then it uses random.randint to pick an integer between 1 and 10 here.

Calvin Hendryx-ParkerAnd if you run the game, you'll see module random has no attribute randint. How is that possible? It's because you've got a module in your syspath someplace that is shadowing it. So instead, correction, I wasn't talking about a sys namespace. This is now the standard namespace, which could be, for example, import std.json. And now you are certainly very explicitly using the JSON library that comes with Python explicitly. So this was discussed,

Calvin Hendryx-Parkerseemed to be met with lots of enthusiasm and people who are very excited. I'll go just scrolling down here to the very end, that it was many attendees loved the idea. No one attending hated the idea. So I'll call that a, that was a resounding success for this one. We'll see the, there'll be a PEP probably coming soon to get this included. So I don't expect this soon, but I think this is on the horizon. Lots of other languages have this. I think they mentioned in here. So we've got Rust, Java, Go, Node, all have something similar to make this explicit and safe.

Calvin Hendryx-ParkerSo Python was the holdout on this, which is kind of funny given our love of explicitness that we would not have this level of care there.

Michael KennedyThere should be one and preferably only one way to do a thing unless there's six ways to do a thing.

Calvin Hendryx-ParkerCorrect. The last extra, be careful out there, folks. If you have a refrigerator that is smart and you need to upgrade it or update the firmware, some Samsung owners have reported that the firmware update bricked not only their Samsung smart part of the fridge, but the refrigerator itself. They had spoiled food after firmware updates bricked their Samsung smart refrigerators. This appeared to only have happened in Korea. So this seems to be kind of limited to an early release.

Calvin Hendryx-ParkerSamsung did respond to Ars Technica on this article saying that they had a response in their user complaints forum. This is just a translation, but they're doing their best to ensure that customers do not suffer any losses during this specific holiday period in Korea. So be careful out there, folks. Your refrigerator could get bricked. And I'm just shocked that this did not have a fail safe to go back to being just a standard refrigerator after the smartness wore off. It seems like a natural state to fail into.

Calvin Hendryx-ParkerYou know, kind of like an escalator. When an escalator is broken, it's just stairs. You know, it still works.

Michael KennedyInstead of being the ride where you free fall for three stories.

Calvin Hendryx-ParkerRight.

Michael KennedyThat's crazy.

Calvin Hendryx-ParkerYeah, so be careful. yeah yeah all right michael if you have do you have a joke for us this week i do have a joke

Michael Kennedyall right let's i'm always down for jokes so this one comes to us from uh will vincent he doesn't he didn't send it in i just found him saying something funny and it's the joke so the title

Calvin Hendryx-Parkerof the joke makes me think of an lcd sound system song okay you should be thinking perhaps lord of

Michael Kennedythe rings lord of the rings something like that okay that's a different direction okay so well here we go so will vincent says today i was talking with a colleague about how difficult python installation and packaging was before uv and there's whatever the elf from lord of the rings like forgot the name character name but i was there gandalf i was there 3 000 years ago we didn't even have pip we called it the cheese shop eventually it was brutal i was there gandalf

Calvin Hendryx-Parkerhow appropriate that they would pick 3 000 years given that python always guido always referred to Python 3 as Python 3K in the early days. A lot of intersections going on here for that joke.

Michael KennedyYeah, pretty funny, right?

Calvin Hendryx-ParkerBut I was there back in the day. It is related to the song a little bit.

Michael KennedyOkay. I don't know the song. I'm going to have to be educated later.

Calvin Hendryx-ParkerI'll put a show note to it, maybe.

Michael KennedySweet.

Calvin Hendryx-ParkerNice. Well, thanks, Michael, for joining me for this week's episode. And hopefully we'll connect again next week.

Michael KennedyI would like to actually add something for people listening really quick. Because next week, what episode is it? 500 it's special we're going to do a little bit something special for next week we're going to have brian auken is going to be back on the show as a guest first time ever actually and we're going to have some other folks also join in on the show and kind of just do a little bit of an extended version a little bit special with some other folks so try to come and be a part of it if you really care and want to yeah it's not going to be at a normal time but if you look on youtube for

Michael Kennedythe upcoming version live stream. It is at the time. So I believe that's noon Pacific on Tuesday, the 13th.

Calvin Hendryx-ParkerYeah. Join live. You won't miss the special guests.

Michael KennedyExactly. Exactly. All right. Well, we will be there as always.

Calvin Hendryx-ParkerSounds good. See you then.

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