Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #307: Your Python just got faster (3.11 is out!)

Return to episode page view on github
Recorded on Wednesday, Oct 26, 2022.

00:00 Hello, and welcome to python bytes where we deliver Python news and headlines directly to your earbuds. This is Episode 307, recorded October 26. And I am Brian knockin and Michael Kennedy. Yay. Well, it's pretty exciting here in Python world this week.

00:17 Oh, it's a big, it's a big deal this week. Absolutely. Big deal.

00:21 So Tell, tell us why it's a big deal.

00:23 We've talked about Python being faster and new features coming along. But primarily I the most, I would say there's like two ends of the spectrum that people have been really looking forward to. One is, wouldn't it be great if you did nothing and your code ran? 50% faster. Brian, you and I are of similar age. And I remember, it was just like, Well wait till next year till I get a new computer. And that program that's a little sluggish is going to be zooming along. Right? And just like computers would just double in speed all the time. And we don't get so much that anymore. But with Python, we kind of do this this time around.

01:00 Yeah. I remember like also like adding more memory and trying to detect whether I could tell the difference for the $100. I spent.

01:08 Yes, exactly. Exactly. Or optimizing your low mem versus high mem. I mean, that's going back aways. But the big news is Python 311 is out. Oh,

01:19 yay. Yeah. We should have had like champagne or something.

01:23 Yeah. Yeah, pop some cork. So very big news. I'm super excited about it. The I told you there's this end of the spectrum. The other end of things that people seem to be psyched about across the board is better error messages. Yeah.

01:37 Oh, mean, it's very important for debugging and also for teaching people and learning Python. So

01:43 yeah, absolutely. Absolutely. I got to pull this one off just for nostalgia sake, Dave and the audience's back when we had turbo buttons, or computers that you literally had a button that said turbo, I remember when I got my Pentium 90 and had a turbo button on like, yes. What it really meant is if it was off, it would run in like some weird retro slow mode. So I would like play MechWarrior. And what were they stuff like zoom around insanely fast. But if you took off turbo, you could play some of the older games, because they weren't based on time they were based on framerate. Anyway, crazy, crazy, crazy memories. So we're kind of getting that cool, like definitely a speed thing here. So there's a ton of stuff to talk about in terms of what's available here. Before I get into the details, I want to point out on YouTube, which I'm linking to, I found discord lemon over there, hosted a live stream of the release. So this is not a party celebrating the release. But this is live broadcasting of the actions and the steps as it's been released, like, Okay, the final one is built, okay, we pushed it to the Microsoft Store for Windows, Windows Store install, now we pushed it to, you know, python.org. Now it's over here and like, right, like the actual pushing of the deployment. And there's a bunch of interesting things that happened there. And along the way, they talk about some of the features. I'm gonna have a subset of the people that were there, and apparently 46 hours on Friday on talk Python to make an episode out of it there as well.

03:11 That's pretty cool. It's neat that they do that. Yeah, you can just watch the process.

03:17 Yeah, it is cool that they do that. And I certainly I saw a pop up and like these guys are going live. I'm like, oh, that's playing in the background. While I'm working today, you know, I'm going to be apparently at 80% capacity of like getting stuff done, but I'm going to enjoy it a lot. Also, we have a logo, which is not the official Python logo, but a Python 311 logo. And it has like little it's like a two snakes. But they're not the Python, you know, cartoon dramatic like sort of stylized snakes or just look like snakes. And it says faster price on Python exception groups and accept star typing improvements. And like literally, the logo basically is the release notes. But it hasn't lightning bolt in the middle. I guess that means fast? I think so. I think so. Alright, so let's see major new changes. We've got fine grained error locations and trace Max, let me see if I can get it to show us some interesting example here. Yeah, this is super cool. So check. There's a line if you just follow the PEP, they're just an example of suppose you're calling like a complicated JSON API, and you get this data back and you store in a variable x. And you've got to go to some field in the JSON document and then further down the further down and further down and like either to get or set a value. So here it has x bracket of a bracket of B bracket of C bracket of D so you're like diving from like level ABCD. In the JSON document. If you get the error, none type is an object is not some scriptable. You know, write something there was none.

04:51 Yeah, but your four levels deep. Which one was it? Right? It could have been B

04:55 wasn't subscript double, or it could have been C or it could have like you don't know where? And so what a hassle Right. And you do print statements. And that's when you do debugging statements. That's when you maybe let Make that four different lines. So you see which line crashes one through 11. Now it just says, tilde tilde tilde, carrot, carrot carrot. Look, it's, you had x of A of B of C. It's C, that was the nun thing. That's what Tom was. Actually I suspect that problem. Yeah, I guess that's probably see, we tried to get D out of none. And C was known as probably where there was, yeah, but it points like, right, where these problems is, problems are throughout there. Yeah, really neat.

05:36 was a whole bunch of others. Yeah, there's a bunch of other ways that they're highlighting where the problem is.

05:41 The if you go through, there's a bunch of cool examples here. But basically, you end up with within complex expressions mult, you know, multiple things happening on one line, and so on, you get nice details. They're pretty cool. So that's just one of them. But I would say, if you don't care about performance, that's probably what you might consider the highlight. If you're an async, IO async and await type person async exception groups, PEP, 564, and accept star are pretty interesting. Because if I start three tasks, and I wait on them, and two of them have errors, which exception do I get? Do I get the one from the first one or don't get the one from the second one? So it would be great to be able to say, to the three things failed? Here are their problems, right? So you can kind of get a holistic view of what's happening. That's great.

06:32 Yeah, I'm actually I'm actually, I'm, I still got my head around this completely. But I'm curious to see how that this will change, sort of Python style, because this changes how you can write exception handling. So

06:47 indeed, a higher level async frameworks like trio and any IO have this concept of starting and managing a series of tasks together as a group. So if I'm going to save an entry in the database, I'm going to call an API, and I'm going to create a file and those are all the all the result of like, I want to create a new user, I want to do whatever right. You might want to be able to say I want to start all those and wait for them to finish. Or if I start a couple of them to decide I want to bail out cancel all of them, or if one fails, and so on. We've got this concept of a task group in async. Io and changes to the task cancellation semantics. And it's interesting, we've got, you know, PEP 657 was the traceback enhancement. 654 was the exception groups, but the task groups is G H. 90908. th stands for GitHub. Okay. So it's news to me that this, these features get added through just a GitHub issue rather than a proper, you know, PEP. But anyway, yeah. Pretty neat.

08:05 Maybe you're pronouncing th is like like,

08:11 exactly. Let's see, Henry has some cool comments falling up out there, Shriner. Thanks, is catters is already using exception groups via backport exception group. It is fantastic and really does change Python exceptions. So cool. Cool extra information there. Alright, let's keep going. You've already talked about tamo lib being built in, like now that we have pi Project dot Thomas, we really have external libraries in order to understand them.

08:37 Yeah, now we know we get to do the the if block if if if important total lib or you know the try accept around it to be

08:47 exactly. Oh, fun. Yeah. However,

08:51 it is a good thing, though. I'm glad for that. Yep.

08:54 There's changes to regular expressions, if you care, you know. Alright. And then we've got basically a general statement saying the faster CPython project is already yielding some exciting results. That is Mark Shannon, given Rossum and a bunch of other folks, Grant and others are working on this. And it says already Lindsey, exciting results and Python 311 is 10 to 60% Faster than just 310. That is just from last year, right? Hence the turbo button. On average, we measured a 1.22 or otherwise known as 22%. We hit up on the benchmarks for Python tests. So our Python benchmarks are C faster Python for details, right? There's already some of those who are making the 310 through 11 is getting more 312 is getting more and it's it's just a first down payment, I guess. But it's really great to see that happening. Yeah, a bunch of Yeah, a bunch of stuff around typing. It was a lot What are the other highlights there? Two things that are worth calling out here, I would say one is self. It's good to be self aware. Right, right. Yeah, it is. And so Python classes can now understand that they they to have a self, even though they say self all over the place like no other language, right like this in C++, and C# is a thing can but not must use, or you got to say self. So ironically, the typing system now also understands self. And you can say, what the problem was before, if I'm in a class and I have a method of that class that returns an instance of that class, the class is not yet defined as far as pythons concerned until you're to the end. So I can't say the return type is the name of the class. Because until you're done, the class is not defined, right? It's like this weird error. So what you can say is it returns self. And whatever self is, that's what it returns. And one of the changes and difficulties was to make this work with inheritance.

10:59 Yeah, I mean, like in C, or C++, you have to pre declare the type ahead of time. But then, yeah, anyway, we didn't have declarations in Python. So

11:10 we don't know why we don't have a two pass compiler that like stands for types, and then expands out the details.

11:17 And do you know what variadic generics are? Putting you on the spot? Sorry, you are putting

11:23 on the spot? Let's, let's see,

11:27 I just want to use the word more. I

11:28 know it sounds like yes, I do have a PhD in computer science enables the creation of generic parameterize generics, parameterised with a single type. So this is something I don't do any much of Python types, you can create a type variable that then defines the type of a thing and then use that variable. It's kind of like templates a little bit. And so this has to do with that. Okay. You look at the example you say I created I axis, one is like a type. And then I can say I have an array, which is of type, you know, a generic of axis y axis one, right? Like, kind of now, it's kind of left that kind of stuff behind in C++, like the

12:13 multiple, good, Some, somebody's helping us out, Dean is saying, when I learned about generics, I thought maybe we've gone too far with typing.

12:26 You don't one thing that's nice about Python is often you don't have to know or care or concern. You know, that doesn't apply to me yet. Maybe someday. Not right now. There's other stuff. Of course, the last one, I think is what is noteworthy has to do with limiting the spread of little Bobby Tables, let's say. And these are arbitrary, literal string types. So the idea is, if you've got, say, like SQL query, it would be great to somehow define, here's a string that I want to put into code. But I don't want to it's kind of like a static string, in a sense, like it can't be modified or added against non literal strings. So the example says, look, I've got select star from data where user ID equals F string curly user ID. And if you say user 123, good, but you also might say user 123, semicolon DROP TABLE, data semicolon? Or you could do you want to get all the records, you say, user 123, or one equals one, right? Like these are bad. So what you can do with these now is you can come up with literal strings. And they in order to make the query work, you have to use database parameters. You just put like a placeholder in the string that never changes. And that way, basically your string in a sense of safe from injection,

13:50 okay, yeah, but you can still, you still can pass parameters, and you just have to do it a different way.

13:55 Right. And so in this example, they have select, select user dot name, user age, from data where user ID is question mark, that's the indicator of a sequel parameter. And then you say connection, execute, given that string, and then you pass the parameter, which has the valid user ID, and then the database engine knows like that, can't I truncate a statement? Right? It can't sort of modify the command you said. What's notable, though, is you can also add on things you can change it and combine it with other literal strings, but not with non literal strings.

14:29 Interesting. Yeah.

14:31 That's what this literal string type is. Here, and, yeah. Anyway, so people can check that out. I think that's, you know, that's going to be useful in a lot of situations where you're trying to be safe with user input, basically. Yeah. All right. Is that it? I think that might be all the highlights. Yeah, there's a Go Go get your version. I've already brew installed my 311

14:59 which you brew in Install, okay.

15:02 I did I. Now if you just say brew install python three, you'll get three, you'll get 310 Seven, I think, or eight or something, you won't get 311. But you can ru install Python, it gets at 311, or at three dot 11, you'll have to have to look, I don't remember the exact command, but there's a way to say no, I want the Cutting Edge version. And I was already final thought on this, we'll move on, I was already given a small cut by it. We were I was so the Python bytes website is based on beanie, the MongoDB Pydantic combo of glory. Because it's all async. It's based on Moto, the async driver for Python, for Python and MongoDB. From the MongoDB. Folks, they built that thing in the super early days before async. And await was a thing based on tornado. So they don't use async def further async functions, they put at async io.co routine as a decorator on all their async functions. Well, that was awesome until 311, where that was removed from the runtime. So that doesn't work anymore. And it doesn't run so well either. So the Moto people had to rush out 311 Yesterday, after much conversation of like, you guys realize, you should have tested on 311 beta or RC one or RC two or any other release at some point because clearly this code was never going to run and you should have known straightaway, but at least they fixed it quickly.

16:33 Okay, so Henry wants to know, how did you find it? Apparently it's on unmerged PR.

16:40 Perhaps I just did brew update brew outdated, and it said new recipe or new whatever they call it, whatever it calls those things, that new recipe Python 311. I said, oh, cool, non stop Python 311. Okay. That's how I know.

16:55 So I want to stick with things install things a little bit. Because I would think that you're probably a power user. I mean, kinda, you know, Python, pretty much you're doing trying to be cutting edge and everything. I think that a lot of Python bloggers and social media, people that are famous in Python, are probably the power user kind of people. And they tell people weird things, I think like like brew and salt, I just brew and stuff. And I don't think it's a good idea. So I'm gonna get on a soapbox a little bit and say, I find it I wrote an article on how to install Python. And it's installing Python 311 on Mac or Windows. And we'll get to Linux in a bit. But so the gist is, you go to python.org, you hover over downloads, and you click download. And then the thing that gets installed, you install it. Now you're done. So, okay, so why did this deserve an entire article? Well, because I think a lot of people are teaching people to do like saying, just brew, install it or do do pi in and, and pi and I, anyway, we'll get to there. But so I just want to tell people, how long does it take, it takes about a minute, I took a did it a time did on both my Mac, and did it on a Windows machine, and just installing everything takes Yeah, took about a minute, minute and 13 seconds on my Mac. And this is including me having to hit stuff. So it's also my delay. And then also did it on Windows, it took like twice as long. But I was tunneled through a VPN and firewalls and stuff. So they probably, it's probably all that is pretty fast. You can have it doesn't uninstall anything. So you can have multiple versions. So it will like if you if you use that sort of download link for like the latest like 310 Eight, it'll, it'll go over the top of 310 Seven, I think at least on Mac, it does that. But that's okay, it's kind of what I want. I've got 310 You can have multiple, I got 310 373 11 all on my machine just with those links. And if the 311 just is the default, I just I think it's the newest one and the oldest anyway, it modifies the Z profile, your dot z profile, and it shows up as the latest one. Now, if I had 310 before, what if I go back and install the update my 310? Will it make 310s? And the default? No it doesn't it leaves it alone because it was already in there and leaves it be but you should check anyway if you're gonna go back and installed versions and talks works just great with it. So why am I kind of ranting on this is because a lot of people try to say homebrew and if you're a homebrew user, you're not going to look for this blog anyway. You're just going to try to do it with homebrew. Great, go for it. Perfect and pi NS I think there's some places for it. But Python is about managing different versions and having multiple live at the same time and different projects use different ones. It's not just an easy installer. And since it does all that other stuff, I don't think people should recommend it. For newbies. It's not the it's not the right tool for somebody new to Python, I think it's just going to confuse the heck out of people. So that said, the I walked through the whole thing in this article, but I also admit that it's Mac focused. But on the windows, you just I did a little blurb on Windows two, the thing I want to tell people that I sometimes forget on the Windows install is go slow when you're clicking through everything so that you can select the advanced features. And you probably want add Python to environmental variables that makes it so that just shows up in your path. Because you can add that to your path manually. Or you can let the installer do it. And I like to have the installer to it. So that's that's my rant. I think that for most people, just use the default installer.

21:07 Yeah, I think that's totally good advice. Let's see. Yeah, like, like, I also did that the other day before it came out and brew, I'm like, Oh, let me just put it over here. And see, I wanted to test some things. And I had 311. And they were both totally content next to each other from those installers. I just decided to take three nine out because I didn't really, I don't really need that. I've got it from homebrew as well already. So but they do they do coexist is fine. And here's what the brew statement is. It's new formula formulae. And it's Python at three dot 11. Is what you can. Okay. So

21:44 nice. Yeah. And as for Linux, people, I think it's I think it's sort of funny that people try to tell him how to install Python articles. Talk about Linux stuff. Linux, people already know how to install their stuff, don't think I mean?

21:58 Yes, but although it's more complicated, because Python is broken into a bunch of pieces. Do you want Python? Or do you want the Python Dev bit? Or do you need to build essentials? Or like, there's a lot of like, you know, the V, do you need python three dash v and v. If you want to create a like, a virtual environments don't come with Python when you app installer, which is like what? Okay, but they do on Mac and Windows? Yes, exactly. At least the error messages. You don't have this, should you apt install Python? Three dash V. V? Yes, I should let me copy and paste Hold on. Okay. All right. See Roman out in the audience there. Roman, I've got some shoutouts for you and a little bit and in the past if you aren't here. But before we get to those, I want to tell you about this week's sponsor, Microsoft, founders hub, or software startups, founders hub, has they have been recently big supporters of the show, we really appreciate it. And if you're out there either starting a business or want to start a business better know that it's, it's not easy, right? Within the first year 90% of startups go out of business. That's not amazing. So the folks over at Microsoft for startups set out to understand what are the problems that people are running into? And how could they help. So they came up with Microsoft for startups, founders hub. And the idea is that you get at any stage of your startup free resources to grow and thrive. So you get 1000s of dollars of Cloud Credits for things like Azure and GitHub, and deep, deep mind that look, open AI sorry, for those types of things, and as your startup grows and presses, you get many, many more of those, but you also get the poor in the form of mentorship and connections. Brian, you're not in Silicon Valley, or, you know, neither my by choice, by the way, and most people out there listening or not either, but having the connections of like, hey, let's meet up with so and so for coffee and talk about this new project and see if there's a connection there, right. Like those, those kinds of things are incredibly powerful. And they've given people in locations like that huge advantages. So the other thing you get with this is access to a mentorship network, the ability to book one on ones with meetings, one on one meetings with mentors, many of whom are founders themselves. You can talk about things like marketing or fundraising or whatever you need. So if you want to get started, make your dream your company a reality today with the critical support you get from Microsoft for startups founders hub, you don't have to be third party validated. You don't have to be venture backed or part of some kind of accelerator. Just go and apply for free by them by SATA Femslash founders hub 2022 Link is in your show notes. Check them out. Pretty cool program. Very cool, indeed. All right. Ready for some awards. got the red carpet out? The champagne? I more champagne or similar some kind of theme of that year celebration. Yeah. So let's talk about the bosses. So the bosses, this is info world's 2022 bossy awards celebrate the most important and innovative solution, or application development, DevOps, analytics and what are the year? So let's go these are open source,

25:24 best open source software I like where does boss come from? Okay.

25:30 There's a bunch that are interesting, but we'll go through, you can go through very fast. There's like a delay. The I guess what you pay attention they actually take it in. So maybe really quick, just because it's the first one is there's Alma Linux, which is a free Linux OS for the community by the community that is like, an Enterprise Linux distribution focused on stability. So that might be cool. Check it out. I know a lot of people think there you have to bear with me as I make my way through this thing as it won't let me go any faster. Well, let's do the first one. There. So there's a lot of Java in here, actually, which we'll get back to in a joke later, that'll be fine. Like J hipster. I mean, greetings, Java hipster. That's a pretty awesome project. But

26:15 hipster that seems sort of anachronistic,

26:19 you know, you got to this is part of that self talk thing are you like, try to talk yourself up a little? Alright, maybe maybe number one, I want to give a shout out to add number one as in number 10. In the list is why some time, a fast and secure runtime for WebAssembly outside of the browser. So if you think about what no Jas did for JavaScript, like JavaScript used to be this thing you did on web front end. And then somebody said, We rip that into and out. It could be a server side technology, or a client side technology that is not in a browser at all, but just yeah, it becomes a programming language, long as we have a runtime that everyone likes and works with. Well, this is like that, but for WebAssembly, right. And so what's interesting is if you want to go and run a Python code, and you don't want to worry about making sure that Python is set up and all those things, you could just get, say something like pi script and ship it to run on top of wasum time. And there you go. So you just say wasum time, and then some wasum output, which could be no your code. And let's see if they have over here on pipe. Yeah, we have wasm time 2.0, which is the Python embedding of wasm. Time. So there you go. Take your Python code. And off he goes.

27:37 That's pretty cool. So Michael, what time is it? It's what has some time?

27:42 Like, wait, what is awesome? Yeah. So you just write your code and Python. And then you could go and run it, which is be pretty excellent. Also, some of the interesting about wasum is it allows for interoperability. So if I wanted to do C dotnet, Python, and rust, have those all talk together? Because I don't know, I couldn't decide or I don't know, whatever reason, right? You could have them all converted Bill was awesome. And then integrate there as well. So there's some pretty interesting runtime and deployment things here. Anyway, so that was one of the winners right behind it. One of the biggest winners in our world, it's gotta be pi script. Right? Yeah. It's just ad is there's a bunch of stuff here that I don't care about. But number 14, sentry dice error monitoring, I was just using this to track down some errors that I introduced with trying to run Python 311 and beenie. Before it was time, but it told me exactly what's going on. And I figured, okay, that's a motor problem, I was able to track that down, which is pretty excellent. Let's see few more here that are fun, almost envy Dev. If you're doing notebook stuff, and you want to be able to test your notebooks or clean them up before you check them in. Or you want to turn notebooks into a Python package where certain actions in a cell become functions in your Python package and deployed to pi Bi. All those crazy things and be Dev. So those are pretty interesting. Accelerate. I think this is from login face, but I can't quite tell. Yeah, just hugging face. That's what it is. It's a way to build, train and deploy state of the art models powered by open source. So anyway, it looks looks interesting. If you're into that stable diffusion. Do you need to have a bear that has just landed on the moon? Well, go in there, you can create those funky, funky AI art things. So anyway, there's a bunch of fun projects in this 2022 bosses award list.

29:56 That's pretty great.

29:57 Yep. All right. Yeah. Well, it's got its why some time.

30:05 Yeah. We talked about Wilmot Coogan a lot and stuff. And so it was in the audience, it will. So one of the things that if you follow well on Twitter, he shows a whole bunch of cool examples of stuff he's working on. But you haven't been able to play with it. Because he's been sneaky about it. And it's been on us. Well, it's not sneaky, but it's been on a CSS branch different branch of their, their code base on textual eyes or textual. So, so now we can play with it. Because as of October 22, textual oh point zero point 2.0. Wow, big jump in numbers there, guys. But it released and it has all of the CSS branch stuff merged in. So other really cool fun things that you can do that look like web development, and but they're in in CLI. Now I can start playing with them because they emerged in one of the things that I'm glad that they waited a little while for, because they, they were looking for API stability. But also, they wanted to finalize the documentation, at the same time before they released it to everybody, officially. So they've got a tutorial written, which is really kind of nice. It's a little stopwatch application that kind of walks through, and it walks through all the different pieces of, of how you how you use texturize. And with their CSS, and it's got going through writing through the CSS, the dynamic pneus of it, reactive attributes. This, this really, really looks great. I haven't gone through it yet. But it looks awesome. And then, and then they went through and updated the texture lies Guide, which has, you know, it goes goes through all the different examples, and I've got my screen shrink up too far. So it doesn't show everything. But anyway, really great stuff in this. In this this manual. Good job guys had. Awesome. So I can't wait to play with it.

32:07 Yeah, who knew that we could treat treat terminals as high refresh rate, general rendering engines? It's I feel like the stuff that we'll and crew are highlighting here is a little bit like what you could do with JavaScript canvases. Right? You're like, Oh, guess what you could actually do, which is, you know, like our software here stream yard that we're using to live stream. That's right. It's like, Who would have ever thought you could have done this, it just a web browser without plugins, right. And here we are.

32:35 And I also just heard will talking about this on changelog. Just recently, one of the more recent change logs, he's talking about this release, which is pretty cool. Although we'll I gotta say I'm a little disappointed. Because they asked how how you how you became rich and textual, have gained so much popularity so quickly. And you didn't even mention us. Just come on, anyway.

33:09 Cool. Anyway, that's it for our items. And since I've been kind of under the weather, I don't have any extras. Do you have any extras for us?

33:18 You know, that I do. I've got a bunch of things. I'll go quick through them. So I recently did a fun video.

33:25 I know that guy. Yeah, I

33:26 did a video where I added, I did the live coding on top of Python training, actually adding the feature for the search over here. So I rewrote the search, you pointed out that pi test is a fun thing to type in there, right? I guess is good. You might search for postman, and grok. And you get your your search results there. But it's cool hierarchy thing. But when I first wrote that it was like super slow. And the techniques that I use to debug that figure out what's going on make it faster. The video says 17. But like in an extreme case, it was actually 80 times faster. There's just some really cool techniques of walking through like, oh, how could you like use logging in the database to figure out what's happening? How can you use the profiling and how we use dictionaries so that we can convert like 100 database calls into one even though there's not a natural join story going on. So if people want to follow up, go check out that video. That's lots of fun in the show notes from get the name right here also from Ryan sheftall. If you're into stock markets, and so on and you want use pandas. Here's a project called pandas market calendars. It's a monkey counters used with Pandas for trading applications. So it has things like winter the markets opening and closing. Is that our holiday is there some other weird event that's changing the start to close time? Alright, so just a cool little library to bring that into your pandas code. And I believe pandas came out of New York Orkin, the whole trading industry over there. So that's good shout outs for Roman right? Who's out in the audience here, Roman? We recently. So when beanie came out beanies fantastic MongoDB library, what FastAPI did for API's, Beanie does for MongoDB, right? It takes Pydantic, and turns it into a really cool API that then use instead of creating just classes or whatever, right. So all the benefits of having Pydantic Plus MongoDB. And when it came out, it was only async, which is awesome when you're doing async stuff, right? Without it, you can't do all the really high scale high concurrency things. But there's plenty of times where like, I don't want that I just want to call this function. And I'm in the middle of a script that has no business being async. But you gave me an async only function. So now I gotta figure out how to like spin up a loop and run this thing. And wait for it, when I just want to call the function. So in addition to the standard async model, Roman added a beanie dot sync sub module where you can get a sync document and you get a you can initialize a synchronous database connection, and then all of your queries and everything become just straight up. Synchronous calls, like on more traditional database engines and our database RMS Oh, DMS. Okay. Yeah. So excellent work out there.

36:23 Good job. Keep it up on that cool product are

36:27 super cool. Yeah, I love it. Ah, Duck Duck go has released a web browser. Just when you thought Chrome has taken over everything. Duck Duck go says, nope. Or like quack now or whatever Duck Duck does when they communicate. And right now it's Mac only, but it's coming out for Windows pretty soon as well. And it's a privacy focused database.

36:51 Web browser?

36:52 Yes, I see Davis Yeah, web browser. But let me let me show you. I can even show you real quick. Here it is. Install it? Oh, of course I did. Why wouldn't I do that? Here it is. So we go over here we go to Python bytes dot F M. And if you pull this up, why not? didn't add to stream? There we go. So come over here to Python bytes. And it'll click on this, it'll show you where all the tracking is like notice now Google Analytics, no other tracking. But Where shall we go look similar, super egregious, where you go to cnn.com. And remember, this is using already. Next DNS. And other blocking. So a lot of the blocking happens before it gets here. But if you pull it up, it will still say look at all these different things we blocked. And here's the tracking. Here's the advertising. Again, many of these are already blocked, before it gets to the network. So it'd be 30 or 40. Easy. So that's pretty cool. But I don't know, I'm not, I'm not switching over to it yet. I hope hopefully they can do better. You can't do things like set your DNS servers for say DNS over HTTPS that you can like have more control over that. There's, there's a lot of things that are are not there as a really cool way to play YouTube videos and like a private window. So if you go over to YouTube, and you hit play, it'll would you like to play this in a non tracking, non algorithmic beating sort of way, which is great, but you know what you have over on YouTube hotkeys. I can type F for fullscreen or T to like go wide theater mode or I from any player, it doesn't have any of those types of things right. And so it's like super, super early, but so in that regard, I'm I'm not really psyched or recommending it, but it's awesome that they're trying I liked that go I'd like to see him make progress here and they were the fire button, which you can just clear all the stuff up and get a cool animation. What does that do just iterates erases like all history and closes all tabs and, and everything. Oh, cool. Yeah. Anyway, there you go. I think I've got one more thing to share. But I gotta share my screen back because that nabbed it. Yeah, last last one here before we get to a joke. So I want to give credit here This one comes from will shanks. Apparently remember when we talked about int, like I empty parentheses some string like quote 123, close quote that had a security patch in Python 310 Seven, because if you send it the right, malicious, a huge number of string it can get into like some denial of service where like works for an insane amount of time trying to figure out what that number is by parsing it. Not just a big number, but like a specifically bad big number, I think was the problem. Okay, so in three 310 Seven, they said you know what, we're going to limit the size of ENT to either like 994 with 100 zeros or something after right at the time you and I spoke about remember when we did C and C++ and C# and we don't think about shorts And, you know, 32 bit integers and 64 bit integers? And would it be bigger or smaller than 32,000? Do we need to worry? And like that number is so huge. Like, we probably don't think about it. Some people do in particular, the scientific folks, too over on conda Forge, there's a big conversation about what to do here. Like, should we adopt this? Should we say this is like too much of a problem? Men don't really know how they're going to avoid eventually adopting it. Because like every version of Python going forward, is going to have this in it. Right? They don't want to eventually, like permanently be held back. But on the other side, the What's it Ubuntu? And they look, yeah, Ubuntu has decided to patch out that into limit. So basically unravel that security fix and preserve the behavior, previous behavior, thinking that the risk is low of getting an integer like that, and it's not worth breaking compatibility for. Okay, now, apparently, int, open parenthesis string close for the C is still controversial. Who knew? Me? Yeah, me? Yeah. All right. Let's see. Robert Robertson is in Python bytes. Episode 311. Is that going to be a special episode covering Python? 311? I don't know. But we got five weeks to figure it out. And it's a great idea, Robert. Sure. Because I didn't see that coming. Yeah, we should have coordinated with the Python folks could have just released like, five really short episodes like the waiting. No. can skip to the next one. All right. Well, that's all I got. Oh, my God. All right.

41:36 Okay. Extras. Well, one of the things I want to an extra from the audience. Dean langsam idea that T L V. Tel Aviv. Tel Aviv is on December 13 in there, and they have tickets up for sale. And there's a code. So if you use discount code byt. Yes, you get a discount, I guess. So. That's nice.

42:00 Awesome. Yeah. Good luck with the conference there, Dean. And how badly city to visit if you get a chance to.

42:05 Okay, cool. How about something funny?

42:09 Yes. All right.

42:12 Once was moved house.

42:15 Here we go. See if I can open the image on glorious. to Brian, I was thinking about getting a new monitor, I have a fine monitor. It's like a 32 inch 4k monitor. But I want to play kind of widescreen. There's this cool, like horizontal resolution equivalent for K but it was 40. It was either 40 or 49 inches wide. It was epic, but I didn't get it. So I didn't get it. Because I thought the curved monitor might be like parabolic echoes for all the work that we do here. And also didn't get it because well, it's expensive. And I don't know if I can get it into the resolutions I want for recordings and things like that. But here's somebody who posted a picture it says develop in Java be like, and it's got I think that's a 49 inch curved widescreen monitor, small font. It's edge to edge code. There's no PEP eight ideas on this right? Look at that. Does that nudge those nuts? Yeah, yeah. And the subtitles be like, I heard you like getters, which apparently, you know, no properties and all that. But anyway, I just thought you all might enjoy just checking out this picture of an insane bit of code like something's gone wrong. Maybe you need you actually need the full width of a 49 inch monitor. I was thinking to put in a couple of windows side by side. I don't know, call me crazy.

43:38 I just measured mine immense, like, I have to measure it. I think it's like 30 something. But it's got a bit of a curve. But the I have to I it's painful to watch that. And I'm not gonna throw rocks at this class house because I'm a C++ developer. And we've got a few pieces of gnarly code that have big long lines. Yeah, for the

44:03 multiple inheritance multiple template.

44:09 Oh, yeah. Bad naming sometimes, then that happens in Java to get the long names.

44:17 Well, the problem is you got to get a name something and then you got to have a factories or something and you got to have an eye factory interface of that something and yeah, I've got a mock it out anyway, it gets complicated and the names get long understand.

44:30 And you get have to get a mock mock factory in the name factory. In fact, your factory.

44:34 Right. If there's not the audience has identified the coding style here as a PEP infinity instead of Pepe. That's PEP infinity code. PEP infinity.

44:47 Yeah, well, this

44:48 was infinitely fun. Thank you, Brian. And thanks, everyone for being here.

44:51 Thank you. I'll talk to you later. Bye. Bye.

Back to show page