Python Bytes - #421 22 years old

Episode Date: February 24, 2025

Topics covered in this episode: httpdbg PyPI Now Supports iOS and Android Wheels for Mobile Python Development Arcade Game Platform goes 3.0 PEP 765 – Disallow return/break/continue that exit a f...inally block Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky) Brian: @brianokken@fosstodon.org / @brianokken.bsky.social Show: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am 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: httpdbg A tool for Python developers to easily debug the HTTP(S) client requests in a Python program. To use it, execute your program using the pyhttpdbg command instead of python and that's it. Open a browser to http://localhost:4909 to view the requests Brian #2: PyPI Now Supports iOS and Android Wheels for Mobile Python Development Sara Gooding “the Python Packaging Index (PyPI) has officially begun accepting and distributing pre-compiled binary packages, known as "wheels," for both iOS and Android platforms. “ Next up, “cibuildwheel Updates Are in Progress to Simplify iOS and Android Wheel Creation” Michael #3: Arcade Game Platform goes 3.0 via Maic Siemering This is our first major release since 2022. It keeps the beginner-friendly API while adding power and efficiency. Arcade now supports both standard OpenGL and ShaderToy (www.shadertoy.com) a-shaders through a compatibility layer. Since 3.0 is a major release, the full list of changes is over in github.com/pythonarcade/arcade/blob/development/CHANGELOG.md Brian #4: PEP 765 – Disallow return/break/continue that exit a finally block Accepted for Python 3.14 I wouldn’t have thought to do this anyway, but it’s weird, so don’t. Will become a SyntaxWarning catchable by running with -We Extras Brian: Correction: Niki Tonsky was originator of “Pride Versioning”. Thanks Nikita Correction: Scheme is actually awesome. Brian is just a curmudgeon Also: pytest-rerunfailures is good for exposing flaky tests And apparently me being wrong was a great to get at least one person to blog more. Cheers Filip Łajszczak Michael: Tea pot follow up While you're right that some software actually had this implemented, Python does not. It's not an officially accepted HTTP status code, it was proposed in a 'joke' RFC. I guess Python - even though its name comes from the funny TV series Monty Python - is not so funny. httpx, your (or at least -my-) favorite HTTP module for python, does have the I_AM_A_TEAPOT constant. By the way, there are some HTTP status codes that changed their names in RFC 9110, for instance, http.HTTPStatus.UNPROCESSABLE_CONTENT (422, previously UNPROCESSABLE_ENTITY) Pride follow up fosstodon.org/@kytta/114034442981727301 Time to upgrade your mini? Joke: How old is she?

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds. This is episode 421 recorded February 24th and I'm Brian Ocken. I'm Michael Kennedy. And this fabulous episode is sponsored by all of you folks that support us at like maybe taking a course over at TalkPythonTraining or heading to PythonTest.com learning about PyTest maybe taking a course. We also love training or heading to python test.com. Learn about PyTest, maybe take it of course. We also love our Patreon supporters. So thank you. If you'd like to connect with us, of course you can check there's six links in the show notes for the show and me and Michael over at blue sky or um, Fosted on or Mastodon. So keeping track of both of those.
Starting point is 00:00:42 And if you'd ever like to jump into the show live, you can head to pythonbites.fm slash live and check out when the next recording will be and you can be with us and ask questions and stuff. And it's fun. And finally, the newsletter is still going out and Michael's made some improvements to it. So we're making some neat things.
Starting point is 00:01:06 And I think it's a really cool resource now. If you are, especially if sometimes you listen to the show and you're like, that seems like a cool topic but I don't quite know much about that thing that they're talking about. We're including some background information. So if you'd like to learn more about the topic, we're including a lot of links and that's really cool. Yeah, super fun. Yeah. Speaking of super fun,
Starting point is 00:01:29 what's your first topic for us, Michael? You know what is super fun? Debugging is super fun. Because testing is sometimes fun, but debugging, that's where the mysteries really live. You never know. And if you don't do much testing, you might do more debugging. You never know. Anyway, I want to talk about debugging HTTP calls. Now one way in which you might do this is you might say, I have this well factored piece of code over here and I can call this function and we can in isolation test how it talks to some part, something else in the world. Right.
Starting point is 00:02:00 And maybe we'll mock the HTTP layer out. We talked about REST, RSPX, which was a cool way to mock out HTTPX, and there's VCR and other things like that, which you might do. But this kind of allows you to intercept what's actually happening. You could use it during tests, or you could use it just when your app is running.
Starting point is 00:02:21 All the HTTP calls coming out of your Python app, and then gives you a UI for understanding them. Pretty darn cool I think. Yeah. Okay. So what you do is the thing is called HTTP DBG for debug because those two vowels are hard work folks. And so HTTP debug tool is for Python developers to easily debug HTTP or HTTPS client requests in a Python program. All you got to do to use it is instead of saying Python my app, you say, hi HTTP debug my app, and it will sort of wrap and mock out all of the stuff. Mock is maybe not quite the right word because it still does the action. It's sort of put an adapter or an intercepting layer
Starting point is 00:03:05 on top of all your behaviors, right? Okay. Yeah, it's pretty cool. So you get this UI and it shows you all the requests that your app has made and then you can click on them, you can put them side by side and compare them, all those kinds of stuff, which for the grand total effort of pip install
Starting point is 00:03:22 and then run your code slightly differently but it's you know that's a lot of a lot of benefit and a lot of visibility into your app so if you're doing things like maybe using postman or something like that to kind of test out the calls and you try to replicate it over there and you're like why is it not quite the same well put this thing on it and see what happens yeah i can also see this like as a learning tool, where you're just learning how all of this stuff gets put together. Like, how does the request get, what does the data look like, and what's going on here? Yeah, absolutely. Yeah, absolutely.
Starting point is 00:03:55 And the other thing you can do is it's not just your direct HTTP calls, like say, HTTPX or request or something. If something else, a library you're using is then calling the API and it's not your library, you still get visibility into what that thing's doing. Because it's anything the application does, not anything that your code does, which is pretty cool. So if you're using, say, the Sentry API,
Starting point is 00:04:19 and you're like, why is it failing to talk to this thing? What is it even doing? You just say capture exception, but somewhere along the way HTTP request is being done. So you could intercept that as well like all the traffic. I guess if you're like is my thing spying on me? Is this library that I'm using reaching out to something that I'm not aware of that's happening? You could also catch that theoretically. But it supports requests URL of HTTPX, my fave these days, AIO HTTP, PIP PyTest, Unitest and your package.
Starting point is 00:04:50 Yes, if you include it. Anyway, there's a, then when you run it, you get a web interface that gives you some behaviors in the UI. You can change the strategy to group requests. You can hide the scheme, the network URL, you can group rows, tags, all these different things. So there you have it, folks. HTTP. I think you're supposed to just say the initials like HTTP. This is hard. HTTP DBG.
Starting point is 00:05:17 Yeah, possibly. Okay, something a little easier to pronounce. Okay, something a little easier to pronounce. PyPI now supports iOS and Android wheels for mobile Python development. This is cool, I think. Very, this is very cool. Yeah. So this is brought to us by Sarah Gooding. And so the announcement really is we there's there's been some work.
Starting point is 00:05:40 Russell Keith McGee has been a long time advocate to try to push this ball forward and get Python directly on devices better. So there's a couple of peps, 730 and 738, to talk about adding iOS and Android as a supported platform. So now they're wheels supported there. So how do we take advantage of this? Well, there are some information in the the the article that we're linking to. But also, let's see, there is there's
Starting point is 00:06:14 some tools that I've heard of beware and we've covered beware and Kivy before. And then check hope he check hope he maybe I don't think I don't know if we've covered that, but that's another one for Android. Yeah, that sounds new to me as well. I haven't, I don't remember that one. So, however, so you can either use these, but I was curious about like, so for pure Python stuff, if I want to be able, like, if I'm not doing something too fancy and I want to be able to have it be installable on one of these, what would I could possibly do? And CI build will is one of the tools that people have used before for other
Starting point is 00:06:51 app, other operating systems. And apparently that's not ready yet, but that is in the works. So a CI build wheel updates are in progress to simplify iOS and Android wheel creation. So, are in progress to simplify iOS and Android wheel creation. So soon more and more third party little libraries might be in, possibly big libraries might be available for. Yeah, that's awesome. I'm very excited for this. I think this is, you know, there's two areas of Python that are very troublesome, right? If someone comes to you and says, hey, I want to do some programming. What language are you and says, hey, I wanna do some programming,
Starting point is 00:07:25 what language are you using? Python, that's a great one. Yeah, so I'm looking to build a mobile app like this. Hold on, hold on, I totally retract my statement. You can't even, don't do that, is the one. And then the other is like, view, react, other front end JavaScript-y things, right? And what's cool is that the folks at Anaconda
Starting point is 00:07:41 are actually really working hard to address both of those. And part of what we're seeing here is some of the work from them I actually had bumping over this way. I had Russell Keith McGee on, the guy behind Beware, and to talk about the state of Python on mobile, just YouTube helped me out five days ago. Wow. To talk about this.
Starting point is 00:08:03 And he's been working, employed by Anaconda as part of their open source team for a couple years, solving these problems. Getting him and a guy named Malcolm are getting peps to have Python officially be, to have iOS and Android and an official build target of CPython, which is pretty interesting, right? Like we expect as part of the core developer process,
Starting point is 00:08:26 we should be able to build it so that it runs on those platforms. Those peps, I believe, are accepted, but not necessarily in yet. So that's like upstreaming a lot of the work that Russell has done, and they're using CI build will to make this happen. So a lot of interesting stuff happening there.
Starting point is 00:08:42 Yeah, yeah, cool. Yeah, I wasn't planning to talk about that episode But since you brought it up, it's like if you guys are like wait what what is all this about? You know listen, I don't know that much but Russell gives us the whole rundown last week so you can check that out I can't wait to listen. Yeah, definitely should be out soon. Okay No joke. How about a game though? Yeah for the games games. The game, so we got a notification from, I can't remember, oh yes, Mayak Simering, who's working on Arcade, the game platform. And it hasn't had any major updates for a while. Until now, they just released 3.0 of arcade so if you are a huge fan of Mario Brothers type of 3d 2d scrolling games or you want to build something like
Starting point is 00:09:30 asteroid you know the game from the 70s that kind of UI well this is a really great platform for it so what are the changes breaking changes but you know I guess that's expected after a while drop Python Python 3.8 seems fine after the world has moved on from there, but texture management completely changed and they used to cache everything, apparently it was too much, but now you can reload and probably things are fast enough
Starting point is 00:09:56 that you don't need caching, it works better. Like you work in memory in the graphics card or something better. Remove some stuff, fixed arcade context and so on. But mostly, I want to put this out there, if you've been thinking of building a 2D game type of thing and you're like, well, arcade's interesting, but it hasn't gotten a lot of love, well, now it has, right?
Starting point is 00:10:16 Last update yesterday. Pretty cool. If you want an example, there's some examples. Sorry, Ryan, there's some examples you can link to off of the arcade. Oh, cool. Academy website. Go ahead. No ahead. No, I just, you said it hasn't had a lot of love in a long time, but it, it's still been,
Starting point is 00:10:29 I mean, I don't know if they needed to fix some things to get it to work on modern Python. Okay. Yeah, I'm not sure if they, I don't know that they necessarily did, but it just hasn't had any major releases, you know? Well, I'm noticing. So I've been doing that top PI test plugin thing and investigating a lot of the plugins and there's a lot of the plugins and there's a lot of stuff. I'm noticing there's a lot of stuff that used to be updated a lot and for just to say like in the Trove classifiers to say I support you know 3.8, 3.9, 3.10 and then
Starting point is 00:10:57 they just sort of stop. But a lot of I guess try stuff out, because Python has been pretty stable for a lot of things. And it's been, even though we've gotten some really cool things, it's still very backwards compatible. So there's a lot of old packages that don't say that they work on modern Python, like 3.13 or something, but still do. So don't dismiss a package
Starting point is 00:11:23 just because it hasn't been updated for a while. Try it out, it might be fine. That's good advice. There's one thing where, I can't remember if it was Rust or some other platform, their equivalent of PyPI was they were automatically putting security warnings or something like that onto packages that had not had Git commit in two years.
Starting point is 00:11:45 But it might be done. There's a thing that could just completely do what it's supposed to do and not need to change anyway. So you can check out the different kinds of games. I got a bunch of example games that you can play and try out. And they look pretty cool. If you're looking for a I don't want to use Unreal Engine and go completely down the higher team of 100 people
Starting point is 00:12:04 to build a game. Yeah, that's the fun. That looks pretty cool. It does look pretty cool. Yeah. Yeah, and I think it's OpenGL based. Pretty sure, is that right? Yeah, it's built on top of Piglet and OpenGL.
Starting point is 00:12:15 Yeah, so use your graphics card for all sorts of fun stuff. Yeah, yeah. I guess I'm on tangent mode right now, I guess. I was thinking about games and a lot of people think I think a lot of kids get into like want to get into programming because they think game programming would be fun and game programming is hard. And I mean, there's a lot of programming that's hard but but became programming, there's a lot of stuff going on. And it doesn't necessarily I just don't get frustrated if you start game programming and
Starting point is 00:12:45 it's a little difficult and there's a lot of programming that's pretty straightforward. Yeah, I totally agree. I did some of my first programming was 3D simulators in OpenGL and it was not the easiest thing ever in C++. Oh, nice. Okay. Well, other things to not do is don't, okay, I think I'm gonna have too many negatives here. I just, I guess, want to announce that PEP 765 has been accepted and PEP 765 is to disallow return, break and and continue that exit a finally block. That's a lot of terms. So what am I saying? It's that there's the keywords,
Starting point is 00:13:30 return, break, and continue shouldn't show up in a finally block. And when I first saw this, I'm like, why would I do that anyway? I just don't, I usually put pretty simple stuff in finales and I wouldn't ever think to do a, I might think to do a return or anyway, the, the, the, it's just bad in the behavior apparently is surprising. So, um, so they really would hope to not have that in there. So apparently
Starting point is 00:13:57 this was rejected once before, but now it's accepted slightly different. There's a, um, the, I guess there's some, uh, cost benefit analysis of the change that was done and it will be better for everybody if we do this. However, because of some backwards compatibility stuff, um, it will not be a syntax error. It will be a syntax warning. So I guess, um, we'll, we'll rely on, um, people running with dash wa or having rougher flakate or pilage or something check this stuff for us. But basically don't do it. Just don't. It's not good. Not good. Yeah, I can sure see return in it finally. That makes a lot of sense to me. It's a little, I'm not sure why return is pulled out, but like break and continue and other looping and I could see why that's alright
Starting point is 00:14:46 But yeah, yeah, whatever. I mean, it's not hard to work around Just that yeah, so this isn't a big topic just just to be aware if you're doing something fancy within your finally blocks Pay attention to this stop stop stop apparently. Yeah. All right. We're gonna stop with our items, aren't we? Yeah, we are we got some right. Well, we're gonna stop with our items, aren't we? Yeah, we are. We got some extras. We sure do. So exciting. Let me fire some up.
Starting point is 00:15:09 So remember our teapot episode? 418, I'm a teapot. Well, we had our joke about the teapot. And I think the person who created the joke that we covered felt they didn't get enough love or something like that. Because we pulled up a post somebody had on Mastodon, Mastodon, Blue Sky, Blue Sky I think, that said, hey, funny joke, person shared it.
Starting point is 00:15:31 Well, Nikita says, important correction. We, I think it's, I created this joke, so anyway, thank you Nikita for creating this joke. It was very funny. So I'll link to that to give him a little bit of credit. Next up, Brian. It's just like a slightly different funny. So I'll link to that to give him a little bit of credit. Next up, Brian. Oh, it's just like a slightly different name. So Nikita reported it, it was a joke by Niki Tonski,
Starting point is 00:15:51 a different person. Oh, different, okay. All right, perfect. Well, thanks for the correction. So I have something really surprising. So check this out. I had a Mac Mini M1, the very, very first Apple silicon Mac that came out, the Mac Mini M1, the very, very first Apple Silicon Mac
Starting point is 00:16:06 that came out, the Mac Mini. I got it in 2020 and I remember, I think we talked about this at the time in 2020, I'd already ordered the new MacBook Pro, which was still the Intel, then I saw the Apple Silicon stuff come out and I actually canceled it and like reordered the Mini and it was best decision ever. Well, good decision.
Starting point is 00:16:23 And worked out great, but it's just been chilling around here. I've had my Mac Mini M2 Pro that's all maxed out and it's been laying around. I thought, you know, I'm not doing a lot with the other one, but I wanted to set it up so I could do easier recording. Starting to get a little slow, but you know what? I'll just live with it. I don't really need to buy a new Mini.
Starting point is 00:16:40 Like I don't need to waste the money just for that. And then for some reason I saw that Apple started having refurbished ones that you could buy and it turns out to not be a very good deal. It's like hey the refurbished one's like $5.79 the new one's $5.99. Oh wait I'll just take the new one. But I look what would my old 2020 Mac mini trade in for? Well first of all how much is a new Mac mini with the M4 10 core? Pretty much the same specs except for the hard drive and it's the brand new way way faster computer $599, 600 bucks US. Wow. My old Mini from five years ago traded for $425. What? So I got a brand new Mac Mini M4 for $175. I want
Starting point is 00:17:24 to point out to anyone else, before any of this stuff changes, you might also want to get a new Mini for $175 if you have a five year old one. How awesome is that? Yeah, I think mine's only a couple years. I should check it out. But it might be worth checking out.
Starting point is 00:17:37 And I ran it through Geekbench here, and even against my M2 Pro, which is way faster than my old Mini, this new one that was $175, a lot faster than even the M2 Pro. Single core is like 40% faster. Even multi-core is something like 20% faster for that little bit of money.
Starting point is 00:17:59 So, hey, that's just putting it on the radar. Y'all might wanna check that out. That's a pretty good trade, in my opinion. Nice. All right, that's just putting down the radar. Y'all might want to check that out. That's, that's a pretty good trade. My, my opinion. Nice. All right. That's all for my extras, but yeah, I, I just thought that that was a really surprising thing, like, you know, all right. Okay.
Starting point is 00:18:14 I have a couple, trade the mini couple extras. Um, uh, also I just really love using the mini route to record with, because it's always silent. It does. It's always silent and it's. Yeah. Um, and it's always silent. It's always silent and it's, yeah. And it's pretty cheap, even go big. But so I just went for a bottom end one.
Starting point is 00:18:30 I think I spent 400 bucks on this or something. Well, you probably can trade in and get one for like another 20 bucks. Yeah, maybe. So I have mentioned before that I'm not a fan of scheme and Lisp and I guess I just want to hit a nerve for at least one person. Philip, and I'm sorry, Philip, I'm not going to try to pronounce your last name,
Starting point is 00:18:54 but it looks cool. Lysiak, something like that. OK. Lodziak. Nice. I probably messed it up, but we'll see. OK. But he decided to, and we interacted on the,
Starting point is 00:19:07 I think Faustanon or Blue Sky or something. And just kind of, he said, you know, basically what do you got against it? I'm like, I don't have anything against Scheme really. I just personally, me, I didn't find a lot of use for it. And we talked about it and actually wrote up this big conversation with him that I need to make into a blog post because I do appreciate
Starting point is 00:19:28 that I learned Scheme, I just haven't used it a lot. So, and he said, there's a lot of uses. And I said, I'd love to hear some. And he's like, oh, okay, well then I'm gonna have to write a blog post. So he wrote, my land of Scheme in 2025. So we're gonna link to a blog post of all the cool stuff that scheme does lately,
Starting point is 00:19:49 at least from his perspective. So that's cool. And then, this is actually really, I really enjoy his writing style. So I really like good long form blog posts, but anyway, good writing style. Thanks, Philip. And he also just recently released another article,
Starting point is 00:20:05 exposing flaky tests with PyTest rerun failures. And it's a plugin that I've used a lot too. So cool writing. So keep up the blogs, people. Like it. And I'm really sorry if I have offended anybody that likes Scheme or what else? Who else can I offend?
Starting point is 00:20:24 Perl writers, C-sharp. I just don't enjoy writing C-sharp and Scheme. It isn't anything against the language. It's just not for me. So, anyway. All right. Well, I can see why it's tough, Brian. I can see why it's tough.
Starting point is 00:20:39 Actually, pulled this joke up when I thought of... I could see why it's tough. And I thought of you when I said, so question. This This is like you being too logical or you may be a tester. When I was four, my sister was two. I am now 44. How old is my sister? Programmer, easy. 44 minus four but minus two from that. That's two years difference, the gap. So, 42. Tester. Well, you see. This is a tough one. She might be 42, but she could be 41 or 43, also, since you didn't say when your birthday is
Starting point is 00:21:10 and her birthday is. Also, she could be dead. Finally, I thought she was your sister. You might have thought she was your sister, but actually your mom had an affair with another man and a woman who was one. And it turns out it's not your sister. So with that, on and on and on and on it goes,
Starting point is 00:21:26 give it away your real sister. You don't know how old she is. Finally, what if you think your sister is dead, but she actually has become an astronaut on a secret government project and she's been traveling at near light speed. Now her time is going much more slowly. She could actually be younger than 41.
Starting point is 00:21:41 You see, it's hard to be a test of right. Yeah, I like it. be a tester right. Yeah, I like it. I like Anthony's answer. Two is half a four. So if, if. Oh my God. Hey, Anthony shot in the audience. You are absolutely right. And if you go to the YouTube, the YouTube comments, it's the dog. She's 22. And then it says someone else says a fellow McDonald's graduate, I see. Yeah, that was an easy one.
Starting point is 00:22:09 Oh, follow up. That's a chat GPT answer. Last time she was half your age. Oh my gosh. Okay. Oh, and a nice inside joke there. Anthony making fun of AI since he's pretty much an AI pimp these days as far as I remember. But anyway, the comments are pretty funny as well.
Starting point is 00:22:34 And then somebody just responds to green. Awesome. Well, great to have people in the audience to chat with and be part of the show. And Brian, great to be here with you, right? It's good to be with you. Bye.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.