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


Transcript #403: A machine learning algorithm walks into a bar…

Return to episode page view on github
Recorded on Monday, Sep 30, 2024.

00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 403, recorded September 30th, last day in September.

00:10 And this is Brian Okken.

00:11 And I'm Michael Kennedy.

00:12 And if you'd like to connect with us to suggest something or whatever, you can send us a link, a contact form at pythonbytes.fm.

00:23 You can watch the show live, pythonbytes.fm/live for more information about that.

00:28 You can always, usually Mondays at 10, but you can check those out on YouTube later also.

00:35 And this episode is sponsored by us.

00:38 So check out our offerings, courses on Talk Python training and also at pythontest.com.

00:44 Also a shout out, thanks to the Patreon supporters that we still have.

00:48 And if you'd like to connect with us, you can find the links in the show notes for our Fosted on links.

00:55 So we're on Fosted on.

00:57 Also, Michael still hangs out on X sometimes, so you can get in there.

01:02 Sometimes when people talk to me over there, I'll go talk to him for sure.

01:05 All right, well, let's kick this off with a discussion very much from Mastodon.

01:11 This is a blog post from Simon Willison and the title, opening sentence, I don't know, whatever it is.

01:19 It's "UV is under discussion on Mastodon." And Jacob Kaplan Moss kicked off a fascinating conversation about UV on Mastodon, and it's worth reading the whole thing.

01:31 I think it's pretty interesting.

01:33 You know, we've got this really powerful and transformative tool that's kind of improving Python packaging.

01:40 That's been a little bit rough on various edges.

01:43 And yet it's definitely not the first one of these to come along, right?

01:48 We've got many of them that have been successful.

01:50 We have Hatch, Poetry, PDM, even PipENV and all these different things that have tried to do this.

01:57 And I don't feel like there was much controversy about them.

02:01 And it's this interesting mix of why are people worried if someone else goes and makes another attempt to work?

02:09 You know, on the other hand, I think part of the reason people are really invested in this and debating should you use UV, should you not?

02:17 Is it good for Python? Is it so effective?

02:21 And it's taking over so much that people are like, "Wait, this is the new way? This is the way things are going?"

02:27 I just think it's really fascinating that people are, I don't know, considering this.

02:32 So there's a bunch of different comments that people made.

02:36 And I'll just kind of give a flavor of it and you can go check this out.

02:40 But I think it's just interesting.

02:42 Before I jump in, I for one am a fan of UV. I think they're making really meaningful change.

02:48 And so in that sense, I'm kind of in the Hennec camp of this conversation.

02:53 So Russell Keith-McGee says, "As enthusiastic as I am about the direction UV is going, I haven't adopted them yet because I want to very much understand Astral's business model."

03:04 More on that in a minute. So that's very interesting.

03:06 Hennec says, "As much as I hate VC, FOSS projects," there's a worry that because it's VC funded, it'll flame out.

03:13 "FOSS projects flame out all the time too. If Frost lost interest in PDM, there's no PDM anymore. Same for OFEC and Hatch and so on."

03:21 So like, look, this could fix packaging and we'd have open source code to run with afterwards.

03:29 One of the concerns I think that Glyph also is the one to bring up here is that because it's written in Rust, it's more difficult for Python people to maintain.

03:38 And while I think that's fair, I think that's also there's a lot of Python that's written in C.

03:43 I mean, it's CPython.

03:45 And so to say that it's not Python is not necessarily fair, because there's a lot of things that we do in Python that are C based.

03:52 I think the difference might be there's more people currently working in Python who also know C versus people currently working in Python who also know Rust.

04:00 I think that's kind of the mix there.

04:02 But to say, "Oh, it's in a different language." Like, well, Python itself is a different language.

04:06 So there's that.

04:06 Maybe two more things and then I'll wrap it up here.

04:11 Hennec also says about Rust, "I don't think you all quite grok what UV makes so special due to your seniority.

04:17 The speed is really cool, but the reason Rust is elemental is that it's a single compiled blob that you can put onto your machine as a binary and it will bootstrap Python, it will bootstrap Python packages, Python projects, and just the deployment thing."

04:32 And I really agree with that.

04:33 I think that's been the missing piece and an ongoing challenge of Python's to just be like, "Here, have this thing you run."

04:40 Like, "Well, let's have a conversation about a few things before you can run that code."

04:44 Right?

04:44 I was just working on that this morning with another project.

04:47 Like, this doesn't run as smooth as it should.

04:49 Christopher Neugenbauer says, "Just dropping here to say that corporate capture of the Python ecosystem is the number one thing that keeps me up at night subject in my community work.

04:59 So I watch Astral with interest, even though I'm not worried." Speaking of, let's go and see an authoritative response from Charlie Marsh, founder of Astral.

05:09 Y'all are worried about the business model.

05:11 So here's the deal.

05:12 I don't want to charge people money to use our tools.

05:15 I don't want to create an incentive structure whereby our open source offerings are competing with any commercial offerings, which is what you see with a lot of hosted open source SaaS business models.

05:26 That's true.

05:27 What I want to do is to build software that vertically integrates with our open source tools and let's sell that software to companies that are already using Ruff, UV, and et cetera, alternative to things that companies pay for today.

05:39 And that's some examples and so on.

05:41 I'll go read this, but this is quite interesting to keep your thumb on the zeitgeist of UV and packaging and all these things.

05:50 I guess put my spin on it.

05:53 On both sides, I like to Arm and Ronaker's comment of what UV is doing, even in the worst possible future outcome, it's very forkable and maintainable thing.

06:07 Even if something happened with Astral and Astral suddenly became evil, there's an escape hatch.

06:14 The other side of that is also, I actually like Charlie.

06:19 I don't think Charlie Marsh has any nefarious ideas, but there's nothing stopping him from selling the company and the new owners taking it into a different direction.

06:29 And so that's the side that Charlie might have the greatest intent, but the next owner might not.

06:38 And that's where an escape hatch is okay.

06:41 But also I'm totally a UV fanboy and I'm not worried right now.

06:46 Yeah, I think it's fair about the selling.

06:49 And I also think Charlie's a good guy.

06:51 I think it's fair about the selling, but that could also be, I'm not doing this open source project anymore.

06:56 I'm giving it to someone else, although the incentives are much stronger when there's money involved for sure.

07:01 And I think from Armin's perspective, his article, which I think I covered a while ago called "RYE and UV August is Harvest Season for Python and Packaging" is an excellent take and much more thorough than just a mastodon thread.

07:17 All right. Anyway, I thought that would be, I'm glad Simon wrote that up and I thought it was worth highlighting.

07:23 All right. Well, let's hop over to something a little smaller.

07:27 Maybe not smaller, but anyway.

07:30 Erdantic, I just wanted to, I can't remember where I saw this, but anyway, it's a fairly new thing.

07:37 It looks like it's been out a few years, but it's active development right now.

07:42 What is it? Erdantic is entity relationship diagrams that are based on Pydantic models.

07:51 It's a simple tool for drawing entity relationship diagrams for data model classes.

07:58 It supports modeling frameworks such as pedantic adders and data classes.

08:04 This is one of those things of maybe sort of inside baseball, but basically if you're dealing with data structures, especially if they're mapping around your system and mapping around your databases and whatnot.

08:19 And database tools often have these diagram things that you can look at, but the stuff going into your application, the data sets that are being used in your application, you might not have these tools around.

08:33 So this is kind of neat. And it allows you to basically draw these relationship diagrams for your data in your system.

08:40 It's pretty straightforward.

08:42 I like these. You know, one thing that's really cool about these pictures, Brian, when you're working on a project, it's one you've created, you've been working a long time.

08:48 You have probably a really strong mental model of what are the conceptual pieces and how they fit together and what the data looks like.

08:55 But if somebody is new to a team or new to an open source project, or they get dropped in as a consultant, you're like, what?

09:02 What do we got going on here? You know, what is all of this?

09:05 Tools like Erdantic let you just go, bam, show me a visual representation of this.

09:11 And I think that's a huge jumpstart if you need help there.

09:14 Yeah, so you can do it after the fact, like if you're jumping into a system, you can use it to draw the diagrams or if these are part of your documentation or even internal documentation to help somebody come up to speed.

09:27 But you also might like for yourself, throw these in the docs so that like, you know, six months from now you come back and you're like, well, how is this?

09:35 Or even documentation, like in just read the doc style, right?

09:39 Yeah, and also to make sure things don't go haywire. So often you have a mental model that your system makes sense.

09:48 But then when you draw it out, you find all sorts of like, it's like a crazy tree in a forest.

09:54 You're like, oh, man, I didn't think it was that complicated. I need to simplify things.

09:58 So visual tools are great for that.

10:01 The one, I guess one beef with it is that it's based on GraphViz, which is very widely available, but it's probably easiest on Linux and Mac, but you can do it on Windows, too.

10:15 But it might be a little bit more difficult to get GraphViz going on Windows.

10:19 Maybe, maybe not, but I've had issues in the past trying to get running.

10:23 But anyway, that's it. Just a little graphing tool.

10:26 I love it.

10:27 Well, let's switch back to what I got to cover because I have a bunch of things and I'm making this an extra, extra, extra main section because otherwise this will be an hour and a half long show.

10:37 We don't want that. It's not bytes. It would be more than a byte.

10:41 So I want to talk about a couple of things.

10:43 First of all, this is news to you. You're learning about this unless you've been spying on the website, which I find unlikely because you're familiar with it already.

10:51 But if you just Friday, I was messing around with some custom search engine in my browser and I think I had to search for something on Python bytes.

11:00 I'm like, wouldn't it be cool if we could just integrate Python bytes search right into your browser and our search URL you were able to it was a get style search.

11:10 You could do a get style search on it so you could actually plug it in as a custom extension.

11:14 I went farther so that if you're over on Python bytes.fm and you pull up the source, there is now an open search description specification in this bad boy here that don't really want that.

11:29 But that actually describes how search works.

11:33 So if you go over here and you type pb space, see how it says search Python bytes. Oh, wow. But watch this UV space, do see e Docker UVX all these things in that cool has auto complete and everything off of our actual transcripts and our show notes and all of that.

11:52 So so then you just go over here and hit Docker UV boom. And then, you know, there's the shows that we talked about those various things.

11:58 So anyway, if you go to Python bytes and you click little search icon, it says right below, add our search engine directly to your browser.

12:05 Learn how here. And so you click it. It actually shows you the couple of steps. It's super easy. I did a similar thing for talk Python as well.

12:13 Once you do one, you go, I see how I do for the other. They weren't identical, but they were similar. What do you think?

12:18 I think I'm going to be using this all the time. We've covered a lot of topics. And occasionally I'm like, when did we talk about that thing?

12:25 Mm hmm. Mm hmm. I like it. Yeah, yeah. Me too, as well. So I think that's that is pretty excellent. So yeah, I'm really excited about it.

12:32 All right. Next of the extra extra extras is I wrote we talked about passkeys, I think a little while ago.

12:39 So I actually wrote up a little article on passkeys, password managers, whether you should use them. And then there was some debate with people.

12:48 I said, hey, I put out a post about this and someone replied and said, people do not use password managers to store passkeys.

12:56 I'm like, do they or do they not? I have no idea who are using it. So I put out some Twitter and Mastodon polls on which one is this?

13:03 This is Twitter. 44% of the people are using password managers for their passkeys and 20% are just letting their OS go.

13:10 Do you want to save a passkey? Say yes. And 30%, 35% not. That's really high adoption, actually.

13:15 And on Mastodon, I think four or five times as many people are using password managers and half of them are not.

13:22 So pretty interesting, right? Yeah. Anyway, people can check out this article. A little bit of follow up there.

13:27 What's next? I think you should have added one extra like survey thing of what's a passkey.

13:33 That's true. People did say, hey, I'm storing them in hardware, things like Yubikeys.

13:39 Yeah, I didn't quite have that. I think that fell under the password manager thing. Related to that, I was worried about lock-in.

13:48 You're like, passkeys are cool, except for this is the way for Apple and Microsoft and Google to say, just stay more in our platform.

13:55 Please don't leave us. We want to make it nicer for you by helping you stay here.

13:59 So Pablo sent over this recommendation of VaultWarden, which is an unofficial Bitwarden compatible server written in Rust, formerly known as Bitwarden RS,

14:09 that you can basically self-host your own Bitwarden sync and servers.

14:15 And so when you run Bitwarden, you can tell it, here's my server, not the commercial one, the SaaS one.

14:20 All right. You notice anything weird about my display? I mean, people don't really need to see the display here or anything.

14:27 But look at this, Brian. See the bottom where my tabs are?

14:30 I'm trying to live the tabs on bottom lifestyle. I've been watching a lot of people use Arc and then there's Zen Browser, which is a Firefox type thing.

14:39 But I still think Vivaldi, especially after the search stuff that we were doing, I still think Vivaldi is the best browser, hands down.

14:46 For example, Firefox, you can't do this cool search thing I told you about. They give you a list of six search engines.

14:52 I hope you like one of them. Good with that. You don't get a pick anymore. You don't get to add anymore. Same with Zen Browser.

14:58 Chrome will let you add it, but it won't do the autocomplete. It will just do the search.

15:03 Safari auto discovers it through the open search thing, but I don't know how to actually search it.

15:09 I don't know that it uses it may or may not use the search things. I can't make it work.

15:13 But Vivaldi has it like, here's the auto suggest. Here's the search. Here's all the things.

15:18 Anyway, a lot of those newer, shinier browsers are all about like put your tabs in kind of this hidden mode or whatever.

15:25 So I'm trying to go for like a little less distraction. It is surprisingly hard to put the tabs on the bottom from a mental model perspective.

15:31 But give it a week and you'll be good with it. Probably. We'll see how long I last.

15:35 It's never bothered me that they were at the top.

15:38 Well, so here's the thing. It doesn't bother me either. It didn't bother me either.

15:42 But if you look at it the way it is when the tabs are not at the top, you're just focused on the thing that is up.

15:48 You don't mentally realize, oh, there's all these other things up there.

15:52 It takes actual conscious thought to go look at the bottom and see what else is open.

15:56 Almost to the point of it being a flaw.

15:58 But it's kind of just like, this is the thing you should be focusing on now. Don't worry about the other stuff.

16:03 Anyway, that's the thinking for me anyway.

16:05 All right. And PyCon 2025. I don't know if we've covered this.

16:10 I know that we talked about where the new upcoming PyCons are going to be.

16:14 Right. The 2026 one is I think Long Beach. Right. This one is back in Pittsburgh.

16:19 However, the dates are listed on Python.org. Have we mentioned this before? I don't think so. Right.

16:25 I don't remember. We should. Well, we should totally search for it. Yes.

16:29 If we only could. So May 14 to May 22, 2025 is PyCon 2025.

16:36 So the US PyCon. That's pretty awesome. People can check that out. Right.

16:40 Yeah. Because, you know, my brother's like, hey, I want to come visit you.

16:44 I'm thinking of coming in May or maybe April. Is that all right?

16:47 I'm like, I don't know. There's not many things that I got to do that are going to make me not be able to be around.

16:55 But PyCon might be one of them. It would be nice to know what it is. Well, here's what it is.

16:58 It's in May. I may go. I don't know. Yep. All right. Well, that's all the extras that I got.

17:03 OK, well, I've got a bunch of them. I liked all your extras.

17:08 I'm going to do a whole bunch of extras also, but Django related. So this is a Django themed extras.

17:12 So we've got from the PyCharm blog Django project ideas.

17:17 And I actually kind of love this because I'm working on some Django projects myself.

17:22 And sometimes you just want to play play around with Django or any other way for your work to figure out.

17:28 Like I want to try to learn, like do a project, but there's to do list and then there's like, what else could you do?

17:35 And that's where I love this jump off. So there's there's some some tutorials that are well known.

17:43 The Django normal Django tutorial for beginners. Useful.

17:48 PyCharm has a air temperature or JetBrains and PyCharm has an air temperature app tutorial with a step by step tutorial you can walk through.

17:57 But after you've gone through the tutorials, what do you like? You know, what should you do?

18:02 So there's a there's some some great ideas and I like how it's listed.

18:06 So, like, for instance, you could do a blog and what would you learn there?

18:09 Well, you could learn you'd learn about the Django admin Django templates and then doing an editor, because if it's a blog, you're probably going to do an in in in application editor.

18:20 So maybe you could try that. So this is all set up with what tech stack you would run into or the different pieces of Django or extra plugins you would learn.

18:30 And then and then a little blurb about it.

18:33 They also about the blog, they recommended the Django to tutorials Django girls tutorial because it talks about a blog, which is great.

18:41 There's the to do app that you would learn a single page applications and Django templates.

18:47 A recipe organizer. I love this idea. Don't know.

18:50 I didn't think of that. But you'd learn about databases and the ORM and templates and JavaScript is optional for additional security.

18:57 I don't know how that works out, but just a whole bunch of cool ideas around maybe a URL shortener expense tracker.

19:04 That's kind of a neat idea. A social network and then personal portfolio.

19:09 That's pretty neat. And then a lot of these. One of the things I like about these is these are things that would be useful to you, even if nobody else uses it.

19:19 So it's just even if you just put this up for your own use, it help you learn Django and you get some useful tool.

19:25 And then there's some advanced projects, which I like the idea of multi multi user sites, classified site or something, maybe for your neighborhood or for even work, a classified site for your own job.

19:35 Like where you work and be kind of neat. People could sell their stuff to friends and colleagues.

19:40 Anyway, I love this idea, but I've got a lot of examples there.

19:44 Yeah, yeah. It's pretty. It's a pretty fun list.

19:48 So so that's why my first extra on Django, these Django project ideas from JetBrains.

19:53 Really good list. Looks like fun. This came from Jeff Triplett.

19:57 He just put this together recently, I think, or at least posted it recently. Django TV dot com.

20:03 It is a list of talks and tutorials from Django conferences around the world.

20:10 It's kind of a neat, neat resource.

20:12 I love that idea. That's super cool.

20:14 Yeah, it's it's kind of new, but I'm sure it'll grow.

20:17 So a bunch of a bunch of great stuff will show up. Django Commons, also a new thing.

20:22 Learned about this from Lacey Henschel and Django Commons is an organization dedicated to supporting the community's efforts to maintain packages.

20:33 So that are Django related packages.

20:36 So there's there's some great information about how to join this this group, how to transfer a project into the group,

20:42 how to transfer a project out of the group and some code of conduct and FAQ.

20:47 Again, this is just sort of getting started, but it's cool idea. Django Commons.

20:53 Couple more things around Django. I did see.

20:56 So in Django five, we did get some simplified templates for form field rendering.

21:01 But if that's not enough for you, you might want to try IOMI forms.

21:06 So IOMI forms are a different take on Django forms.

21:10 And they wrote a post why we wrote a new form library for Django.

21:15 So just a little different take if you've struggled with Django forms, maybe try Django five, but also maybe try this.

21:23 IOMI forms might be a good thing. And the last Django extra I have got, this comes from Adam Johnson.

21:30 He introduced a template formatter called Jade, D-J-A-D-E.

21:38 But we'll have a link to this article in the show notes, of course.

21:41 So what this is, is you've got all these, you were used to black using black as formatters or probably UV now or rough.

21:51 But what about like for forms, the template forms?

21:56 So that's what this, that's where this comes in. Jade is a, a something like black, but for, for forms.

22:04 So there's some examples of like, for instance, the old form Django two of load static files.

22:11 You're supposed to just say load static now. So having it automatically just change that for you is good.

22:16 So, yeah, yeah. Not just format it, but fix it.

22:19 Yeah. Things like making, like if you have weird space, weird spacing things just to make it easier to read.

22:25 I like it. So, yeah, that's awesome. I love it. Those are my, I like that idea a lot.

22:30 Let's get some for the other formatters as well, or the other templates as well, rather.

22:35 That's a good idea.

22:36 Right. Jinja or whatever. Maybe it exists. People should let us know if it exists.

22:39 Yeah. All right.

22:40 All right. How about some jokes?

22:42 Jokes would be great. Oh, wait, I have one more extra. If we're already to jokes.

22:49 The one extra I got this, this came in from, who sent this in?

22:54 So we've got, I want to give credit where credit is due. So this came from Raphael Weingartner,

23:02 and he suggested we take a look at this. And I thought it was a serious thing at first.

23:06 The open source project maintainer's guide. Have you looked at this yet?

23:10 No, I've not.

23:12 Okay.

23:13 Is it kind of like your blog? Monetization?

23:16 It's just, it's like how to have an open source project and have people not help you maintain.

23:25 Got it.

23:26 So first off, use a source control mechanism other than Git. So try, maybe try Subversion or Mercurial or Bazaar.

23:35 Or even just like SQLite or do it. What is SQLite doing? Where are they? Bust on them. I don't know.

23:42 Anyway, so use something other than Git. Only accept patches on a mailing list.

23:49 Isn't Linux core like that?

23:51 Or like Usenet or something.

23:53 Require a contributor license agreement. Like, that's funny. You have to sign something.

23:59 Don't have community forums or leadership. So no, no discourse Zulip and definitely not Slack or Discord.

24:08 Ignore detailed reports. Systematically close reports. Prioritize features over bugs.

24:13 There's a lot of projects like that, I think. Wait for the big rewrite. Merge half-baked patch sets.

24:19 Bike shed all user visible changes. This is my favorite. Only use outdated language standards.

24:24 So like, for instance, current language standard for C++ is C++ 23. 17 is widely supported.

24:31 So why not use 03? I would say like, why not just stick with C++ 98? It was fine in my day. It's fine now.

24:41 It's good enough for your grandparents. It's good enough for you.

24:44 Yeah. Anyway, these are some amusing lists of things to do for an open source project if you don't want people to help.

24:52 Yeah, that's pretty funny.

24:53 Okay.

24:54 If you do want people to help, though, you might have a joke like this.

24:57 A machine learning algorithm walks into a bar. The bartender asks, "What do you have?"

25:01 The algorithm says, "What's everyone else having?" It's because it's trading on everyone's data. It's all it knows.

25:06 Oh, that's funny. It took me a while.

25:10 It's not lose-your-mind funny, but it's amusing.

25:14 Yeah.

25:15 So thank you, Ted Haas.

25:16 I like it.

25:17 Indeed.

25:18 Well, another episode of Python Bytes in the Bag. Thanks for joining.

25:23 Thanks, Brian.

25:24 Thank you.

25:25 Bye all.

Back to show page