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


Transcript #312: AI Goes on Trial For Writing Code

Return to episode page view on github
Recorded on Tuesday, Nov 29, 2022.

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

00:04 This is episode 312, recorded November 29th, 2022.

00:10 I'm Michael Kennedy.

00:11 And I'm Brian Okken.

00:12 This episode is brought to you by the Compiler Podcast from Red Hat.

00:15 Check them out. Really appreciate them supporting the show.

00:18 Brian, we've got a lot to cover today. You want to just jump right into it?

00:21 What I want to talk about is Simon Willison.

00:23 This is incredible.

00:25 So Simon did a talk at DjangoCon 2022.

00:30 And then he wrote up the slides and everything.

00:33 And we're going to link to his blog.

00:35 His blog title is Coping Strategies for the Serial Project Hoarder.

00:40 And then the talk title was Massively Increase Your Productivity on Personal Projects with Comprehensive Documentation and Automated Tests.

00:48 Yes, that's a mouthful.

00:50 But really, I don't know what a good name for this is other than everybody that works with development needs to watch this talk because it's incredible.

00:59 So he goes through a lot of stuff.

01:02 I'm going to go through it.

01:03 I'm going to...

01:04 Luckily, he's got screenshots on here.

01:06 But he starts out...

01:09 So this is important not just for open source projects or personal projects.

01:13 This is also for if you're working in a company.

01:17 I think this is equally true.

01:18 So he talks about how he got these techniques from working at...

01:24 Now I'm going to forget where he worked.

01:25 But yeah, it's gone.

01:28 A large company with multiple continents.

01:30 And it was helpful to do this model.

01:35 So what is he talking about?

01:37 So one of the things he talks about is the perfect commit.

01:41 So we don't really...

01:44 As a professional software developer, you're not really doing new code all the time.

01:48 What you're doing is maintaining existing software.

01:52 So the commit is your unit of work.

01:55 And a perfect commit includes the implementation of whatever you've done.

02:00 But it also has tests and documentation and a link to the issue thread.

02:05 And this is...

02:07 It seems like a lot to me.

02:08 But walking through his talk, it totally makes sense.

02:11 So he gives an example of one of his with some cool highlights.

02:17 The highlights that he's got documentation changes also.

02:19 And the documentation might just be a single line change or something.

02:24 But the tests...

02:27 He does pause here and say tests are hard for some people, for some developers.

02:31 So it's important to get a working test framework in place quickly.

02:37 So that a test developer isn't starting from scratch.

02:40 They're just...

02:41 Or a software developer when they're writing tests.

02:43 It's just...

02:44 It's not like comprehensive testing has to be there.

02:47 But it is a test that passes when your change is there and fails when it's not there.

02:54 Or fails when it's not working.

02:56 That's enough.

02:57 You can do more thorough testing.

02:59 But that's enough to get us started.

03:02 And I think that's a good way to think about it.

03:04 But he goes...

03:05 Talks about...

03:06 He throws in this little cool thing of like, Just keep common types of projects that you have around as cookie cutters in your own GitHub area.

03:15 He's got a Python library and a Click app and a dataset plugin for him.

03:20 I might have different things like a pytest plugin or something.

03:23 And that way you can just keep up with your best practices, what you think of as best practices in one place.

03:29 This is a cool idea.

03:31 I'm totally going to steal this.

03:32 I've done that for myself as well.

03:34 I've built like a...

03:36 This predated cookie cutter.

03:37 But I built this thing like, I always want to have logging.

03:40 And I want it like this.

03:41 I always want to, you know, connect to this other service.

03:44 And like ping it to make sure that the thing is alive.

03:46 Or whatever.

03:47 Whatever thing we decided for monitoring inside of our...

03:50 The company I worked at.

03:51 And like all the new projects would just start that way.

03:53 And it was so nice.

03:54 Because you didn't like, is it really worth doing the thing to make sure that we can monitor this at some time?

03:58 Like you just run the one command line thing and it's there.

04:01 Right?

04:02 We could give it to an intern and they could run it to start their projects.

04:05 It was great.

04:05 And then he's got like this thing that supposedly with a GitHub hook.

04:10 And I'm going to have to dig into this more.

04:12 Because I didn't quite understand how this works.

04:13 But he's got a way within the GitHub interface to say, I want a new project.

04:17 And it automatically like gives you the choices of what kind of project.

04:21 And then fills out all the defaults from the start.

04:24 Instead of just getting the readme like normally.

04:26 So this is kind of neat.

04:28 And I guess I want to try figuring this out.

04:31 The documentation bit.

04:32 At least one of the things about including this.

04:36 Even if it's difficult.

04:37 You can have this be part of the code review requirements.

04:40 So don't accept a code review.

04:42 And tell the documentation is there also.

04:45 So this is a cool idea.

04:47 And then it's the bonus trick of testing.

04:51 Testing documentation.

04:52 Which is a cool idea.

04:53 And then the links to the issue.

04:56 And I thought this was just sort of a yes.

04:58 You should do this.

04:59 But this is really the meat of the talk.

05:01 Is him doing his entire thought process.

05:04 In the issue thread.

05:05 And he even gives examples.

05:07 Where there's sometimes like up to 50, 60 comments.

05:11 And it's just him talking to himself.

05:13 But this is brilliant.

05:15 And I'm not going to convince you as much as he is.

05:18 But it includes screenshots and dead ends.

05:21 Like I tried this thing and it didn't work.

05:22 And we're going to go back and do this other thing.

05:24 This is an...

05:26 He calls it temporal documentation.

05:28 And I just love this idea.

05:30 And I'm going to try to follow this myself.

05:32 Because I have like a memory issue.

05:35 I write stuff down.

05:36 And then I forget where I wrote it down.

05:38 And this way he says, you don't have to remember anything.

05:43 You just dump it there.

05:45 And that way, let's say you get pulled off of a project.

05:48 And you don't get back to it for like six months.

05:51 Because you've been fighting fires and doing other stuff.

05:54 And then you get back to it.

05:55 You won't remember where you're at.

05:57 And with this line of thinking.

06:00 Of keeping all of your thinking in the issue thread.

06:02 You can just jump in and go, oh, that's where I was.

06:05 And get started pretty quickly.

06:07 I love this.

06:07 It's cool.

06:08 So then the rest of the talk is pretty interesting too.

06:11 Talking about how like, you know, scientists have been doing this.

06:15 And other engineers have been doing this for a long time.

06:17 They called them lab notebooks before.

06:19 And we kind of got out of the habit of doing that with software.

06:22 But anyway, lots of great techniques.

06:24 And I think this is just how to be a professional software developer now.

06:27 I love that it's like a casual conversation.

06:30 And not like, here are my four recommendations.

06:32 But like the playing around and the dead ends are really, really valuable.

06:35 Yeah.

06:36 Kim out in the audience says, the cookie cutter approach also works beautifully from a DevOps perspective.

06:41 For setting up developers to use your firm specific infrastructure.

06:44 Yeah, I totally agree.

06:46 And that's a little bit of what I was hinting at.

06:48 Of like, here's how we integrate with this like uptime manager and stuff.

06:50 But obviously DevOps, that was talking, we were deploying to a server in a closet there.

06:56 Which, I mean, that tells you all you need to know.

06:58 Yeah.

06:59 Speaking of stuff you might need to know, Brian, Google Copilot and these code writing AIs, I have more to say about that at the very end of the show, book in this a little bit.

07:09 They train themselves on lots of code.

07:12 And Google Copilot, for those of you who don't know, you basically can give it a comment.

07:17 And it's like, I want to connect to a Postgres database with SQLAlchemy.

07:22 And then, boom, it'll like literally write all the code, import the usings, you know, come up with a connection string, all that kind of stuff.

07:29 It's pretty fantastic.

07:30 Has some privacy issues.

07:32 I don't know what it's doing now.

07:33 It used to send your source code that you wrote up to GitHub, which made me not want to use it already.

07:41 But the big news here is the website GitHubCopilotLitigation.com.

07:49 And that's as ominous as it sounds.

07:51 It says, we filed, this is what the website sort of announces.

07:56 We filed a lawsuit challenging GitHub Copilot, an AI product that relies on unprecedented open source software piracy.

08:03 Why piracy?

08:04 Because it's trained on things that are like GPL and Creative Commons share alike or attribution.

08:10 And then it outputs code based on that original input that has no GPL and it has no, you know, whatever license, right?

08:18 The license is stripped and no attribution.

08:20 What do you think?

08:21 Something we talked about from the very beginning of like, how is this okay?

08:25 Yeah.

08:26 Not sure.

08:27 Absolutely.

08:27 If it did things like we're only going to look at MIT licenses and other commercial open no attribution licenses,

08:35 I don't think there'd be anything to say about it.

08:37 But apparently that's not the case.

08:40 So there's a couple of updates as well.

08:42 I suppose we should also, like they do on this page, say, we are not a lawyer.

08:46 Please don't take legal advice from us.

08:48 We write code, not legal documents.

08:51 But nonetheless, it says, this is Matthew Butterick.

08:56 And they've set up to investigate Google Copilot.

09:00 And they filed a class action lawsuit in the U.S. federal court in San Francisco on behalf of a couple folks.

09:07 So they're challenging the legality of GitHub Copilot and a related product, OpenAI Codex, which powers Copilot.

09:15 The suit has been filed against a set of defendants that includes GitHub, Microsoft, and OpenAI.

09:21 Wow.

09:21 There's an update down here somewhere.

09:24 Let's see.

09:26 It says, here's the motivation for their lawsuit.

09:29 By training their AI systems on public GitHub repositories, though based on their public statements, possibly much more.

09:36 We contend that the defendants have violated the legal rights of a vast number of creators who posted code or other work under certain open source licenses on GitHub.

09:46 Which licenses?

09:46 A set of 11 popular open source licenses that all require attribution, the author's name, and copyright, including, I guess, the MIT license as well, the GPL, and the Apache license.

09:56 And it's listed out there.

09:57 There's a whole bunch more details.

09:58 And it says, update, November 10th.

10:01 That original was November 3rd.

10:04 There's an update here.

10:06 This is, we filed a second class action lawsuit on behalf of two additional plaintiffs.

10:11 The defendants and claimants are otherwise similar to the initial one.

10:14 So, there you go.

10:16 It's going to be interesting.

10:17 It's not going to be just interesting for Google, for Google GitHub, Copilot, but basically AI in general, right?

10:24 It says it's going to challenge that AI strips the ownership and other requirements of inputs and outputs, right?

10:34 And maybe it does, maybe it doesn't.

10:35 I mean, we heard that APIs are not copyrightable in the Google Oracle Java lawsuit.

10:41 So, we're going to find out here.

10:42 Oh, interesting.

10:43 Yeah.

10:44 I mean, like, when we looked into this a little bit earlier, if it's helping you fill in parameters to a function, or what likely things you're going to fill in for a function call, that's one thing.

10:57 But when it plops down, like, 20 lines of code for you, where did it get those 20 lines of code?

11:02 And then, I mean, open source doesn't necessarily mean you can copy it.

11:07 It's just open to read.

11:08 I mean, you can have a, you can put your own license in there.

11:12 You can make up your own license that says, anybody can read this, but you can't copy it, use it, or do anything else with it at all.

11:19 Can't even fork it.

11:21 And there's nothing stopping you from doing that sort of a license.

11:24 Right.

11:25 Or the default, if you put it on GitHub, I believe, if you put no license, means you have no license.

11:30 You're conferring no license whatsoever, right?

11:32 Yeah.

11:33 It means it's just like, it's like writing a book.

11:36 You can't, when you write a book, you have the full copyright, unless you give it to somebody else.

11:41 So.

11:42 Yeah, absolutely.

11:43 All right.

11:43 Well, let's stick with my screen for a second.

11:46 I want to tell you all about our sponsor for this week, Compiler.

11:50 So this episode of Python Bytes, this episode of Python Bytes is sponsored by the Compiler podcast from Red Hat.

11:56 Like you, Brian and I are fans of podcasts.

11:59 I listen to them more and more these days, actually.

12:01 And I'm happy to share this one, Compiler, an original podcast from Red Hat.

12:05 So if you want to stay on top of tech without dedicating tons of time to it, check out Compiler.

12:10 They present perspectives and topics and insights from the tech industry free of jargon and judgment.

12:15 They want to discover where technology is headed beyond headlines and create a place for new IT professionals to learn, grow, and thrive.

12:22 Compiler helps people break through barriers and challenges, turning code into community at all levels of the enterprise.

12:28 One recent interesting episode is their great stack debate.

12:31 I love, love, love talking to people about their architecture, their code, all the trade-offs and conventions.

12:36 As you will see later in the show, I'm going to talk a bit about that at the end as well for us.

12:41 And the costs that come with this, the challenges, things that are awesome, the things that are not.

12:45 So this episode is like that.

12:47 So you can check it out to see if software is like an onion or like lasagna or it's more complicated.

12:52 It's the first episode in a compiler series on the software stack.

12:56 So listen to more about Compiler at pythonbytes.com.

12:58 Yes, you can just go type compiler into your podcast player.

13:01 And that's what I would do in general.

13:03 But please use our link so that the folks at Red Hat know that it came from us.

13:07 Yes.

13:07 Yes.

13:08 And thanks to Compiler for keeping our podcast going strong.

13:12 All right.

13:13 Over to you, Brian.

13:14 What's the next one?

13:14 So this is a silly thing.

13:19 But sometimes I've got Python code that I want to have a pop-up, a window pop-up.

13:26 And I've always been using, what is it, PySimpleGUI?

13:31 Well, not always.

13:32 But that's what I've been using lately for really easy, just a simple pop-up thing, especially if I needed to use run on Macs and really anywhere.

13:40 Because it's totally fast to get it done, and I don't have to think about it anymore.

13:44 However, PySimpleGUI doesn't, I haven't mastered the art of getting it to look just like a native dialog box.

13:53 And maybe there's some tricks that you can do that I just don't know.

13:57 But if I know it's on Windows, maybe we could just go ahead and use the Windows DLLs and do a native Windows dialog box.

14:07 Just call straight into the Windows 132 API for message box 3B2 or whatever it is.

14:14 That shouldn't be too hard, right?

14:15 No.

14:15 It sounds scary to me.

14:17 But I ran across Matt Callahan's blog.

14:21 Matt Callahan has an article called Display a Message Box in Python Without Using a Non-Standard Library or Other Dependency.

14:30 Actually, you can just do this.

14:31 You don't have to install anything.

14:33 And I got this.

14:35 I want to, where did I get this from?

14:37 Give credit where credit is due.

14:39 I got this from the PyQuarters Weekly newsletter.

14:42 So thanks to them.

14:44 Anyway, this is not hard.

14:47 So he has a little pop-up example.

14:48 And I should have read the article, but I just skimmed for the code.

14:52 Here's some code.

14:54 That's it.

14:55 This makes a dialog box pop up.

14:57 And it's calling the, so it calls, it's just like a couple flags.

15:02 It's like 10 lines of code.

15:03 It calls ctypes, win DLL, user 32, message box, EXW, whatever that means.

15:10 And with some stuff in it, like a title and a message and everything.

15:15 So it's using ctypes, which I don't use much, but you can get into DLLs.

15:21 So ctypes is built into Python.

15:23 And so this message box, I wanted to play with it a little bit more.

15:27 So as I was playing with this, looked into the Microsoft documentation, the message box dialogue.

15:35 There's a, one of the flags is this U type.

15:38 And it's like this hex value thing or a bit field.

15:40 And you can orient a whole bunch of stuff.

15:42 So you can use this to, to get like an okay box or an okay cancel box, different types of dialogue boxes using this, this flag.

15:51 And then once you've got this popped up, how do you, you need to know like what users clicked on and stuff.

15:57 So there's, there's return values from this and you can just like check the return value.

16:02 And it's defined to be like, you know, a three for abort and a two for cancel and one for okay.

16:09 And you can just check this value.

16:10 So with just a little bit of code, you can have a native dialogue box pop up if you need to in your code.

16:17 Yeah, that's awesome.

16:18 And it does things like natively that you would expect.

16:21 Like for example, you hit escape and you have an okay cancel, it'll return cancel.

16:25 I hate some of these, these like UI things, they show up and you're like, well, it's got one text input and a submit button.

16:30 You hit enter, it does nothing.

16:32 You're like, yeah, great.

16:32 Okay.

16:33 Apparently this is not real.

16:34 I'm going to have to just, you know, go click it or whatever.

16:37 Right.

16:37 So hooking into the native OS is sweet like that.

16:40 This looks like a thing that would be ripe for a short, simple little package that wraps up, say all the.

16:47 Okay.

16:48 Cancel.

16:48 Yeah.

16:49 Okay.

16:49 Cancel.

16:50 What kind of icon you want?

16:51 Do you want like a warning?

16:52 Do you want an informational icon?

16:54 The buttons?

16:55 Yeah.

16:55 Yeah.

16:56 It seems really great, but this is fantastic.

16:58 So, so neat and, and built in neat.

17:01 So anyway.

17:02 Just a quickie.

17:03 Yeah.

17:04 It comes included.

17:04 And yeah, I really like it.

17:06 And it's also a bit of a roadmap to show what you could do beyond that.

17:09 Right.

17:10 There's more than just really simple dialogue boxes.

17:12 For example, like the open file dialogue box on windows could probably be real similar.

17:16 Right.

17:16 Oh yeah.

17:17 Probably.

17:17 Right.

17:18 Yeah.

17:19 So when I was looking it up, there's a whole bunch of dialogue boxes you got access to.

17:22 Yeah, exactly.

17:23 It's like a roadmap to like, well, I can like create a file or, you know, any of these things, which I think is pretty cool.

17:29 All right.

17:30 Let's flip away from OS specific to OS general, but stick with PyCoders for a minute.

17:35 So this one also comes from PyCoders.

17:37 I don't know if it's the same issue or not, but very cool.

17:40 It says write Chrome extensions, which also mean like Brave and Vivaldi and others.

17:45 Edge maybe.

17:46 Write Chrome extensions in Python.

17:49 Oh, how does it work?

17:52 Hi script.

17:53 Of course.

17:54 So, yeah, we, we just take PyScript and this, this is an article by Pete Fiston and it sort of walks through how he was able to use PyScript, which is Python on WebAssembly running in the browser to use that to power a Chrome extension.

18:11 And it doesn't really matter if it's a bit of a nine meg download because you install it once and it's local on your computer, right?

18:18 So it just, if you want to do this, it walks you through all the things you got to do in order to use PyScript to write Chrome extensions or Python to write Chrome extensions.

18:26 What do you think?

18:27 Cool.

18:27 Even shows you how to put an icon.

18:28 That's pretty cool.

18:30 Yeah.

18:30 But I have more for you.

18:32 So just so in case people don't know, this is an extra, extra, extra hear all about it section because I want to hit a whole bunch of things.

18:38 So as of recently, just published this episode.

18:42 Let me look.

18:42 30, 31 minutes ago.

18:46 And it says PyScript powered by MicroPython.

18:48 So one of the challenges that PyScript has had traditionally is it's based on the full, nearly the full CPython runtime compiled into WebAssembly, which after you strip a bunch out, that doesn't work in the browser.

19:00 It comes down to like nine megabytes.

19:02 Okay.

19:03 It's for like this browser extension thing.

19:05 That's reasonable.

19:05 But for, you would never use in place of like Vue JS on a popular page because you want that page to load quickly.

19:13 You want it to be good for SEO, all those things.

19:15 But you know what's small and fast?

19:17 MicroPython.

19:18 Oh, neat.

19:19 So I just had Brett Cannon, Nicholas Tolerwey, and Fabio Flieger, on Talk Python to talk about the work that they're doing to make PyScript not run on full CPython, but to run on MicroPython.

19:34 Oh, wow.

19:34 MicroPython, you can get that to load up in a hundred milliseconds on your page.

19:38 And it's only a couple hundred K.

19:40 All of a sudden that starts to sound a lot like a pretty rich front end framework level of stuff you got to download and get started and you cash it.

19:47 Then you're, you're good to go.

19:48 That's exciting, huh?

19:49 That's super exciting.

19:51 Yeah.

19:51 Yeah.

19:52 So this Chrome extension thing is cool.

19:54 When you look at the shipping version, I don't know if you can call it shipping because the price script is still like super alpha, but what you can get today.

20:02 So Nicholas said probably spring that they'll have something to share, but in terms of being able to use MicroPython.

20:10 But I think that's pretty excellent.

20:11 That could really, really unlock some, some super cool features.

20:15 If now we could build like a Vue.js type thing, but with Python.

20:19 And one of the goals that they stated is that they're looking to build this as a framework or excuse me, a platform that you can build frameworks on top of.

20:28 So it's not just, here's how you write some Python code in the browser, but here's a foundation that people could create like a PyView or a PyAngular or, you know, whatever they wanted to create.

20:38 Right.

20:38 Yeah.

20:39 So question just for my own personal use is, is, would Chrome extensions work on Vivaldi?

20:47 Yeah, yeah, they do.

20:48 Okay.

20:48 One of the things that's interesting about Vivaldi, and I think it probably affects its reporting a little bit.

20:54 When you look at the user agent of Vivaldi, it's exactly the user agent of Chrome.

20:59 So it lies to the world and tells the world it's Chrome.

21:02 There's no user agent for Vivaldi.

21:04 It's just whatever version of Chrome it's like using, you know?

21:08 Okay.

21:08 So when you go to the Chrome web store, it's like, put this in Chrome.

21:11 You click it and yeah, it goes.

21:12 So it worked perfectly.

21:12 Sure.

21:13 Cool.

21:13 Yes.

21:14 And John Sheehan says, yes, they do.

21:15 All right.

21:16 Next, extra, extra, extra.

21:18 Brian, I've been excited a little bit about Mastodon.

21:20 I don't know if you noticed.

21:21 Yeah, me too.

21:23 I know.

21:23 It's fantastic.

21:24 It's really tons of great interactions.

21:25 And I started putting in our show notes, which you'll see when I publish this, your Mastodon account and mine.

21:32 So people can connect with us and have even more conversations over there.

21:36 But there was a really interesting article by Eugene, the guy who created Mastodon.

21:41 I've been looking and looking.

21:44 It's about scaling Mastodon and the challenges they were having.

21:47 And boy, it's...

21:49 I would love to link to it, but I just can't find it.

21:51 But it's so...

21:53 It's written in Ruby, right?

21:54 And so it talks so much about these are the challenges of scaling out threads.

22:00 And, oh, we have this thing called a GIL.

22:02 And it really doesn't allow you to use threads very easily.

22:05 And here's...

22:06 There's just...

22:07 It was so interesting to look at how a technology that doesn't have asyncio and async and await getting all tangled up trying to do IO-based things.

22:17 So it's like, well, can we have...

22:19 Maybe we should have 10 to 20 threads to do the network communication.

22:24 But if we have more than 20, then we get like a context switching and contention in the operating system, you know, that just comes with having OS threads.

22:32 Well, guess what?

22:33 You can do really well with no threads or one thread.

22:37 You can talk to web...

22:38 You can call other websites.

22:39 You can receive web requests.

22:41 And the mechanism for doing that in Python is async and await.

22:44 And asyncio requires no additional threads, very, very little overhead, no contact switching.

22:50 So this project by Andrew...

22:56 I'm sorry if I am not getting...

22:58 Andrew Godwin, sorry.

22:59 I forgot his last name for a moment.

23:01 I have Django channel said, what if I rewrote this, but in Python with an async and a wait?

23:08 Okay.

23:08 Okay.

23:09 So there's a bunch of challenges of running Mastodon.

23:12 People want to have their own server because they're like, oh, I want my own server.

23:15 So I'm not stuck in one of these communities.

23:16 And as beholden to them, the problem is every one of those is like a standalone DevOps adventure.

23:23 There's tons of like things working together.

23:25 And it's a lot of work, right?

23:27 It would be better if you put like host more of them on one machine and sort of scale that up in a nice way.

23:35 So this one lets you host multiple domains for small to medium instances.

23:39 And it's written with async and await, which is pretty awesome.

23:43 So yeah.

23:44 Anyway, I think you should check this out.

23:46 I didn't know if I caught you trying to pronounce it.

23:49 Takahe?

23:50 Takahe?

23:51 I don't know.

23:52 I'm going to go with that.

23:54 And of course, Andrew Godwin just said, you know, I can probably write this in Python and like get it out in a couple of weeks.

24:01 I think it was like five days or something.

24:03 So key features, multiple domain support, multiple identities per user, which is kind of interesting.

24:09 Desktop mobile and PWA compatible.

24:13 Again, how many days?

24:14 And easy deployment.

24:16 A web worker, a background worker, and one database.

24:18 Not all this crazy, crazy stuff.

24:20 So anyway, people can check it out.

24:23 Let's check out the requirements.

24:25 See what we got going on here.

24:26 UVicorn for an HTTPX.

24:29 I mean, that pretty much says it right there.

24:32 Oh, interesting.

24:33 It's based on Django HTMX.

24:36 It's pretty interesting in some of the building blocks.

24:39 But yeah, super cool.

24:40 So there's another one.

24:42 All right.

24:42 We just had our Black Friday sale over at Talk Python.

24:47 And that was really excellent.

24:48 Sold a bunch of courses.

24:49 We sold some pytest courses, by the way.

24:51 Yeah.

24:52 But I...

24:53 I'm just excited because sometimes we have these sort of conversations about, you know,

24:57 like cool sales and stuff.

24:58 And I'm glad that I get to be a part of that now.

25:00 We've done other fun things where, like, we couldn't sell your book through them because

25:05 it's through the publisher.

25:06 And I guess, yeah, it gets tricky, right?

25:08 So I'm really excited as well.

25:09 So we did our Black Friday sale.

25:11 And guess what?

25:12 I noticed something a little bit unusual.

25:14 It said, after a little bit, I opened up Glances on the main web server and said,

25:19 CPU usage is 85%.

25:20 I'm like, oh, that's not so good.

25:22 88, 91, 92.

25:24 Uh-oh.

25:24 But what was super interesting was Nginx, not Python, was the thing getting hammered.

25:31 So both Nginx workers were like almost 100%.

25:34 And Python was just chilling.

25:35 I'm like, okay, that is a really interesting story for Python performance that something

25:41 amazing like Nginx that people say is fast all the time is the bottleneck.

25:45 And it turned out it survived, but just barely, right?

25:48 If it were like twice as bad, it would have keeled over, which had been bad.

25:52 So I talked to a bunch of people about this.

25:54 And I realized that there's one HTTP response.

25:57 I've got to spell that better.

25:59 And 12 CSS files, 43 images, and one JavaScript file on the page I was sending them.

26:04 So I'm like, all right, maybe I should try to use some interesting CDN, which I had got

26:10 a recommendation from one of our listeners, but otherwise hadn't heard about.

26:12 What a cool service.

26:14 So now we have 112 different locations serving up those static files and just processing.

26:21 So I went back today when we did our Cyber Monday and I said, when I, that was yesterday, when

26:27 I pushed out the announcement for Cyber Monday closing and I pulled up the real-time data,

26:33 look at that traffic.

26:34 That's CSS and JavaScript and images.

26:36 1.4 gigabytes a second.

26:38 Oh my gosh.

26:39 It's insane, dude.

26:40 And check this out on the server.

26:43 This is the most important part, 3% CPU usage on NGINX and across the whole computer,

26:48 across all of the micro-WSGI processes, just a couple more percent.

26:52 CDN to the rescue.

26:54 Exactly.

26:54 But the thing that's also interesting is that Python is just like, yeah, it was nothing.

26:58 Like, we can take that, but it's all those static files.

27:01 So anyway, I put that right up together for people in order to serve out that data, pay $2,

27:07 right, for 0.35 terabytes.

27:12 And by the way, it's going right now.

27:14 Oh, it's got to refresh here.

27:16 They have these cool real-time maps and whatnot.

27:19 But that little spike right there is when I released the Talk Python episode.

27:23 And that's about four and a half terabytes per second, which is just insane.

27:28 So anyway, I totally recommend people check this out.

27:31 It's super fun.

27:32 You're reaching people all over the world.

27:33 That's pretty cool.

27:35 Yeah.

27:35 Isn't that amazing?

27:36 You get all these different locations.

27:37 I think it lost its web socket connection because it stopped updating.

27:43 It's like, there's a little warning.

27:45 This live monitor is like a little bit of a suggestion of how things might be.

27:50 But yeah.

27:51 Anyway.

27:51 Yeah.

27:51 What's up with the Alaska people not listening?

27:53 Hey, Alaska.

27:54 Yeah, man.

27:54 Come on.

27:55 Yeah.

27:56 They're going to have to CD in over to Canada or anyway.

27:59 So not that.

28:01 This final one here.

28:03 No, not final one.

28:04 Second, final one of the read all about it or hear all about it.

28:07 Reader 5.

28:08 I've actually been really getting back into RSS.

28:11 I've never left.

28:13 Yeah.

28:13 What's your RSS story these days?

28:15 No, I use Feedly on my phone just to keep up on stuff.

28:20 Nice.

28:21 I'd switch to things like Zite, which is sadly gone, and Flipboard and these sort of Apple

28:28 News-like things where they kind of curate a bunch of different sources.

28:31 I'm like, you know what?

28:32 There's a bunch of great places I would really like to just directly get them from and curate

28:37 a little more than just I suggest more Python.

28:39 Because do you know how many times my Python channel in Flipboard has women scared of Python

28:46 that comes out of the toilet?

28:47 Like, you know, no, not that Python.

28:49 Really not.

28:50 Oh, no, no.

28:51 And so I've just been super loving.

28:53 I've been using Reader 5 with two E's.

28:57 What a nice piece of software this thing is for $10.

29:00 Okay.

29:02 Really, really cool.

29:02 Yeah.

29:02 I'll check it out.

29:04 Yeah.

29:04 And another thing I would like, if people have awesome recommendations for blogs, especially

29:10 Python blogs that I should be following or people, listeners should be following, put that

29:15 on the YouTube channel comments or send it to us on Mastodon or Twitter.

29:19 And maybe I'll give a shout out to the ones that are extra good.

29:22 But very, very cool.

29:23 Let's see.

29:24 Check this out.

29:26 There's a podcast called Sing for Science.

29:29 And on season three, episode eight, which just came out six days ago, Rivers Cuomo of Weezer

29:35 and Guido Van Rossum sit down for a conversation.

29:38 How cool is that?

29:39 That's pretty cool.

29:40 That's really cool.

29:41 So have you listened to it?

29:42 Yeah, I listened to it.

29:43 I grabbed my phone and my dog and went for a walk and listened to it because the sun came

29:49 out and that was rare right now.

29:51 Yeah, it's really interesting.

29:52 Neat.

29:53 It's a lot of the host talking to Rivers and talking to Guido and a little bit of interaction.

29:59 I would love a little more facilitation of talking directly, but both great people.

30:03 Rivers is awesome.

30:05 He does really cool stuff with Python.

30:06 I had him on Talk Python 327, little automation tools, which was fun.

30:13 So yeah, he's a legit developer these days, which is pretty neat.

30:16 All right.

30:17 Final thing, Brian.

30:18 Final extra, extra, extra.

30:19 We started with, I started at least my segment with AI coding and I'm going to end it with

30:25 AI coding Kite.

30:26 Do you remember Kite?

30:27 It was like the original GitHub co-pilot.

30:29 Yeah.

30:30 Yeah.

30:30 Unfortunately, they are shutting down.

30:33 So they've been around for 10 years or so.

30:37 Not quite.

30:37 Seven years, something like that.

30:39 Really?

30:39 Quite a while, but they're shutting down.

30:41 So thanks for all the code, I suppose.

30:44 And that's it.

30:45 That's all I got for all my extras.

30:47 I want to add one.

30:49 So we talked to Simon Willison, talked to one of the one thing I didn't mention about in

30:55 his talk is he encouraged people to write blogs because there's not that the blogs were huge

31:00 for a while and then everybody was doing it and now not so much.

31:04 And so you do get noticed more if you're writing a blog.

31:08 I think that that's a good thing.

31:10 Plus, we can link to it easier if you got your article on a blog.

31:13 Absolutely.

31:15 But also, and RSS wise, Planet Python is something I still check out.

31:20 So planetpython.org, if you haven't heard of it, you can either have the full content so

31:26 you can read and it pulls all of this through RSS from different blogs.

31:31 So if you have, and titles only, if you have a Python blog or you're starting one, check

31:38 out Python, planetpython.org and try to get your name on the list.

31:42 Maybe put out like three or four articles first and then try to get your name on the list or

31:47 your blog on the list.

31:48 And that way it gets seen by people like us, even if you don't notify us.

31:53 Yeah, that's excellent.

31:54 I didn't subscribe to that because I feel like it's a little bit too much of everything.

31:58 But I went through all the recent posts and said, this writer looks interesting or this

32:03 source looks interesting and like subscribe directly.

32:05 So I kind of used it to start my exploration of those things I wanted to subscribe to.

32:09 Yeah, not a bad idea.

32:10 And you know, they have RSS feeds because they're in here.

32:13 So exactly.

32:15 Since you brought it up, I just want to also point out like one of my roadblocks of writing

32:19 a lot was, well, I don't have time to write like an article, something well thought out

32:23 and, you know, a thousand words and that, you know what?

32:26 My new philosophy has been, let's just write like really short posts.

32:31 Like here's one about a fun thing I did with spammers and it's like three paragraphs.

32:34 Or here's one about installing something as a PWA.

32:38 It's two pictures and four paragraphs.

32:40 And you don't, you don't have to write essay like long essays to contribute interesting

32:46 things and ideas, I think.

32:47 So I just following up on that.

32:48 Yeah.

32:49 My thoughts are if it's going to be a thread, make it a post instead.

32:53 Yeah, exactly.

32:54 Exactly.

32:55 All right.

32:56 Well, my jokes have vanished.

32:59 I had a cool joke on social media and it got taken down.

33:02 It was, it was, it was really funny.

33:05 It was totally benign.

33:05 I don't know why it's gone, but whatever.

33:07 And then by the way, following up on this, Jeremy Page.

33:10 It says you can also RSS Mastodon users.

33:13 Okay.

33:14 That's.

33:14 And Mastodon hashtags as well.

33:19 You can RSS those.

33:20 Okay.

33:21 Yeah.

33:21 I follow the Python hashtag over there.

33:23 I could RSS it, I suppose.

33:24 Excellent.

33:25 All right.

33:25 Brian.

33:26 So do you have a joke for us?

33:28 Yeah.

33:28 So speaking of Mastodon on Mastodon, I said, I'm getting, I'm getting a lot of great Python

33:33 content on Mastodon, but I need some joke people to like, I need some nerd jokes.

33:38 So I'm asking for people.

33:40 And this, somebody didn't ask, tell me a person to follow.

33:44 I'm still looking for people to follow with good jokes.

33:46 So if you send them my way, if, or send me their way, if, if you know of people.

33:51 But here's one that I got from somebody on Mastodon.

33:54 So I got it from, who did I get this from?

33:57 I should probably give credit.

33:59 So this came from Steven Box.

34:01 Nice.

34:02 Thanks, Steven.

34:03 So exit condition from monkeyuser.com.

34:06 So it took me a while to get this.

34:10 So there's a couple of people sitting at a desk, paraprogramming, I'm guessing.

34:16 And then somebody else is frustrated.

34:18 They hear, wait.

34:19 And he says, the frustrated guy says, that's it.

34:22 And, and, and he starts going towards a door that's labeled recursion.

34:27 And somebody says, wait, there's no, I'm going in.

34:30 He goes in and he gets into the other side and says, wait, he's the person trying to say, wait.

34:37 Oh my gosh.

34:39 There's no exit condition.

34:41 So that's a dumb joke, but that's right.

34:45 It's really good.

34:45 And it's got some clever, the cartoon is clever where like the, the speech of the other one is off screen.

34:52 So it kind of looks like it comes from the original group, but in fact is coming from the recursion of the first one.

34:57 And then, yeah, it's, yeah.

34:58 Okay.

34:59 Well, one more.

35:00 Somebody said, I should follow Olafur White.

35:05 Anyways, I just thought this was dumb and funny.

35:09 Bobby pin.

35:10 No, I go by my full name, Robert Pindle.

35:13 And it reminded me of the Bobby tables thing.

35:17 So yes, exactly.

35:18 I love it.

35:19 All right.

35:19 Well, thank you everyone for listening.

35:21 And Brian, thanks for being here.

35:23 Thank you.

35:24 Yeah.

35:24 Bye everyone.

Back to show page