Learn Python with Talk Python's 270 hours of courses

#396: AI Goes on Trial For Writing Code (crossover) Transcript

Recorded on Tuesday, Nov 29, 2022.

00:00 Hi folks, for our final episode of 2022 here on Talk Python, we're crossing the streams with my other show, Python Bytes.

00:07 I present to you one of the more popular episodes of the year.

00:10 We cover many small topics on Python Bytes.

00:13 It's the whole theme of the show, as you may know.

00:16 But the headline of this one is, AI goes on trial for writing code.

00:20 Thank you for listening to Talk Python To Me in 2022, and have a great holiday break.

00:25 The opportunity for me to do this work, and have you all appreciate it and support it, is humbling and truly an honor.

00:30 Thank you, and I'll see you next week.

00:33 Here's that episode.

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

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

00:44 I'm Michael Kennedy.

00:46 And I'm Brian Okken.

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

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

00:52 This is incredible.

00:54 So Simon did a talk at DjangoCon 2022, and then he wrote up the slides and everything, and we're going to link to his blog.

01:03 His blog title is Coping Strategies for the Serial Project Hoarder.

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

01:17 Yes, that's a mouthful.

01:18 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.

01:28 So he goes through a lot of stuff.

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

01:32 I'm going to luckily, he's got screenshots on here, but he starts out.

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

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

01:45 I think this is equally true.

01:47 So he talks about how he got these techniques from working at, now I'm going to forget where he worked, but it's gone.

01:57 A large company with multiple continents, and it was helpful to do this model.

02:04 So what is he talking about?

02:05 So one of the things he talks about is the perfect commit.

02:10 So we don't really, as a professional software developer, you're not really doing new code all the time.

02:17 What you're doing is maintaining existing software.

02:20 So the commit is your unit of work, and a perfect commit includes the implementation of whatever you've done, but it also has tests and documentation and a link to the issue thread.

02:34 And this is, it seems like a lot to me, but walking through his talk, it totally makes sense.

02:39 So he gives an example of one of his with some cool highlights that he's got documentation changes also.

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

02:53 But the tests, he does pause here and say tests are hard for some people, for some developers.

02:59 So it's important to get a working test framework in place quickly so that a test developer isn't starting from scratch.

03:09 They're just, or a software developer when they're writing tests.

03:11 It's just, it's not like comprehensive testing has to be there, but it is a test that passes when your change is there and fails when it's not there or fails when it's not working.

03:24 That's enough.

03:25 You can do more thoroughly test, thorough testing, but that's enough to get us started.

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

03:32 But he goes, talks about, has, he throws in this little cool thing of like, just keep common types of projects that you're, you have around as cookie cutters in your own, in your own GitHub area.

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

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

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

03:58 This is a cool idea.

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

04:01 And then for myself as well, I've built like a, this predated cookie cutter, but I built this thing.

04:07 Like I always want to have logging and I want it like this.

04:10 I always want to, you know, connect to this other service and like ping and to make sure that the thing is alive or whatever, whatever thing we decided for monitoring inside of our, the company I worked at.

04:19 And like all the new projects would just start that way.

04:22 And it was so nice because you didn't like, ah, is it really worth doing the thing to make sure that we can monitor it at some time?

04:27 Like you just run the one command line thing and it's, it's there.

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

04:33 It was great.

04:34 And then he's got like this thing that supposedly with a GitHub hook, and I'm going to have to dig into this more because I didn't quite understand how this works, but he's got a way within the GitHub interface to say, I want a new project.

04:46 And it automatically like gives you the choices or what kind of project and then fills out all the defaults from the start instead of just getting the read me like normally.

04:55 So this is kind of neat.

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

04:59 The documentation bit, at least one of the things about including this, even if it's difficult, you can have this be part of the code review requirements.

05:09 So don't, don't accept a code review until the documentation is there also.

05:13 So this is a cool idea.

05:15 And then it's the bonus trick of testing documentation, which is a cool idea.

05:22 And then the links to the issue.

05:24 And I thought this was just sort of a, yes, you should do this.

05:27 But this is really the meat of the talk is him doing his entire thought process in the issue thread.

05:34 And he even gives examples where there's sometimes like up to 50, 60 comments.

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

05:42 But this is brilliant.

05:44 And I'm not going to convince you as much as he is, but includes screenshots and dead ends.

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

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

05:53 This is an, he calls it temporal documentation.

05:57 And I just love this idea.

05:58 And I'm going to try to follow this myself because I have like a memory issue.

06:03 I write stuff down and I, then I forget where I wrote it down.

06:06 And this is where, this way he says, you don't have to remember anything.

06:11 You just dump it there.

06:13 And that way, let's say you, you get pulled off of a project and, and you don't get back to it for like six months.

06:20 Cause you've been fighting fires and doing other stuff.

06:22 And then you get back to it.

06:24 You won't remember where you're at.

06:25 And with this, this, this line of thinking of keeping all of your thinking in the issue thread, you can just jump in and go, oh, that's where I was and get started pretty quickly.

06:35 I love this.

06:36 It's cool.

06:36 So then the rest of the talk is pretty interesting to talking about how like, you know, scientists been doing this and other engineers have been doing this for a long time.

06:46 They called them lab notebooks before.

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

06:50 But anyway, lots of great techniques.

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

06:55 Now.

06:56 I love that.

06:57 It's like a casual conversation and not like, here are my four recommendations, but like the playing around and the dead ends are really, really valuable.

07:04 Yeah.

07:05 Kim out in the audience says the cookie cutter approach also works beautifully from a DevOps perspective for setting up developers to use your firm specific infrastructure.

07:13 Yeah, I totally agree.

07:14 And that's a little bit of what I was hinting at of like, here's how we integrate with this, like uptime manager and stuff.

07:19 But obviously DevOps that was talk.

07:21 We were deploying to a server in a closet there, which I mean, that tells you all you need to know.

07:27 Yeah.

07:28 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:37 They train themselves on lots of code and Google Copilot.

07:42 For those of you who don't know, you basically can give it a comment and like, I want to connect to a Postgres database with SQLAlchemy.

07:50 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:57 It's pretty fantastic.

07:58 Has some privacy issues.

08:00 I don't know what it's doing now.

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

08:09 But the big news here is get the website, GitHub Copilot litigation.com.

08:17 And that's as ominous as it sounds.

08:20 It says we filed.

08:22 This is what the website sort of announces.

08:25 We fought a lawsuit challenging GitHub Copilot, an AI product that relies on unprecedented open source software piracy.

08:32 Why piracy?

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

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

08:46 The license is stripped and no attribution.

08:49 What do you think?

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

08:54 Yeah.

08:54 Not sure.

08:55 Absolutely.

08:56 If it did things like we're only going to look at MIT licenses and other commercial open no attribution licenses, I don't think there'd be anything to say about it.

09:06 But apparently that's not the case.

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

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

09:15 Please don't take legal advice from us.

09:17 We write code, not legal documents.

09:20 But nonetheless, it says this is Matthew Butterick.

09:24 And they've set up to investigate Google Copilot.

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

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

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

09:49 Wow.

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

09:53 Let's see.

09:54 It says by training, here's the motivation for their lawsuit.

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

10:05 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,

10:14 which licenses a set of 11 popular open source licenses that all require attribution, the author's name, and copyright,

10:20 including, I guess, the MIT license as well, the GPL, and the Apache license.

10:24 And it's listed out there.

10:26 There's a whole bunch more details, and it says, update, November 10th.

10:29 That original was November 3rd.

10:33 There's an update here.

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

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

10:42 So there you go.

10:44 It's going to be interesting.

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

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

11:02 And maybe it does, maybe it doesn't.

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

11:09 So we're going to find out here.

11:10 Oh, interesting.

11:12 Yeah.

11:12 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.

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

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

11:35 It's just open to read.

11:37 I mean, you can put your own license in there.

11:40 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:47 Can't even fork it.

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

11:53 Right.

11:54 Or the default, if you put it on GitHub, I believe if you put no license means you have no license, you're conferring no license whatsoever, right?

12:01 Yeah.

12:01 It means it's just like writing a book.

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

12:10 Yeah, absolutely.

12:11 This portion of Talk Python to Me is brought to you by Sentry.

12:16 How would you like to remove a little stress from your life?

12:18 Do you worry that users may be encountering errors, slowdowns, or crashes with your app right now?

12:24 Would you even know it until they sent you that support email?

12:28 How much better would it be to have the error or performance details immediately sent to you,

12:32 including the call stack and values of local variables and the active user recorded in the report?

12:38 With Sentry, this is not only possible, it's simple.

12:41 In fact, we use Sentry on all the Talk Python web properties.

12:45 We've actually fixed a bug triggered by a user and had the upgrade ready to roll out as we got the support email.

12:51 That was a great email to write back.

12:53 Hey, we already saw your error and have already rolled out the fix.

12:57 Imagine their surprise.

12:58 Surprise and delight your users.

13:00 Create your Sentry account at talkpython.fm/sentry.

13:05 And if you sign up with the code talkpython, all one word, it's good for two free months of Sentry's business plan,

13:12 which will give you up to 20 times as many monthly events as well as other features.

13:16 Create better software, delight your users, and support the podcast.

13:21 Visit talkpython.fm/sentry and use the coupon code talkpython.

13:27 All right.

13:27 Over to you, Brian.

13:28 What's the next one?

13:28 So this is a silly thing, but sometimes I've got Python code that I want to have a pop-up, a window pop-up.

13:40 And I've always been using, what is it, PySimple GUI?

13:45 Well, not always, but that's what I've been using lately for like really easy, just a simple pop-up thing,

13:51 especially if I needed to use RunOnMax and really anywhere, because it's like totally fast to get it done,

13:57 and I don't have to think about it anymore.

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

14:07 It's, and maybe there's some tricks that you can do that I just don't know.

14:11 But if I'm on, 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:21 Right, just call straight into the Windows Win32 API for.

14:25 Yeah, sure.

14:26 Like that could be, that shouldn't be too hard, right?

14:29 No.

14:30 It sounds scary to me, but I ran across Matt Callahan's blog.

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

14:44 Actually, you can just do this.

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

14:48 And I got this.

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

14:52 Give credit where credit is due.

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

14:56 So thanks, thanks to them.

14:58 Anyway, this is not hard.

15:01 So he has a little pop-up example.

15:03 And I should have read the article, but I just skimmed for the code.

15:06 Here's some code.

15:08 That's it.

15:09 This makes a dialog box pop up.

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

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

15:17 It calls ctypes, winDLL, user32, messagebox, exw, whatever that means.

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

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

15:35 So ctypes is built into Python.

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

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

15:49 dialog, there's a, one of the flags is this U type.

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

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

15:57 So you can use this to get like an OK box or an OK cancel box, different types of dialog

16:03 boxes using this flag.

16:05 And then once you've got this popped up, how do you, you need to know like what users

16:10 clicked on and stuff.

16:11 So there's, there's return values from this and you can just like check the return value

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

16:23 And you can just check this value.

16:25 So with just a little bit of code, you can have a native dialog box pop up if you need to in

16:30 your code.

16:31 Yeah, that's awesome.

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

16:35 Like, for example, you hit escape and you have an OK cancel.

16:38 It'll return cancel.

16:39 I hate some of these, these like UI things.

16:41 They show up and you're like, well, it's got one text input and a submit button.

16:45 You hit enter.

16:45 It does nothing.

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

16:46 OK, apparently this is not real.

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

16:51 Right.

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

16:54 This looks like a thing that would be ripe for a short, simple little package that wraps

17:00 up, say, all the OK cancel.

17:02 Yeah.

17:03 OK cancel.

17:04 What kind of icon you want?

17:06 Do you want like a warning?

17:07 Do you want an informational icon?

17:08 The buttons?

17:09 Yeah.

17:10 Yeah.

17:10 It seems really great.

17:11 But this is fantastic.

17:12 So neat.

17:14 And built in.

17:15 Neat.

17:16 So anyway, just a quickie.

17:17 Yeah.

17:18 It comes included.

17:18 And yeah, I really like it.

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

17:24 Right.

17:24 There's more than just really simple dialog boxes.

17:26 For example, like the open file dialog box on Windows could probably be real similar.

17:30 Right.

17:30 Oh, yeah.

17:31 Probably.

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

17:36 So.

17:37 Yeah, exactly.

17:38 It's like a roadmap to like, oh, I can like create a file or, you know, any of these things,

17:42 which I think is pretty cool.

17:43 All right.

17:44 Let's flip away from OS specific to OS general.

17:48 Let's stick with PyCoders for a minute.

17:49 So this one also comes from PyCoders.

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

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

17:59 Edge, maybe.

18:00 Write Chrome extensions in Python.

18:03 Oh.

18:04 How does it work?

18:06 PyScript, of course.

18:08 So, yeah, we just take PyScript.

18:12 And this is an article by Pete Fiston.

18:15 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:26 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.

18:32 Right.

18:32 So 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:40 What do you think?

18:41 Cool.

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

18:42 That's pretty cool.

18:43 Yeah.

18:45 But I have more for you.

18:46 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:52 So as of recently, just published this episode.

18:56 Let me look.

18:56 30, 31 minutes ago.

19:00 And it says PyScript powered by MicroPython.

19:02 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:14 It comes down to like nine megabytes.

19:16 Okay.

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

19:19 That's reasonable.

19:20 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:27 You want it to be good for SEO, all those things.

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

19:32 MicroPython.

19:33 Oh, neat.

19:33 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:48 Oh, wow.

19:49 And MicroPython, you can get that to load up in 100 milliseconds on your page.

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

19:54 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.

20:01 And you cache it, then you're good to go.

20:03 That's exciting, huh?

20:04 That's super exciting.

20:05 Yeah.

20:06 Yeah.

20:06 So this Chrome extension thing is cool.

20:08 when you look at the shipping version.

20:10 I don't know if you can call it shipping because the price grip is still like super alpha.

20:14 But what you can get today.

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

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

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

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

20:33 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:43 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:52 Right.

20:52 Yeah.

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

21:01 Yeah, yeah, they do.

21:02 Okay.

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

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

21:13 So it lies to the world and tells the world it's Chrome.

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

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

21:22 Okay.

21:22 So when you go to the Chrome web store, it's like put this in Chrome, you click it and yeah, it goes.

21:26 So it worked perfectly.

21:27 Sure.

21:27 Cool.

21:27 Yes.

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

21:30 All right.

21:30 Next extra, extra, extra.

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

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

21:35 Yeah, me too.

21:37 I know.

21:37 It's fantastic.

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

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

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

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

21:56 I've been looking and looking.

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

22:01 And boy, it's I would love to link to it, but I just can't find it.

22:05 But it's so it's written in Ruby.

22:08 Right.

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

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

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

22:19 And here's there's just 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:32 So it's like, well, can we have maybe we should have 10 to 20 threads to do the network communication.

22:38 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:47 Well, guess what?

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

22:51 You can talk to web.

22:52 You can call other websites.

22:53 You can receive web requests.

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

22:59 And asyncio requires no additional threads.

23:02 Very, very little overhead.

23:03 No contact switching.

23:04 So this project by Andrew.

23:10 I'm sorry if I am not getting Andrew Godwin.

23:13 Sorry for last name for a moment of Django channel said, what if I rewrote this?

23:20 But in Python with an async and await.

23:22 OK, so there's a bunch of challenges.

23:25 Challenges of running Mastodon.

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

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

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

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

23:39 And it's it's a lot of work.

23:41 Right.

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

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

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

23:57 So, yeah.

23:58 Anyway, I don't know.

24:00 Check this out.

24:00 I didn't know if you if I caught you trying to pronounce it.

24:04 Takahe?

24:04 Takahe?

24:05 I don't know.

24:06 I'm going to go with that.

24:07 But 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:15 I think it was like five days or something.

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

24:24 Desktop mobile PWA compatible.

24:27 Again, how many days and easy deployment, a web worker, a background worker and one database.

24:32 Not all this crazy, crazy stuff.

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

24:37 Let's check out the requirements.

24:39 See what we got going on here.

24:41 UVicorn for an HTTPX.

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

24:46 Oh, interesting.

24:47 It's based on Django HTMX is pretty interesting.

24:52 It's some of the building blocks.

24:53 But yeah, super cool.

24:55 So there's another one.

24:56 This portion of Talk Python to me is brought to you by the AWS Insiders podcast.

25:01 When was the last time you ordered a physical server to host your functions as a service, your latest API or your most recent web app?

25:09 I remember the last time I did.

25:11 That was around the year 2001.

25:13 And yes, it was quite the odyssey.

25:15 Of course, we don't do that anymore.

25:18 We run our code in the cloud with near instant provisioning and unparalleled data centers.

25:24 And the most popular cloud provider is AWS.

25:27 But for all the ways that AWS has made our lives easier, it has also opened a massive box of choices.

25:34 Should you choose platform as a service?

25:36 Or maybe it's still VMs with IaaS.

25:38 What about your database?

25:39 Maybe you should choose a managed service like RDS with Postgres.

25:43 Or is DynamoDB better?

25:45 Maybe Aurora?

25:46 No, wait.

25:46 I hear good things about Amazon DocumentDB too.

25:49 And that's where the AWS Insider podcast comes in.

25:53 This podcast helps technology leaders stay ahead of Amazon's constant pace of change and innovation.

25:58 Some relevant recent episodes include Storage Wars Database Edition, Microservices or Macro Disaster, and Exploring Computer Vision at the Edge with AWS Panorama.

26:10 They bring on guests to debate the options and the episodes are vibrant and fun.

26:15 So if you want to have fun and make sense of AWS, head on over to talkpython.fm/AWS Insiders.

26:22 Yes, I know you probably already have a podcast player and you can just search for it there.

26:26 But please use the link so that they know you came from us.

26:30 Thank you to the AWS Insider podcast for keeping this podcast going strong.

26:36 We just had our Black Friday sale over at Talk Python.

26:39 Cool.

26:40 And that was really excellent.

26:41 Sold a bunch of courses.

26:42 We sold some pytest courses, by the way.

26:44 Yeah.

26:45 I'm just excited because sometimes we have these sort of conversations about you've like cool sales and stuff.

26:51 And I'm glad that I get to be a part of that now.

26:53 We've done other fun things where like we couldn't sell your book through them because it's through the publisher.

26:59 And I guess it gets tricky, right?

27:01 So I'm really excited as well.

27:02 So we did our Black Friday sale.

27:04 And guess what?

27:05 I noticed something a little bit unusual.

27:07 So after a little bit, I opened up Glances on the main web server and said, CPU usage is 85%.

27:14 I'm like, oh, that's not so good.

27:15 88, 91, 92.

27:17 Uh-oh.

27:17 But what was super interesting was Nginx, not Python, was the thing getting hammered.

27:24 So both Nginx workers were like almost 100%.

27:27 And Python was just chilling.

27:28 I'm like, okay, that is a really interesting story for Python performance that something amazing like Nginx that people say is fast all the time is the bottleneck.

27:38 And it turned out it survived, but just barely, right?

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

27:45 So I talked to a bunch of people about this, and I realized that there's one HTTP response.

27:50 I've got to spell that better.

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

27:57 So I'm like, all right, maybe I should try to use some interesting CDN, which I had got a recommendation from one of our listeners, but otherwise hadn't heard about.

28:05 What a cool service.

28:07 So now we have 112 different locations serving up those static files.

28:13 Nice.

28:13 And just processing.

28:14 So I went back today when we did our Cyber Monday, and I said, when I, that was yesterday, when I pushed out the announcement for Cyber Monday closing, and I pulled up the real-time data, look at that traffic.

28:27 That's CSS and JavaScript and images.

28:29 1.4 gigabytes a second.

28:31 Oh, my gosh.

28:32 It's insane, dude.

28:34 And check this out on the server.

28:36 This is the most important part.

28:37 3% CPU usage on NGINX.

28:39 And across the whole computer, across all of the MicroWISGY processes, just a couple more percent.

28:45 CDN to the rescue.

28:47 Exactly.

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

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

28:54 So anyway, I put that right up together for people in order to serve out that data, pay $2, right, for 0.35 terabytes.

29:05 And, by the way, it's going right now.

29:07 Oh, it's got to refresh here.

29:09 They have these cool real-time maps and whatnot.

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

29:16 And that's about 4.5 terabytes per second, which is just insane.

29:21 So anyway, I totally recommend people check this out.

29:24 It's super fun.

29:25 You're reaching people all over the world.

29:26 That's pretty cool.

29:27 Yeah.

29:28 Isn't that amazing?

29:28 You get all these different locations.

29:30 I think it lost its web socket connection because it stopped updating.

29:36 It's like there's a little warning.

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

29:43 But, yeah, anyway.

29:44 Yeah, what's up with the Alaska people not listening?

29:46 Hey, Alaska.

29:47 Yeah, man.

29:47 Come on.

29:48 Yeah, they're going to have to CDN over to Canada anyway.

29:52 So not that.

29:54 This final one here.

29:56 No, not final one.

29:57 The second final one that read all about it or hear all about it.

30:00 Reader 5, I've actually been really getting back into RSS.

30:04 I've never left.

30:06 Yeah.

30:06 What's your RSS story these days?

30:08 No, I use Feedly on my phone just to keep up on stuff.

30:13 Nice.

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

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

30:24 I'm like, you know what?

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

30:30 a little more than just I suggest more Python.

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

30:39 that comes out of the toilet?

30:40 Like, you know, no, not that Python.

30:42 Really not.

30:43 Oh, no, no.

30:44 And so I've just been super loving.

30:46 I've been using Reader 5 with two E's.

30:50 What a nice piece of software this thing is for $10.

30:53 Okay.

30:55 Really, really cool.

30:55 Yeah, so.

30:56 I'll check it out.

30:57 Yeah.

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

31:03 Python blogs that I should be following or people, listeners should be following, put

31:08 that on the YouTube channel comments or send it to us on Mastodon or Twitter.

31:12 And maybe I'll give a shout out to ones that are extra good.

31:15 But very, very cool.

31:16 Let's see.

31:17 Check this out.

31:19 There's a podcast called Sing for Science.

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

31:28 and Guido Van Rossum sit down for a conversation.

31:31 How cool is that?

31:32 That's pretty cool.

31:33 That's really cool.

31:34 So.

31:35 Have you listened to it?

31:35 Yeah, I listened to it.

31:36 I grabbed some, grabbed my phone and my dog and went for a walk and listened to it because

31:41 the sun came out and that was rare right now.

31:43 So yeah, it's really interesting.

31:45 Neat.

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

31:52 I would love a little more facilitation of them to talking directly, but both great people.

31:56 Rivers is awesome.

31:58 He does really cool stuff with Python.

31:59 I had him on Talk Python 327, little automation tools.

32:04 Which was fun.

32:05 So yeah, he's a, he's a legit developer these days, which is, that's pretty neat.

32:09 All right.

32:10 Final thing, Brian.

32:11 Final extra, extra, extra.

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

32:18 AI coding kite.

32:19 Do you remember kite?

32:20 It was like the original GitHub copilot.

32:22 Yeah.

32:23 Yeah.

32:24 Unfortunately, they are shutting down.

32:26 So they've been around for 10 years or so.

32:30 Not quite.

32:30 Seven years, something like that.

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

32:34 So thanks for all the code, I suppose.

32:37 And that's it.

32:38 That's all I got for all my extras.

32:40 I want to add one.

32:42 So we talked to Simon Willison, talked to one of the, one thing I didn't mention about

32:48 in his talk is he encouraged people to write blogs because there's not that, that blogs

32:53 were huge for a while and then everybody was doing it and now not so much.

32:57 And so you do get noticed more if you're writing a blog.

33:01 I think that that's a good thing.

33:03 Plus you can link, we can link to it easier if you've, if you got your article on a blog.

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

33:13 So planetpython.org, if you haven't heard of it, it has, you can either have the full

33:18 content so you can read and it pulls all of this through RSS from, from different blogs.

33:23 And so if you have, and titles only, if you have a, a Python blog or you're starting one,

33:30 check out Python, planetpython.org and try to get your name on the list.

33:35 Maybe put out like three or four articles first and then, and then try to get your name

33:39 on the list or your blog on the list.

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

33:45 So yeah, that's, that's excellent.

33:47 I didn't subscribe to that because I feel like it's a little bit too much of everything, but

33:52 I went through all the recent posts and said, this writer looks interesting or this source

33:56 looks interesting and like subscribe directly.

33:58 So I kind of used it to, to start my exploration of those things I wanted to subscribe to.

34:02 Yeah.

34:02 Not a bad idea.

34:03 And you know, they have RSS feeds cause they're, they're in here.

34:06 Exactly.

34:07 I, since you brought it up, I just want to also point out like one of my roadblocks of writing

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

34:16 and you know, a thousand words and that, you know what?

34:19 My, my new philosophy has been, let's just write like really short posts.

34:24 Like here's one about a fun thing I did with spammers and it's like three paragraphs or here's

34:29 one about installing something as a PWA.

34:31 It's two pictures and four paragraphs.

34:33 And you don't, you don't have to write essay like long essays to contribute interesting things

34:39 and ideas.

34:40 I think so.

34:40 I just following up on that.

34:41 Yeah.

34:42 My, my thoughts are if it's going to be a thread, make it a post instead.

34:46 Yeah, exactly.

34:47 Exactly.

34:48 All right.

34:49 Well, my jokes have vanished.

34:52 I had a cool joke on social media and it got taken down.

34:55 It was, it was, it was really funny.

34:58 It was totally benign.

34:58 I don't know why it's gone, but whatever.

35:00 And then by the way, following up on this, Jeremy Page says you can also RSS Mastodon users.

35:06 Okay.

35:07 That's, that's funny.

35:08 And Mastodon hashtags as well.

35:12 You can RSS those.

35:13 Okay.

35:14 Yeah.

35:14 I follow the Python hashtag over there.

35:16 I could RSS it, I suppose.

35:17 Excellent.

35:18 All right.

35:18 Brian.

35:19 So do you have a joke for us?

35:21 Yeah.

35:21 So speaking of Mastodon on Mastodon, I, I said, I'm getting, I'm getting a lot of great

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

35:31 So I'm asking for people.

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

35:37 I'm still looking for people to follow with good jokes.

35:39 So if you send them my way, if I, or send me their way, if, if you know of people, but here's

35:45 one that I got from somebody on Mastodon.

35:47 So I got it from, who did I get this from?

35:50 I should probably give credit.

35:52 So this came from Steven Box.

35:54 Nice.

35:55 Thanks, Steven.

35:56 So exit condition from monkeyuser.com.

35:59 So it took me a while to get this.

36:03 So there's a couple of people sitting at a desk, paraprogramming, I'm guessing, and then

36:10 somebody else is frustrated.

36:11 They hear, wait.

36:12 And he says, the frustrated guy says, that's it.

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

36:20 And somebody says, wait, there's no, I'm going in.

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

36:30 wait.

36:31 Oh my gosh.

36:32 There's no exit condition.

36:34 So that's a dumb joke, but it's really good.

36:38 And it's got some clever, the cartoon is clever where like the, the speech of the other

36:44 one is off screen.

36:45 So it kind of looks like it comes from the original group, but in fact is coming from the

36:48 recursion of the first one.

36:50 And yeah, it's, yeah.

36:51 Okay.

36:52 Well, one more.

36:53 somebody said, you, I should follow, Olafur.

36:57 Why?

36:57 Anyways.

37:00 I just thought this was dumb and funny.

37:02 Bobby pin.

37:03 No, I go by my full name, Robert Pindle.

37:06 And it reminded me of the Bobby tables thing.

37:10 So yeah, that's exactly.

37:11 I love it.

37:12 All right.

37:12 Well, thank you everyone for listening and Brian, thanks for being here.

37:16 Thank you.

37:16 Yeah.

37:17 Bye everyone.

37:18 Bye.

37:19 Bye.

37:20 I hope you all enjoyed this crossover Python bytes episode.

37:23 If you did, please consider subscribing to Python bytes.

37:25 If you don't already do so.

37:27 Thanks for being part of talk Python to me, have a great new year and I'll see you in 2023.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon