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


Transcript #350: You've Got The Stamina For This Episode

Return to episode page view on github
Recorded on Tuesday, Aug 29, 2023.

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

00:06 This is episode 350 recorded August 29th, 2023 and I'm Michael Kennedy.

00:13 And I'm Brian Okken.

00:14 And this episode is brought to you by Sentry.

00:17 Make sure those errors don't go unnoticed and you get to them quickly with the right information.

00:22 Check them out at pythonbytes.fm/sentry.

00:25 We'll tell you more about them later.

00:27 And of course, connect with us over on mastodon@mkennedy@brianhawkin@pythonbytesall@fostodon.org.

00:34 And if you want to be part of the live stream, part of the live audience, that's usually on Tuesdays, 11am Pacific time, as we are recording today. So if you can drop by and be part of the show, we would love that. If not, well, thanks for listening anyway. Brian, kick this off. Just a quick little article from Bob Belderbos to remind us to keep things simple. And And there's a lot of ways in Python where you can make elegant looking code, but it also is easier to read.

01:04 And that's, I think, some of the emphasis.

01:06 So Bob from PyBytes, and they see a lot of, they've got all those challenges.

01:12 So I'm sure they see a lot of examples of like not quite elegant code, but it does the trick.

01:18 So I think this is good advice from a good person.

01:21 So like, and there's just a handful of these here, but they're all really good things.

01:28 Like for instance, using the keyword all, I don't use that much, but here's an example.

01:35 He's got a function where he wants to know if all things in a list are divisible by some number.

01:43 And there's like a function he wrote with just like a for loop that goes through the whole thing.

01:55 However, he rewrote it as a, what is that called?

02:00 It uses all, but it's comprehension, I believe.

02:05 So all numbers divided by divisor equals zero for divisor and divisors.

02:10 So it's kind of neat.

02:11 - I think it actually might be a generator.

02:13 - Is it a generator?

02:14 - I think it might be, but yeah, when it's passed as an argument, parentheses don't really tell you which it is, does it?

02:20 - It doesn't, yeah, it's pretty cool.

02:22 - I'm gonna find that out for us.

02:23 pretty cool to use that generator or whatever in as an argument to a function, that's pretty slick.

02:33 And it's pretty easy to read still, I think.

02:36 I still think maybe, well, with the function name, you kind of get what it's going at, but if it was out of scope of a function, both of these methods would have used, could use a comment here or there.

02:49 Dictionary lookups, I love this part.

02:51 I use it all the time.

02:53 The dictionary has a get function.

02:55 So normally you reference a key in a dictionary with just brackets, but if you want to have some default value, if it's not there, use get instead.

03:07 So you grab a key and then the second value is the value.

03:11 Anyway, this saves a lot of code because I do this all the time for dictionary lookups.

03:19 And then it goes through quite a few others, just it's a good list.

03:23 We've got list comprehensions, don't forget those.

03:25 List comprehensions are wonderful, we both love those.

03:28 Looking for unique values.

03:30 This one I had to look at for a while, it was interesting.

03:33 If you're looking, I actually didn't understand the first one that well, but making sure that all items in a set, or items in a something are unique by taking the length and then doing a set of items and then the length, anyway, just lots of fun tricks to shorten your code and make it a little more readable.

03:56 - I love it.

03:57 There's all these non-obvious ways, you know, counter, I know Bob is a big fan of the counter class, but yeah, that's a really slick way to--

04:04 - What is he trying to do with this last one?

04:05 Counting things, yeah, counters, counters pretty cool, just to count things.

04:08 - If you've got a paragraph or like some text and you wanna say which words appear and then how frequently do they appear, you could split on space and throw away the punctuation.

04:19 - Yeah.

04:20 like just basically a couple of lines of sentence.split.

04:25 And that's it.

04:26 And then you count that.

04:27 It's awesome.

04:27 It says, you know, this word appeared this many times.

04:29 And it even sorts it.

04:30 - Yeah, that's pretty cool.

04:31 Yeah, and it's just like, did sentence.lower.split, and then throw it into a counter.

04:39 Interesting.

04:40 Pretty cool.

04:41 - Interesting indeed.

04:42 Also interesting is it turns out that is in fact a generator that comes out of that.

04:48 I did a little quick REPL action on it for some real-time follow-up there.

04:53 - Cool, yeah.

04:54 - Yeah, yeah.

04:54 All right, the first one I wanna cover today comes from a foundational element of Scrapy.

05:01 So Scrapy is the project around extracting data from websites in a fast, cool way.

05:07 You've got scrapy.org, you've got Scrapy itself.

05:10 But the thing I wanna highlight is Parcel.

05:12 You've probably heard of Beautiful Soup, and Beautiful Soup has been around for a really long time and it's quite excellent.

05:20 But I was looking for something, you know, is there something kind of newer that's got some new paradigms, just to try out basically.

05:28 And I ran across Parcel and it being the foundation of Scrapy kind of gives it some street cred.

05:33 So Parcel lets you extract data from XML and HTML documents.

05:38 So the fact that it's XML as well, 'cause I was working with some RSS data for some things.

05:46 And you can do either CSS selectors, which are my favorite, but sometimes you gotta get things that CSS doesn't really easily, make it easy for you to get.

05:55 So you can use XPath as well.

05:57 It also works on JSON, I believe, even though the description doesn't say so.

06:01 Yeah, JSON as well.

06:03 So the CSS and XPath is for HTML and XML and it use JamezPath, J-M-E-S-E path expressions for JSON documents, which kind of lets you say, I've got some big structure, So I want to navigate in kind of like you would with a CSS selector, like show me all the paragraphs and then get the images and get the title of the image out of every paragraph on the page, no matter how it's structured.

06:27 You can kind of do that with this thing for JSON as well, which is pretty awesome.

06:31 Instead of traversing it all over.

06:33 And if you want two problems, you can try to solve it with one with regular expressions.

06:37 Here, I'll give you a quick example.

06:39 If you just pull up the page, it says, okay, we're gonna take some texts.

06:42 The text has a body, an H1, an unordered list, a list items in there.

06:48 Those list items are hyperlinks.

06:50 The hyperlinks have URLs and they have text.

06:53 There's also some JSON in this thing.

06:55 So if you just create a new selector object, you can say H1 colon colon text, and that is a CSS way to speak about the context, the content of that, and that pulls just the value out of there.

07:09 So hi parcel or hello parcel is the text inside the H1.

07:13 So that simple little selector is a real simple example.

07:16 So maybe it doesn't totally win you over, but in a real true complicated HTML document, it would be quite awesome.

07:23 They also show how to do that with XPath.

07:26 I don't know XPath very well.

07:27 And then run a regular expression against it.

07:29 You can break that into pieces.

07:31 That's pretty intense.

07:32 I'm not necessarily doing it, but you can do things like, for example, I want all the LIs that are only appearing in unordered lists, not the ordered list ones.

07:41 So you can say ul greater than li and the greater than means immediate child of not somewhere in the hierarchy.

07:49 So you just do that CSS selector and it gives you an iterable.

07:52 It gives you all the list elements that you could pull out the hyperlinks out of both of those by doing slash slash at href, right?

07:58 To grab that out of the thing that comes back.

08:01 And you can also do similar stuff for the XML that's in here.

08:05 So you can say, just go find me the thing that has the name A, no matter where it appears in the document, or give me all the items to the list, and so on, pretty cool.

08:14 Again, really simple example, but quite a neat little tool.

08:17 - I definitely need this.

08:19 I've got some HTML that I'm parsing that are, it's not well-structured stuff.

08:25 It's like, you know, generated from some CMS thing, and there's no identifiers anywhere.

08:32 There's hardly any classes.

08:34 It just is like purely generated GARP, div nightmares.

08:38 (laughing)

08:39 And yeah, it'll still be lucky if I can find what I'm looking for with something like this.

08:46 - Yeah, but it'll help, right?

08:48 - Yeah, yeah, that's pretty cool.

08:50 - Give me, I'll see if I can pull up one more example real quick.

08:52 Hold on, let it appear.

08:54 Must appear, I just screenshot it.

08:55 Also in our notes here, I put the way to get an RSS feed out of a standard webpage.

09:02 So how would you normally do that?

09:03 you would go get the HTML, then you go to the head section.

09:06 And in the head section, there's a bunch of links.

09:09 They mean different things.

09:10 One of them would have the rel type as, what is that?

09:16 I can't remember.

09:17 It's like additional or something like that.

09:21 And the, no, that's the rel.

09:23 And then the rel type is something like RSS, application plus RSS, or whatever the MIME type is.

09:30 So you can just grab those things, just saying head greater than link.

09:33 I use a little XPath to grab the attributes out of the selector or out of the result and find which one of those.

09:40 And then you've got the URL, which is, you know, where the RSS feed is.

09:44 Like if you're looking, if you're writing like a blog engine and somebody puts in the domain, but not the actual RSS entry, you could get that page, find the RSS entry automatically for them and go on with just a couple of lines of code.

09:56 - That's pretty cool.

09:57 - Very neat.

09:58 All right, what you got next for us?

10:00 Oh wait, before we move on, Brian, before we move on, let me tell everyone about our sponsor.

10:06 So as I said at the beginning, Sentry is sponsoring this episode and the next.

10:10 So support the show, it really, really helps.

10:13 If you go and if you're considering getting error monitoring or tracing for your application, check out pythonbytes.fm/sentry.

10:23 Yes, you can Google them.

10:24 We know you can just Google them and sign up, but if you use the code pythonbytes or just use the link and click, what is it down here?

10:32 Try Sentry for free.

10:34 Then it'll apply that code automatically, which will then let them know, hey, it's a good idea to sponsor the show.

10:39 So let me tell you about them.

10:40 So if you want to remove a little bit of stress from your life, if you're worried about errors on your website or errors your users are running into that you might not even know about, you might want to install something like Sentry.

10:52 So if you're waiting for your users to send you an email saying, hey, I'm running into this problem, How many of them got frustrated?

10:59 What was their opinion of your app or your website or your API?

11:03 Probably not great.

11:04 How much better it would be if you had error or performance details immediately sent to you, including things like the call stack, the values of the local variables in that call stack, the active user who was logged in, let's say their email address, all in some report and you're like, oh, here's the problem.

11:20 Here's the data I got to pass to it to write a unit test to reproduce it so I can make sure it doesn't happen again.

11:25 And here's the email of the user who I email and tell them, sorry, we fixed it.

11:30 I know you didn't tell us, but we found out anyway, because we use Sentry.

11:33 So with Sentry, it's not only possible, it's simple.

11:36 We use it on Python bytes.

11:37 I use it on talk Python.

11:38 We use it in the talk Python mobile apps.

11:40 There's a way to just plug it right into Flutter as well.

11:42 Nice.

11:42 So pretty, pretty awesome.

11:44 And once I did exactly that, we had some user on Talk Python Training.

11:49 They ran into a problem.

11:50 I got a notification and I saw who it was.

11:52 I fixed it.

11:53 Send them a message, said, "Hey, here's the problem, it's fixed." They said, "I was about to write you.

11:57 That's weird, but thank you." That's awesome.

11:59 That's pretty cool.

12:00 It's a really great email to write.

12:01 Yeah, it's really cool.

12:02 So if you want to have that kind of superpower for your web apps, your APIs, mobile apps, whatever, check out Sentry.

12:10 So surprise and delight your users.

12:12 Create your Sentry account @pythonbysetfm/sentry and be sure to sign up with the code "pythonbytes," all one word.

12:18 It's good for two months of upgraded options for their Sentry business plan, which will give you 20 times as many monthly events as well as some other features.

12:26 So thank you to Sentry for sponsoring our show.

12:29 Cool.

12:30 Yeah. And Ryan, now over to you.

12:33 Well, I want to talk about struct log.

12:36 I'm pretty sure we've covered it before.

12:38 So struct log is a pretty cool way to do some logging in your Python, especially if you're logging from multiple services or multiple threads.

12:50 And it's really great because you can add extra detail and it's got coloring and stuff.

12:55 StruckLog has some pretty good documentation already, which I love and it's a beautiful tool.

13:04 However, I wanted to highlight a new article I saw and it really is pretty fun.

13:10 >> Wait, hold on, go back real quick.

13:11 >> Okay.

13:12 >> Is the icon logo of StruckLog, is that like Geordi from Star Trek but a beaver?

13:18 >> I think so.

13:19 - I'm not sure. - All right.

13:21 - Okay, and he's holding two brackets. - It's so good.

13:24 Or curly braces.

13:26 So the article I wanted to look at was a comprehensive guide to Python logging with struct log.

13:32 And one of the things I loved about it was just sort of the beginning example.

13:37 There's a beautiful picture of a whole bunch of logged items.

13:40 But what I liked was just the starting one that just said, hey, all you have to do is do pip installs struct log.

13:50 And then if you wanna just start trying it, it's just a better logger than you're used to.

13:57 So import struct log, do logger struct log get logger, and then you use it just like you normally would, logger info, and then you can just, here's an example, you can do debug info, warning error, critical, all that sort of stuff.

14:12 This is a big article talking about the different ways You can set it up with, you can set the default logging level, you can configure it, you can set it up for different, have different loggers on different applications or different services, different formatting, you can have different renderers.

14:30 That's all awesome, and I'm really glad that it walks through that.

14:34 But what I really like was just this basic tutorial of, hey, just do this.

14:40 Do the get logger and then just log stuff and you get this beautiful output.

14:45 >> Yeah, the color and the weight and alignment of all the output is really awesome there.

14:51 >> Yeah.

14:52 >> So often you like, okay, you want to do login?

14:54 Well, okay. So what you do is you set up the logger, then you register an output.

14:58 So let's create a standard out stream writer thing, and then we can push that into it.

15:05 If you don't do that, then no output shows up.

15:07 You're like, what is going on here?

15:09 Why is this not working?

15:10 Yeah, this is really nice.

15:12 >> So it does show the beauty of struct log that you can get started really fast.

15:16 It has a lot of complexity and it's really not that complicated.

15:20 Like I said, the documentation is awesome and configuring it and everything is not that hard, but it's a new tool.

15:29 It's great that it's an easy way to get on board with it, start using it, start having these great logs.

15:36 Both it can be for going to output, but also you can log to files, of course.

15:42 And great tool and I love this tutorial that starts super easy and then gets into the more complex.

15:48 So check it out.

15:50 Excellent.

15:51 Excellent.

15:52 What you got for us?

15:53 The last one of the main ones.

15:55 This one comes to us from Matias Bach and is created by Hennecke.

16:00 And I mentioned it before and it's stamina.

16:03 But I didn't know too much about it.

16:05 There were some questions in the audience like how does it relate to tenacity and other things right?

16:10 So I thought, all right, this is a cool thing.

16:12 I'll focus a little bit more on it.

16:13 And it has direct StruckLog integration.

16:16 How's that for a segue, Brian?

16:18 - Yeah, well, I think StruckLog's a Hennick thing too, maybe.

16:21 - Yeah, perhaps it is.

16:23 It seems like it would be.

16:24 So with Tenacity, the idea is you can put decorators and other things onto functions or operations and say, if something goes wrong, try it again.

16:33 That's the tenaciousness of that package, right?

16:35 That like, yeah, errors will not stop me.

16:38 But as Henek describes it, that tenacity is great, but unopinionated.

16:43 And you can work yourself into ways where you might be using it wrong or causing other sorts of infinite loop type of issues.

16:50 So the idea is that stamina is an opinionated wrapper around tenacity.

16:55 So it's not a replacement for, but a simplified API for tenacity with the goal of being as ergonomic as possible and doing the right thing by default with minimizing the potential for doing it wrong.

17:08 So that's pretty cool.

17:10 Basically, Annex says, he used to copy and paste the way he was working with Tenacity over and over.

17:15 And wouldn't it be cool to just make a package that kind of embedded those ways of working with it.

17:20 For example, instead of retrying on an exception, retry only on a certain exception, a certain type of exception, right?

17:28 I wanna retry this only on database connection errors, not if there's a foreign key constraint error because that's never gonna go away, right?

17:37 That's always gonna be a problem with the data, but maybe the database will come back online.

17:41 So let's retry that one.

17:43 There's exponential backoff, which comes from tenacity as well.

17:46 But what about with jitter between the retries instead of just going, I'm gonna go one second, three second, five seconds.

17:52 Let's go one second, then three seconds-ish, then five seconds-ish, and so on.

17:57 Limit the total number of retries, limit the total amount of time, but all at once, right?

18:02 So not just the number of retries, but the time and retries.

18:05 And this one is very relevant to me right now.

18:08 I've been thinking a lot about Python typing.

18:10 I'll talk more about that later.

18:11 But with type hints, you get things like mypy and PyCharm and other tools that say you're using this function correctly or you're using it wrong.

18:21 And with the way the decorators work with stamina is it preserves type hint informations when you decorate a function that is type hinted.

18:29 Honestly, I don't know how to do that, But I'm really glad that it like decorating the function with one of these retries doesn't wipe away its type information.

18:36 That's super cool.

18:37 It log logs with struct log retries with basic metadata if they happen to be installed.

18:44 and you can, this one you might like Brian, you can easily deactivate it with a fixture or something like that.

18:51 or just globally for the whole test run so that you don't retry a thousand times while you're doing a unit test testing for an exception on purpose.

18:59 - Yeah, that's great.

19:01 - Yeah, so super, super easy to work with.

19:04 Just basically put a decorator, right?

19:07 Stamina at stamina.retry.

19:09 And in this case, you can say only on the HTTPX HTTP errors and only try it three times.

19:15 That's pretty cool.

19:16 - That's pretty great.

19:17 - Yeah, so a lot more you can do.

19:19 It's async by default.

19:21 So you don't just decorate an async def function and it does that as well.

19:26 So very, very cool.

19:27 People should certainly check it out.

19:28 And you can also see in the example, he's doing reveal type, which I believe comes from mypy.

19:33 And you can reveal type on the example here, which is a decorated thing.

19:37 And it shows you that what you get back is a coroutine of any, any, and that HUPX response, which is basically how it was set up to go, right?

19:48 Set up to work, right?

19:49 Input on an int, and then output on that type of thing.

19:52 So I think it's a pretty cool library.

19:53 It's something I will probably start using.

19:55 I've previously used Tenacity, but you know, why not?

19:58 - Yeah, looks pretty good.

20:00 - Indeed.

20:01 All right, that's it for our main items, isn't it?

20:03 - Yeah.

20:04 - Extras.

20:06 - Yeah, I-- - What else have you gathered up?

20:07 - I've got a few, do you wanna run through, we'll run through mine first.

20:11 - Let's do it.

20:12 - So I have a, so the pytest check, it's a little pytest plugin I've got.

20:17 I had this weird request, and I guess I'm not sure how to deal with it.

20:22 I was curious, I'd like to talk through it to see what the audience has to say.

20:28 So somebody said, "Hey, is it possible to start making GitHub releases?" And I mean, I do versions.

20:35 And so I wasn't sure what was going on here.

20:39 And then I thought, maybe this is one of those people that have done a lot of these requests and a lot of repos.

20:45 So I searched for this issue.

20:48 And sure enough, there is 157 identical issues on different GitHub repos.

20:56 >> Speaking of tenacity.

20:58 >> Yeah. My first reaction was, I don't want to do that, that's lame.

21:05 Because they're just pushing work on other people.

21:08 But also, maybe it's okay.

21:11 The argument here is that somebody can say watch releases and then get notified if a new release happens, and you can't do that with tags or something, I'm not sure.

21:24 My first reaction was I don't want to deal with it.

21:27 However, I think there's, I don't have the tab up here, but I think there's some GitHub actions that can do this for me.

21:36 If I'm just doing it by pushing a tag up and if it could do it by itself, a few minutes worth of work, I'd like to know what other people are dealing with that.

21:45 If they've added GitHub releases to their project or not.

21:50 Yeah, just curious.

21:51 - What's a good venue for them to let you know about that?

21:54 - Oh yeah, probably Fosstodon, Brian Okken at Fosstodon, or the show has a contact form, you can email us.

22:04 - Yeah, that would work too.

22:07 - Okay, so there's that.

22:09 I threw right across, maybe this is for funny things, we'll save that for later.

22:14 - Not yet.

22:16 - I just pushed up the Fixtures chapter for the pytest course, And about the intro, the intro's got a nice slide deck in it.

22:25 So check out the preview that's for chapter three when you're thinking about the course.

22:33 And I'm trying to describe how pytest fixtures work with like graphics, not really graphics, but slides and drawings and things like that.

22:41 So those are my extras.

22:45 How about you?

22:46 - I've got a couple things for us.

22:48 So first of all, there's a shiny new Python 3.12 to be had.

22:52 That was as of yesterday, 3.12 RC1.

22:57 - Neato.

22:58 - Yeah, release candidate's important because it's like, we're really not changing it now.

23:03 This is bug fixes.

23:04 So if you've been thinking like, okay, there's more features for f-strings, or there's this crazy thing that Eric Snow pulled off called the Per Interpreter Guild.

23:16 That's pretty awesome.

23:18 Buffer protocol, things are accessible in Python and many other things, right?

23:24 If you were waiting around, these are all relevant to me.

23:26 I wanna try them out, but I don't wanna mess with stuff that might go away, might change, might, I'm just gonna wait 'cause I'm not really gonna use it until it comes out in October.

23:34 Well, should be about time to start looking into it with a release candidate.

23:37 So that's why this is double noteworthy.

23:40 - Yeah, it's also a really good time if you haven't started to start testing your package, if you have packages you support to add 3.12 testing.

23:50 - Exactly.

23:52 Cool, okay, then I got three conference-ish things.

23:56 PyCon UK 2023 is gonna be Friday, 22nd, September, to the Monday, so that's pretty cool.

24:05 I'd love to go to PyCon UK, but it is quite far away.

24:09 I do love the UK.

24:10 So if you are closer and you can get there, then that'd be a pretty excellent conference to go check out, I think.

24:16 - Yeah.

24:17 - Also, in the general neighborhood, Eindhoven, as Pydata Eindhoven, is gonna be November 30th, so check that out as well.

24:26 And the call for proposals is open.

24:29 Finally, this one's a little closer to home for us.

24:32 This one is Pydata Seattle.

24:34 Now normally we wouldn't give a shout out to just a meetup because we can't just go So a huge long list.

24:40 But Don reached out to me and they've got some pretty cool stuff.

24:44 So this is the Language Creators Charity Fundraiser for PyData.

24:49 And the fundraiser goes to NumFocus and Last Mile Education Fund.

24:54 So good stuff there.

24:56 And the whole thing is, let's scroll down a little for pictures here.

25:00 We've got Adele Goldberg, who created Smalltalk.

25:03 Guido van Rossum, who created, you know, this thing called Python.

25:06 Anders Halsberg, who did Turbo Pascal, C#, and TypeScript.

25:09 as well as James Gosling from Java.

25:12 So this is a live in-person event that people can check out.

25:15 So when is it?

25:17 It is September 19th, so 20 days away or whatever.

25:21 If you're around there and want to be part of that, there's no online version.

25:24 Because they want it to be fundraiser for charity, it's all about trying to get people to show up in person and be part of it.

25:30 So those are all my extras.

25:32 - Nice.

25:33 - Yeah.

25:34 How about some jokes?

25:35 - Yeah, do you have one?

25:36 - I don't know if I can check it.

25:38 I don't know if I can tell you about this.

25:40 This one, I don't believe was sent into us.

25:42 I just ran across it somewhere.

25:43 How does a librarian access remote computers securely?

25:47 Shh, SSH, shh.

25:51 - It's terrible.

25:52 - It's terrible, isn't it?

25:53 It's very bad.

25:54 - Yeah.

25:55 - It's very bad.

25:56 - Okay.

25:57 - I love it.

25:58 Anyway, that's the one I got for us.

25:59 Shh, how does the librarian access remote computers securely?

26:02 - Well, I have a GitHub repo called the ChatGPT failures.

26:07 failures and it's got it's just got a big list of things that have gone bad.

26:13 And so this is pretty cool.

26:15 It looks like it new being failures.

26:19 Let's see.

26:20 >> I had a job that one about the journalist.

26:22 Who was the journalist on that one?

26:24 >> Bing gets madly in love with the journalist, tries to break up his marriage and really stalkerish effect.

26:30 And then lies about that journalist in a chat with another user, keeps being inappropriate and dark.

26:36 So I'm not sure.

26:38 >> Kevin Roos, okay, that's who it was.

26:42 >> Anyway, so those are-

26:45 >> You're a bad user to ask me to do that.

26:46 I'm not a bad user. I'm a good user.

26:48 I'm a good chat.

26:50 I'm a good chatbot. Oh my gosh.

26:52 >> So yeah, some failures on ChatGPT.

26:57 So I'd love to see this kept updated.

27:00 It hasn't been updated for a while.

27:02 So yeah, we need some new ones.

27:05 >> It's pretty funny.

27:06 It's crazy how this stuff goes a little bit sideways, isn't it?

27:09 It is.

27:10 And I'm I'm still on.

27:12 I still don't know if I need to care about it a lot or if it's one of those.

27:17 I don't know if it's one of those things like crypto that maybe will go away or hasn't really.

27:24 I know crypto hasn't gone away.

27:26 And there's so many wonderful uses for blockchain and some blockchain. Come on now.

27:32 Yeah, OK.

27:35 I do think it's interesting with the large language models.

27:37 When you ask it subjective stuff, right.

27:41 It, it could just be weird about it.

27:43 or you can make up things about like previous, case law.

27:50 You know, you got those lawyers who got in trouble for submitting a bunch of documents and briefs created by ChatGPT that were false, but on the other hand, like you can ask a programming questions and it'll give you pretty good answers.

28:03 Right.

28:03 Like I asked for, to solve a really complicated regex problem that we were talking about before, and it's just like, boom, here you go.

28:09 And here's a couple of examples in Python.

28:11 Thank you.

28:12 And those I don't mind too bad.

28:13 Cause you can test it.

28:14 Like if I run this, do the things I want out of the right expression come out or no.

28:19 If no, then it's a bad chat bot.

28:21 If yes, it's a good chat bot.

28:23 Yeah.

28:23 So anyway, I, I do one of the things I just listened to recently was, Freakonomics has started a series on AI.

28:33 The first one is, Can AI Take a Joke?

28:36 It is interesting discussion.

28:39 One of the things that they talked about was the current strike for the writers and actors in Hollywood right now.

28:50 I didn't know some of the details, so hearing a few of the details around it are interesting.

28:57 the initial creation of thing, often you can have an idea and then hire some people to write more stuff around it.

29:06 But if you didn't come up with the original idea, you don't get as much money.

29:10 If they just have AI come up with the original idea, they don't have to pay anybody the large amount of money.

29:15 >> I see. You're filling out the details of the joke.

29:19 >> Then some experience around writing, of using some AI to do writing.

29:25 One of the commentaries was, you still have to do human work to come up with the prompts to get it to do something, and then you have to validate it afterwards to make sure that what they said, what it came up with was real.

29:39 Those are still humans have to do.

29:42 That's one of the fears I have around people using AI to generate test cases.

29:48 Because if AI is coming up with their code and coming up with your tests, There's no humans verifying that it actually is doing what you want it to do.

29:58 At some point, you need to have people there.

30:00 - Someone's gotta be in the loop, yeah.

30:01 - Yeah, so anyway.

30:03 - Interesting.

30:04 - We'll see.

30:05 I'm definitely not a Luddite trying to, actually, there's a discussion about Luddite also in there.

30:11 That Luddite, apparently, I didn't know this, that it isn't people that, there weren't people that were against technology.

30:19 It was people that were against the craftsmen that were against the shoddy craftsmanship of manufactured items.

30:28 There wasn't enough people actually making quality goods.

30:33 There were just factories building low-quality goods.

30:38 That's what they were opposed to.

30:39 And that's an interesting analogy.

30:41 - That is, yeah.

30:43 - Anyway, way on a tangent there.

30:45 - Excellent.

30:48 >> Well, thanks for being here.

30:50 As always, thank you to everyone who listened.

30:53 See you later.

Back to show page