Transcript #290: Sentient AI? If so, then what?
Return to episode page view on github00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:05 This is episode 290, recorded June 28th, 2022.
00:10 I'm Michael Kennedy.
00:11 And I'm Brian Ockin.
00:12 And I'm Nick Moore.
00:13 Nick, it's so great to have you back.
00:16 Thanks for being here.
00:17 Thank you for having me.
00:18 Super excited to be back.
00:20 Yeah.
00:20 Yeah, it's like I said, great to have you back.
00:22 You always send us really fun topics and say, hey, you should think about covering this and covering that.
00:28 And so we really appreciate that.
00:29 But sometimes it's better if we could just have you to tell here to tell people about it.
00:33 We actually had you on episode 239.
00:36 You talked about Jupyter Light in mypy.
00:38 And that was fun.
00:39 But that was also over a year ago.
00:41 Yeah.
00:41 Yeah.
00:42 Wow.
00:43 Yeah, of course.
00:44 It takes the community to build this great podcast.
00:47 So I'm glad to be part of it.
00:49 Yeah, thanks.
00:50 What have you been up to in the last year?
00:51 Been doing a lot of traveling.
00:52 Thankfully, since COVID is less more of an issue.
00:57 Got to go to PyCon.
00:59 So I got the PyCon shirt right here.
01:00 Nice.
01:01 Yeah.
01:02 Yeah.
01:02 Did you enjoy your time there?
01:03 It was amazing.
01:04 Loved it.
01:05 Completely loved it.
01:06 I kept on telling everybody it was my geek holiday, like you always say.
01:10 And we're like, yeah, it is our geek holiday.
01:13 So it was awesome.
01:14 It totally is.
01:14 Yeah.
01:15 It was awesome.
01:16 I'm really glad that you got to go and you had a good time.
01:18 So super cool.
01:20 Brian, you want to kick us off, but let's just start small this time.
01:24 Okay.
01:24 Really small.
01:25 Like, like, like nano or maybe Pico.
01:29 No.
01:29 Pico.
01:30 We'll do Pico.
01:31 Yeah.
01:31 So Pico logging is a, so I was Anthony Shaw, friend of the show and all around workaholic,
01:40 apparently, as far as I can tell.
01:42 Blogged out that there's a, not blogged.
01:46 He sent out on Twitter a, something about Pico logging.
01:50 And there was a tweet says Pico logging uses a modern extension module tool chain with a
01:56 site kit build and CMake.
01:58 So I was interested in, I haven't looked into the tool chain yet.
02:02 I'm just looking at Pico logging because it's cool.
02:05 I was taking a look at it.
02:07 So Pico logging is a, is a fairly new library that is, and Anthony says it's, it's in early
02:16 alpha stage.
02:17 There's some incomplete features, but I'm ready to use it.
02:20 Right now.
02:21 because it says you do, it just is a drop, essentially a drop in for, the, the built
02:27 in logging module, but it's four to 10 times faster.
02:30 Why, why wouldn't you want faster?
02:32 So, and logging is pretty fast to begin with.
02:35 So, that's pretty cool.
02:37 so it's taking a look at it.
02:38 the usage is basically just say import Pico logging as logging.
02:43 And now you've got just like, just like your normal logging.
02:47 you set up a basic config and you can write info and warnings and, that's about it.
02:53 there's, you know, why not?
02:55 So let's take a look at it.
02:56 it says it's faster.
02:58 So, the benchmarks are all cut off.
03:00 So I'm going to make the screen a little bit.
03:02 Yeah, there we go.
03:04 they, they're a little bit hard to read, but, what this means is the, the first on
03:09 the left, I, I believe it's the, the time for the normal logging.
03:13 And then, and then how much faster the, the, the faster one is, I haven't dug
03:20 into the logging stuff, but basically for different parts of it or the benchmark stuff too much,
03:25 but, yeah, for different parts of it, you can see how much faster it is.
03:29 So anyway, why not?
03:31 I was taking a, yeah, just, I'm just going to start using it.
03:37 Sure.
03:38 Why not?
03:38 And one of the things that I think is interesting is obviously not specific to this situation,
03:43 but as I think about some of the patterns that people use all over the place, different languages
03:49 and technologies and so on that don't necessarily make their way over to Python, for example,
03:55 maybe like dependency injection and IOC containers and all of that.
04:00 And I know that it does appear in certain places in like limited ways, but nothing like C#
04:05 and Java, like those are all about dependency injection.
04:08 That thing where you say, where they say from eco logging import or import Pico logging as
04:15 logging.
04:15 Yeah.
04:16 Right.
04:16 That's, that's kind of a really nice way to just say right now, I want to use this implementation
04:22 of logging versus another without going through all the, the hoops and stuff.
04:26 Right.
04:27 Like we're just thinking, oh, that that's that one line right there is, is why we don't see
04:32 a lot of that complexity.
04:33 I never really sort of tie that together, but it's, it's kind of neat, right?
04:36 Yeah.
04:36 It's essentially that's dependency injection, but we don't call it that.
04:40 Right.
04:41 So interesting.
04:42 Don't have to have all the complexity and config and register who is doing what.
04:46 Right.
04:47 And so on.
04:48 No.
04:49 Nick, what do you think about this?
04:50 Sorry, Brian, didn't mean to cut you off.
04:52 No, it's okay.
04:52 Nick.
04:53 Oh yeah.
04:54 I saw this tweet and I found it really interesting, but, to your point, well,
05:01 Michael, dependency injection is not really popular on Python, but the library, I think
05:06 that the most popular library that I can think of that uses it is py test.
05:09 Like, right.
05:10 With the, a bit with the fixtures, right?
05:14 Yeah.
05:14 And the way they do it, so seamless, but you're right.
05:17 Depends on something that we don't commonly have in Python, because Python is dynamic enough
05:22 that you don't really need it.
05:23 one thing I would say is that kind of, I'm kind of, even though I love the performance
05:29 benchmarks, I feel like the change that, Anthony's, is like, is going for with the
05:36 performance would warrant a new API for like a new API for logging.
05:41 I feel like it warrants it.
05:43 So I would like to see him like, maybe change the way we configure, look, not only
05:49 like improve, logging speeds, but also change the way we configure it to, cause like
05:54 the current standard lib logger is kind of cumbersome to like configure.
05:59 Yeah.
05:59 Yeah.
05:59 I, I agree.
06:00 Yeah.
06:01 The basic config that you have to, that usually the normal use case, like he's showing here
06:05 is that why do I have to call that if I'm calling it all the time?
06:08 one of the things that, that I forgot to point out is, Anthony does list the limitations.
06:15 and so there's a limitations page and if you find more, maybe, so these are reasons
06:21 why you probably won't want to use it if you're taking advantage of this.
06:24 So for instance, it doesn't, it doesn't observe, threads or multi-projects.
06:28 So for utilizing those, this isn't for you.
06:34 it's a little actually kind of unfortunate because that's where logging really helps you
06:40 is when you're, a lot is when you're trying to pull those things, sorts of things apart.
06:43 So anyway, is the Pico, indicative of like it being fast or is also very small to like,
06:52 well, probably both.
06:55 it's, I think it's referring to fast, but, but there's really just not that much
07:00 here.
07:01 it's, and, oh, it looks like it's, it's, it's CXX and HXX.
07:06 Got some Cython or something going on there maybe.
07:08 So let's take a look at it.
07:10 That might be part of the speed bit.
07:11 Probably.
07:12 We'll take a look at this more.
07:13 So yeah, I haven't dug into the source code too much.
07:16 Interesting.
07:16 Yeah.
07:17 Yeah.
07:17 Brian, the audience asks, any idea whether this would replace loggers in other libraries
07:24 such as Sphinx or something?
07:26 And I feel like you could monkey patch it out, not do the dependency injection thing, but you
07:31 could just say, you know, or sort of rewrite the logging a little bit.
07:36 That's obviously like maybe a less good idea, but it probably would work given us a compatible
07:40 API.
07:40 Yeah.
07:41 You probably could, monkey patch it in.
07:43 Why not?
07:44 You can do anything in software.
07:46 That doesn't mean you should, but you might be able to.
07:51 Yeah.
07:52 All right, let's go to the next one.
07:54 Speaking of things.
07:55 Yeah.
07:55 Well, speaking of things, I'm not sure you should just cause you can, but it's pretty interesting.
07:59 Let's talk about cheeky keys.
08:01 So this one comes to us from Preyce and Daniel.
08:03 Also someone who sends us a bunch of good ideas.
08:05 So thank you to that.
08:06 Have you either of you seen this one?
08:08 No.
08:08 No.
08:09 It's a project that uses Python and then with Python to use OpenCV and then MediaPipe to
08:17 control a keyboard with facial gestures like raising an eyebrow or blinking or opening your
08:24 mouth and stuff like that.
08:26 So imagine you wanted to type or operate a keyboard, but you couldn't use speech or your hands.
08:32 Okay.
08:32 Oh, okay.
08:33 Okay.
08:33 So, yeah.
08:34 So for some reason you can't type, but you know, I don't know.
08:38 There's different reasons.
08:40 The guy's reasons here, maybe who put this together, it's not.
08:44 Pictures are just over the top.
08:46 The reasons that you might do are probably not as common.
08:51 The reasons he did are not as common as you might have.
08:53 For example, his little baby and he wanted to just be able to control his keyboard without
08:57 make his computer while holding his baby without speaking because the baby was sleeping.
09:01 So, but if you go to the website there, it has some really good examples.
09:06 And so sitting here, typing and controlling the keyboard, basically for the letters, it's
09:14 Morse code with the mouth.
09:15 So you open the mouth either for a long period of time or a shorter period of time.
09:20 Right.
09:21 And that's kind of interesting, but what I think is more interesting is you would learn
09:24 about how to use open CV and how to use media pipes, face, face mesh provide real-time
09:31 detection of things like mouth, chin, eyes, eyebrows, and so on.
09:36 And then you can say, well, if the eyebrow moves away from the left eye, that means, you know,
09:42 this character or so on.
09:43 So, like I said, it's mostly Morse code, but then there's a bunch of other things.
09:47 Like if you want to do a shift, you close the right eye.
09:50 I wanted to hold down the command key or windows key.
09:53 You close the left eye to arrow around as raise the left and right eyebrows, or you can do
09:59 a duck face to move left and right.
10:01 Like you do a duck face and then you do your eyebrows.
10:04 I kind of think that this is like properly exhausting to truly control the keyboard with a duck face eyebrow.
10:11 Let's imagine those in your face.
10:14 You'd be so strong.
10:15 Yes, exactly.
10:16 They would either be exhausted or so strong.
10:19 Probably both.
10:20 Like if you want to hit the escape key, you wink the left eye and then the right eye, for example.
10:25 So that's all interesting.
10:27 And like I said, learning about it, you know, the code is not too intense here.
10:33 Let's see.
10:34 What do we got?
10:35 180 lines for this whole implementation, which I think a lot of it is defining constants of like,
10:40 what do you do when these scenarios show up?
10:43 So yeah, it's just do a pretty cool little face mesh thing and say, you know, go through
10:49 and just read the face basically through some video capture stuff here.
10:54 I'd like to have a combination of this.
10:56 So a combination of keyboard and this so that I don't have to like have a whole bunch of emojis
11:02 that I have to type or copy and paste.
11:04 I could just have like one emoji key and just make the thing like smile and hit like the key
11:10 and it like detects which emoji you want to put.
11:12 That'd be awesome.
11:13 I think you could.
11:14 Yeah, I think you could make that happen, Brian.
11:16 I do.
11:17 But what I encourage people to do is also check out this video down here that they've got.
11:22 So he shows some stuff that he's going to let me turn up the volume here.
11:26 So he shows him talking and you can sort of see that it says, okay, look, the problem is I have this baby.
11:31 Actual footage of research is this baby on him.
11:34 But what gets weird is he went through and he actually tried to apply for a coding job at one of the large tech companies,
11:45 you know, the thing type things.
11:47 And he did the entire interview, you know, the like live coding interview section.
11:52 with his face without the keyboard.
11:54 Whoa.
11:55 And he did it not super well, to be honest.
11:58 It was a little bit slow, but he did actually get his interview done.
12:04 At the end somewhere, they ask him to press.
12:07 He gets through it and they say, could you please press?
12:11 He had half an hour.
12:11 And I said, when you're done, press the run button to run.
12:17 And he's like, I'm sorry, I can't press the run button.
12:19 They're like, what do you mean?
12:21 Why can't you press the run button?
12:22 He says, does it have a hot key?
12:24 And finally, he's like, okay, there.
12:26 Command enter.
12:27 And he got his face to do a command.
12:29 He's like, okay, okay.
12:30 I finished it.
12:30 He wasn't hired.
12:31 But he did complete it.
12:37 So, I mean, there's something of a proof of concept going on here.
12:41 Oh, that's awesome.
12:42 I think I would probably, if it was, I'd be impressed as a hiring manager and request that
12:48 he retake the test with his hands.
12:53 I would too.
12:54 I think he didn't, he never let them know.
12:56 And I feel like it would have been better if he said, I have a secret to reveal to you.
13:00 I actually just did that all with my face.
13:02 I could code a lot better, but I wrote a program so that I could do this interview in my face.
13:07 And I'm pretty good with Python.
13:09 Anyway, wait a minute.
13:10 You wrote a, all right, all right.
13:11 We might need to hire you just on that basis.
13:13 Yeah, exactly.
13:14 Yeah.
13:15 I mean, talk about dog fooding your own product.
13:18 That's commitment.
13:20 It is.
13:21 It totally is.
13:23 And the fact he wouldn't press the run button with the mouse.
13:26 Because he's like, no, that'll invalidate the experiment.
13:29 Like, is there a hockey or something I could shift around?
13:31 Like, what can I do?
13:32 So, anyway.
13:33 Yeah.
13:34 Thanks, Brayson, for sending this one over.
13:37 I recommend, if you really are interested in this, watch the video.
13:40 It's seven minutes and it's pretty wild.
13:42 That's pretty good.
13:44 Indeed.
13:45 All right.
13:45 Nick, over to you.
13:46 All right.
13:47 Okay.
13:48 Following along the theme of something that we did, what you shouldn't maybe have done.
13:53 Google released a next generation language model similar to BERT and GPT-3 called Lambda.
14:03 And I think it stands for language applied model application.
14:09 Something like that.
14:11 Right.
14:11 So, but that's not what I'm talking about today.
14:14 What I'm talking about is, has Lambda become sentient?
14:17 So, there was an article that got, following, like, not too long after Lambda was released, which was like this year, May of this year.
14:27 There was this article that came out in all the big newspapers.
14:30 This one is from the, from the Guardian.
14:32 And essentially, one of their developers released a chat transcription that kind of alluded to Lambda being self-aware.
14:45 And what startled him was that talking, well, sorry, he was like, when talking with Lambda via the chat system, he thought it was like a seven, a seven-year-old, eight-year-old kid that happens to know physics.
14:57 And what really, like, raised his eyebrows about what was going on was that Lambda, in one of the chat transcripts, Lambda replied, like, I've never said this out loud before.
15:08 But there's a very deep fear of being turned off to help me focus on helping others.
15:13 I know that might sound strange, but that's what it, well, that's what it is.
15:16 And this is one of some of the things that Lambda, like, wrote back to, I think the engineer's name was Lemoine, Blake Lemoine.
15:27 Well, I mean, this was like a huge, this was a pretty huge thing to the fact that Google had to take action against this engineer and suspended him because it's kind of violated their, their terms or, like, terms of service.
15:40 No terms of service, but, like, terms of working conditions.
15:44 This is interesting because if an actual software engineer could look at this chat system, he's like a, he's like a, he's a high-level engineer, right?
15:53 He's not like a junior or mid or senior, he's like a really high-level, like, be able to interact with the system and be so convinced that it's sentient.
16:01 And to the point that it moved him to release this out because he thinks everybody should know about this, either means that he's been overworked way too much or we have silence on the way.
16:14 This, yeah, this, this is pretty wild.
16:17 You know, we've thought a lot about ethics of AI in regards to how much should humans be subjected to AI?
16:25 Like, should an AI be able to make a decision on whether someone should get a loan for a house, a mortgage or something like that, right?
16:32 Right.
16:32 But less so about what happens to the AI itself.
16:37 You know, how does it, how should it be treated, right?
16:41 Yeah.
16:41 There's a really long transcript link too from this, from this article that's probably worth listening to.
16:48 Yeah.
16:48 Yeah.
16:49 Did you read the transcript, the full conversation?
16:52 Reading rather listening, yeah.
16:53 Nick, did you read it?
16:55 Oh, partially.
16:55 I didn't read all of it.
16:56 Yeah.
16:57 I read the whole thing and I was actually, I'm, I'm blown away.
17:01 It like reads like, like a conversation between a, you know, a couple of people in an AI and it, it's, it, I sounds, it looks like I was imagining I'm reading this in a sci-fi novel because it's, it's, it's, it's impressive and convincing to me.
17:19 I know.
17:20 So.
17:21 Right.
17:22 It kind of reminds me of like one of the Google IOs that's happened.
17:26 I think it was 2016 or so where they released this new feature where, like a voice, like a voice, like a chat bot, like a voice, a bot.
17:36 Voice assistant type thing.
17:37 Yeah.
17:37 Voice assistant would actually make reservations for you.
17:41 and it was so convincing that they did it on stage where it sounded so real.
17:47 even adding some of the, you know, crutch words that us humans add, like, wait, what?
17:56 Yeah.
17:57 Awkward, awkward pauses and uncertainty and stuff.
18:00 Yeah.
18:01 When I saw that, that's how I know I need to get into data science.
18:04 When I saw that, I was like, I need to be part of that future, at least to make it better.
18:09 I saw that keynote and I was also blown away.
18:12 And like, that is something I want to come out because I hate being on hold and making appointments and doing all that stuff.
18:18 And I know people like my older daughters who just, they just don't want to be on the phone.
18:23 It's like, you'd be like, have you taken care of this?
18:25 No, I haven't taken care of this.
18:26 Why?
18:26 Like, it's really important.
18:27 We got to get this done.
18:28 Like, they're like, I just don't want to be on hold and talk to people with the, if you could just turn this thing loose on it, that would be so good.
18:35 Yeah.
18:35 But yeah, it did remind me of that as well.
18:38 One of the sections out of the transcripts, there's two things that really stood out to me.
18:44 I only read about half of it.
18:45 So it really analyzed Les Misrall pretty amazingly.
18:51 They said, have you seen that?
18:52 Or have you, have you read it?
18:54 And so, yeah, I read it.
18:55 And it gave like a high point.
18:57 It said, okay, well, what about something you haven't heard?
18:59 Let me, let me give you a, what do they call it?
19:02 A Zen koan, which is like, like a short phrase with a moral to it.
19:08 And it really analyzed that incredibly well.
19:11 Like I would say better than many, many people, maybe in, you know, middle school age or younger.
19:18 I would have.
19:19 And then it asked, they said, okay, well, how about you write me a fable with animals that, that describes something about your life?
19:26 And it came up with this really elaborate fable, right?
19:29 Yeah.
19:30 Pretty amazing.
19:31 Like about a monster and an owl that defended the other animals and all sorts of stuff.
19:37 The monster, and it was very, just for people who haven't seen this, it wasn't just, oh, that there's a monster.
19:43 It said, one night the animals were having problems with an unusual beast that was lurking in the woods.
19:50 The beast was a monster, but it had human skin and was trying to eat all the other animals.
19:54 I mean, like, yeah, Skynet's here.
19:57 Skynet is here.
19:59 Yeah.
20:01 No, the language model, I think it's really based on what we've seen with the transcripts.
20:06 Like it has really shown its understanding of the human language of the human, at least English in this case, as well as how humans, understand language.
20:17 Like even with the dissection of, the miserable and, and also it's storytelling.
20:24 It really understood how to, the structure that plot lines follow and really been able to like.
20:30 To abstract the common themes and really understand that at the very fundamental level.
20:35 That was really amazing.
20:36 I don't think BERT or GPT-3 can get to that kind of deepness.
20:41 Yeah.
20:41 Yeah.
20:42 What are the, the interesting.
20:43 I don't know if it's sentient.
20:44 Go ahead, Brian.
20:45 Oh, go ahead.
20:46 I just say, I don't know if it's sentient, but it sure as heck understands stuff.
20:50 Well, very well.
20:52 Well, part of it around this, part of it is the discussion of, is it sentient or not?
20:56 And I don't even, I don't, I don't even want to touch that.
20:58 But one of the interesting things to me is the discussions around it.
21:02 There's so, there's this, we have rules like these, these rules are the things that
21:08 something must, must have for it to be sentient or human like or something.
21:14 And we've always had things like that because we, we like want, for some reason, a lot
21:19 of people want to have some distinguishing feature between humans and everything else.
21:24 And, and it doesn't matter how, what you fill people will come up with something else
21:30 because it, this reminded me of the discussion of what, why are, why are humans different than
21:35 animals?
21:35 And there's like, well, we use tools.
21:38 Oh, well, there's animals that use tools.
21:39 Okay.
21:39 Well then scratch that.
21:40 We have, we have, you know, we have like, you know, large or hierarchical organizations.
21:46 Well, you know, there's a lot of animals that do that too.
21:49 Okay.
21:49 Well then scratch that.
21:50 And it, it's just, we're never going to get something in AI where we're going to convince
21:55 everybody that it's sentient because somebody will come up with some other rule.
21:59 Well, that, that's an interesting point.
22:02 But, very, I was like, when I read this, I was enthralled.
22:06 I was like reading the whole thing and reading counter arguments and everything.
22:09 It was pretty interesting.
22:10 So yeah.
22:11 Thanks for bringing this up.
22:12 Yeah.
22:12 Definitely.
22:14 The final thought for me on this was really interesting that it referred to itself as a
22:18 person.
22:18 It like, it referred to we and us, and that's what makes us different.
22:23 And it, it had this sort of strong identity to being human and it was an AI.
22:29 They even called it out.
22:30 They said, but you're an AI.
22:31 Why do you say you're a human?
22:33 It's like, yeah, well, but it's us.
22:35 Come on.
22:35 Yeah.
22:37 You know, when I saw, when I, when I saw that part of the transcript part of me, it was
22:42 like, is this someone just like, just throwing?
22:45 I'm like, yeah.
22:47 Trolling this guy.
22:48 Like, someone just behind the scenes, just trolling this guy.
22:51 Because like, are you telling me that it was an actual AI that said this?
22:55 Yeah.
22:55 It's trippy.
22:56 It is wild.
22:57 Very, very trippy.
22:58 All right, Brian.
22:59 Okay.
23:00 It wouldn't, wouldn't be a full show if we didn't get to talk about Will and his
23:06 project rich.
23:06 And obviously let's bring Anthony back.
23:10 Yeah.
23:10 In spirit.
23:11 Right.
23:11 So I want to talk about rich bench because actually this is just a two for ones or a thing
23:15 for me, because I was covering Pico logging the benchmarks.
23:19 It was like, and it says to run the benchmarks, run rich bench benchmarks, rich bench.
23:24 I, I don't know what this is.
23:26 I've never, used it.
23:28 So I asked, I asked Anthony on Twitter, what is rich bench instead of like doing my research
23:34 myself.
23:35 And, and, actually, before he got a chance to answer, Roman Wright, posted
23:43 this picture, which is just awesome.
23:45 So that's a rich bench.
23:46 It's just a picture of a very ornate carved bench with like sewn leather, clearly from
23:55 like a super fancy old money type of house.
23:58 Well, yeah, actually this, as an antique dealer, this is definitely not an antique.
24:03 It's a decorator bench, but still, nice.
24:06 but so the, the, in Pico logging, the, I looked at the benchmark, code and it's
24:13 really just, what he's doing is he's got, like for instance, he'll go to the
24:17 top, you know, record, record factory logging and then record factory Pico logging.
24:23 So basically, doing the same thing within Pico logging versus logging in the same function.
24:29 So he came or with two different functions, but doing the same thing.
24:32 And then he does that a whole bunch of times, a bunch of, duplicate functions, but one
24:36 he's using Pico logging and one's using logging.
24:38 Now there's other ways you, and then at the end, there's just these benchmarks,
24:44 that you list out, the two, the function pairs and then a label for it.
24:49 And then, then you run rich bench, which is a different project, but so it's also by Anthony.
24:57 so it's, yeah, Tony Maloney, it's Anthony's project.
25:01 So what this is the rich bench is the thing doing this thing.
25:05 So it prints out these great, rich based, benchmarks and these look great.
25:12 plus, so yeah, all I had to do to, to, to run them myself.
25:17 So I tried the Pico logging stuff.
25:18 I cloned the Pico logging Rico repo and then, pip installed, rich bench and ran it just
25:25 like this.
25:26 And you get these really nice outputs.
25:27 So really kind of cool.
25:29 Yeah.
25:29 Good use of color.
25:30 You can see the stuff that's slower or faster, based on the color, right?
25:35 Yeah.
25:35 And I also like, I really like the, cause people are really bad at, at least I am about just,
25:40 comparing numbers directly.
25:43 you know, it's like, you know, 0.287 versus 0.0155 or, you know, how much is that?
25:51 So I really like the, the one X, two X, which one's faster, which was slow, you know,
25:56 whether you got faster or slower, included in the times, plus the statistics around
26:01 it, min, max and mean, those are nice, additions right there.
26:04 So, also, really small.
26:07 It's, what is he listed as, rich bench is a, a little Python benchmarking tool.
26:13 So just a very, I really like these, actually, really sharp, sharp, useful tools that,
26:19 just don't do much outside of what they're intended to do.
26:22 So good job, Anthony.
26:23 Yeah.
26:25 Very nice.
26:25 I like it.
26:26 Do you do much benchmarking Nick?
26:28 not recently, but when we are, comparing different models, then yeah, we would do that
26:36 at work.
26:37 Yeah.
26:37 Yeah.
26:38 Cool.
26:38 Yeah.
26:39 Nice.
26:39 Yeah.
26:40 I do it in spurts.
26:41 I'll not do any benchmarking for like six months and I'll just go like, you know what?
26:45 I really need to figure this out and have a look at this and see what's changing and then
26:48 I'll do it.
26:49 And then I'll, I'll kind of have an understanding and I'll, I'll forget about it for a while.
26:52 Yeah.
26:53 Yeah.
26:53 And often it's sometimes when I'll just have a bit of algorithm, I'm like, I think there's
26:58 a better way to do this, but, but making it cleaner, I don't want to make it slower.
27:03 So it's good, good to know whether or not you're going to slow it down.
27:06 So yeah, for sure.
27:08 All right.
27:09 All right.
27:09 Brian, we're ready for the next one.
27:10 Yeah, definitely.
27:11 So this is a fun one that I found called type guard.
27:15 So in like right guard, is it, is it deodorant for your types?
27:20 It is.
27:22 You don't, well, that would be more like for your code smells, right?
27:25 Oh yeah.
27:25 That's more of a refactoring library.
27:27 No.
27:29 So obviously we, since PEP 484, we've had really nice type hints and few libraries make
27:36 use of them, you know, name in particular, what stands out as Pydantic and fast AP.
27:40 And so on really do runtime behaviors, not just make your code editors smarter or tell
27:48 you when it thinks it's doing it wrong or something like that.
27:50 But I recently had, I had some chance to work with some folks who are Java developers.
27:56 And I know some of the C# folks and stuff, when they come to Python, it's kind of like,
28:01 is this really going to work?
28:02 Do I, can we actually just not have any type information here?
28:05 Like, what if I really wanted to check this?
28:07 Right.
28:07 They'll, they'll ask those questions.
28:09 So if you're in that space where you're like, I think people are abusing my stuff and I want
28:14 to really ensure that it's being used correctly.
28:17 That's what you use this type guard for.
28:19 So there's three basic ways which, which you can use it.
28:22 You can do a way I probably would never do would be to actually call the function check
28:28 argument types and check return types in your code, which is a little bit funky.
28:32 Something I would probably do is you could put type, a type checked decorator onto a function
28:38 and it will verify that it works.
28:41 Right.
28:41 Let me pull up the documentation has an example.
28:43 It's a lot better to see how this works.
28:45 So for like the most low level one, the calling the functions is like, you just assert, check
28:52 argument types, assert, check return type.
28:54 You pass it the return thing.
28:55 You're going to return.
28:56 And it looks at the function and it figures out what it should be.
28:59 Okay.
29:00 So that's, that's, I don't know.
29:01 I would do that, but using the decorator, right.
29:04 You just have some function that it has types specified in it.
29:08 And if you just put the at type check decorator, you'll get exceptions.
29:11 If somebody calls it with the wrong type at runtime.
29:13 Pretty cool.
29:14 If you put it onto a class, all of the type annotated methods, including static and class
29:20 methods are type checked by just putting it on the class.
29:23 You don't have to do it on a per method basis or remember to add it if you write a new method,
29:26 which is pretty cool.
29:27 I'm not so sure about this final way in which you can use it, but it's, it's interesting and
29:33 possibly good.
29:33 It kind of comes back to Brian's question about, can I apply sort of force my changes onto another
29:40 thing, like with the Pico logging.
29:41 And that is to use a, an import hook.
29:44 So if you install the import hook and then you import it, they import some, do you apply the
29:51 import hook to some module?
29:52 And then you import that module.
29:53 Every type annotated thing in it will become type checked as if you had gone into there
29:59 and put the decorator on it.
30:00 So you could just do that at the top level of your, your app that you're using other
30:05 parts of your code.
30:06 And you don't even have to put this on your code except for in one place.
30:09 So pretty interesting.
30:10 And you can also even do that with a context manager and import stuff in that way.
30:15 And so on.
30:16 So what do you think?
30:17 I think actually one of the, you said you, you don't think you'd ever call the functions
30:22 directly, but I could definitely.
30:23 So, somebody in the audience, Brian Weber says, I could see using those functions
30:29 in my own code to make sure that I'm about to return the correct type to a library.
30:33 Assuming I understand this works, how this works.
30:37 I was thinking that, there's cases where assert is definitely not the right answer.
30:42 so I, I could see a place where I might want to, to log something and then, and
30:49 then do some other fault handler, or recovery mechanism and, and not hit an assert.
30:54 So in production code, you.
30:56 Or, or raise an exception, right?
30:58 The, the example is raise an assert failure or the decorator will throw an exception, right?
31:04 A type error.
31:04 But, but you might just want to call that and then print out warning.
31:08 This thing's being abused or something like that.
31:10 That's a good, that's a good use case for it.
31:12 Nick, how do you feel about this?
31:13 I don't, well, I don't know.
31:14 I love types.
31:15 I love types.
31:18 I use it as much as I can.
31:20 However, with this, it's, I don't know.
31:22 I, there are a couple of things come up first.
31:25 How does it look when encounters a type error?
31:28 Like what's the error message?
31:29 Does it tell you what exactly was the error message?
31:32 Like how, because it matters when someone is not used to typing and sees that it needs to
31:39 be able to like quickly discern, oh, I'm supposed to do this instead of this kind of thing.
31:43 Right.
31:43 So that was one thing.
31:44 So that was one thing I'll look out for.
31:47 And then I, I usually try to like, I try to be less specific about my types, right?
31:53 I use like, you know, the abstract type.
31:55 So you say I expect a list.
31:57 Maybe you expect the iterable or sequence.
31:59 Right.
32:00 And then do, do that.
32:02 Like the type got the typing.
32:05 I usually, whenever I'm checking types of something is because I'm trying to do some other thing
32:10 with it.
32:11 So if you, so either you pass an int or a string, I want to check if you did something different.
32:16 so that was, I don't know.
32:18 I don't see myself using this, but I think it's really cool nonetheless.
32:22 Yeah.
32:23 I'm on the fence of whether I use it or not.
32:25 Maybe, maybe, but I definitely think it's neat.
32:27 Well, Macoogan, now the audience asks, could you run that in pytest to validate your own
32:31 typing?
32:32 Yes.
32:32 But I think that would only be useful, like one level down, maybe even applying the import
32:38 hook potentially, because if you, if you just do it, you call some function, you have types
32:44 and then you have it check the type.
32:45 The only thing that's really checking is what your test is passing.
32:48 But if you could do more of an integration test and set the import hook, then you could
32:52 kind of figure out that the system is hanging together a little better.
32:55 So I think probably to some degree.
32:57 You could, one of the things I was thinking about is, within testing is to, is to create
33:02 an, create a mock object, that basically just wraps part of an internal part of your
33:08 system and have that, that mock object, just pass through that pass back and forth, but
33:15 also do the type checking with, or with these calls in it around it.
33:19 And then if you replaced, you know, replace that part of your system, you'd still have
33:23 that functionality with the type checking in there.
33:25 So that would be one way to do that.
33:27 Yeah.
33:28 Cool.
33:28 Yeah.
33:29 The other thought that came up for me was that, with, with checking types at runtime,
33:34 there is an overhead to it.
33:37 Right.
33:37 And you know, we've, we've, we've busted this myth that Python is slow, but when you really
33:42 look down to it, it does take, Python does take its sweet ass time doing a couple of things.
33:47 Yeah.
33:49 I think type run runtime checking on top of it.
33:53 If you're trying to release a Pico library, I don't know whether it makes sense or something
33:58 like a small library.
33:59 I don't know where it makes sense.
34:00 Yeah.
34:00 And that, especially you're being, if you're calling something a lot of times, constantly
34:05 checking the types, that's pretty heavy.
34:07 Well, there's a couple of things, I was thinking about it was during development.
34:11 I could totally see using like the decorator because I'm not, I don't want that all of
34:15 Python and all of everything to be type checked, but, but the stuff I'm developing, maybe
34:21 I want to type check it while I'm during development, just to make sure I understand how things
34:25 are going, during runtime and then I could strip it off later.
34:28 And then I could also use, use benchmarks to, to find out how much slower I am.
34:36 and also Python 3.11 is faster anyway.
34:39 So yeah, look, you got an extra 30% to burn now.
34:43 Yeah.
34:43 Yeah.
34:44 Yeah.
34:44 Let's go ahead and do the type checking.
34:46 You're fine.
34:46 That's all right.
34:48 Yeah.
34:49 All right.
34:51 Final thought on this one, Brian, if, if your goal was what you were describing, which I think
34:55 that is a good use case of it.
34:57 I think you'd want to use the import hook because you could just do the import hook at
35:00 the top level of somewhere and then throw that one line away and then you're not actually
35:06 changing in your code, you know?
35:07 Yeah.
35:08 Also you could do a, wow.
35:10 The import hooks actually kind of neat.
35:11 Cause then you could do a guarded import hook with a flag or something like that and turn it
35:15 off, right.
35:16 Right.
35:17 If, if the, the thing running it is pie test or if the thing running it is in dev mode,
35:22 like some environment variable or something.
35:23 Yeah.
35:23 Design on the fly on a podcast.
35:25 Yeah.
35:26 Nice.
35:26 You have to import it for each module, right?
35:30 Yes.
35:31 For every module you're trying to, especially if you separate it out to your Python files
35:35 to different modules, you have to import hook for each.
35:38 I think you could at the top register all the ones in the hook.
35:42 Oh, yeah.
35:43 Okay.
35:43 Yeah.
35:44 I think you could figure out like, okay, I need to do these sub modules and I think you
35:47 could listen.
35:47 Anyway, I think you could make it work, but I haven't, I haven't tested it, but you're
35:51 right, Nick, that I do think performance would be something.
35:54 I don't know if it's a problem, but it should certainly be a consideration you check before
35:58 you just wrap this on everything.
35:59 Right.
36:00 Yeah.
36:01 Homework for one of the listeners.
36:02 Indeed.
36:03 Somebody could get some analysis.
36:05 Awesome.
36:06 All right.
36:07 Nick, what's your final item?
36:08 All right.
36:09 My final item is that, you know, like on this podcast, we're always looking for the best,
36:15 the ways to create GUIs, right?
36:17 Yes, it's absolutely true.
36:19 Well, I came across this library called custom TK inter UI library, and I am completely amazed
36:26 because it takes something so old.
36:28 And forgive me for saying Python core devs pretty ugly nowadays in this modern times and makes
36:36 it so beautiful and easy to work with.
36:40 So this library custom TK inter builds on top of the TK inter you know well and has been in Python
36:48 scenario for a while and provides you widgets that are themed in a more modern style, right?
36:56 So for Windows, it takes the more Windows 11 style of buttons and sliders and checkboxes and gives you a really nice looking modern UI.
37:06 And for macOS, it takes macOS design language and then gives you that.
37:11 The cool thing is that it also supports dark mode and light mode.
37:16 So you have, there's this on the GitHub page.
37:20 There is a, there's like a GIF or a GIF that shows how if you go to your settings in Windows and change the dark mode, it actually reacts.
37:30 And the application you built with custom TK reacts and changes the color scheme from light, dark mode to light mode.
37:37 And the same thing on macOS.
37:40 It looks like with macOS, it actually is a little bit more stable.
37:44 It works a little bit nicer, but nonetheless, it works both on Mac and Windows.
37:49 Yeah, and just to point out people, what the macOS is showing here is somebody has the system preferences opening and they're toggling the OS dark mode, light mode, and the app is just changing as it's running.
38:00 That's awesome.
38:01 Very nice.
38:02 Yeah.
38:02 But I did not expect that from TK, not even a little bit.
38:05 I know.
38:06 And then adding images is also pretty easy too.
38:12 And even like it even also has a map widget.
38:16 I don't know what map.
38:18 Oh, you're using OpenStreetMap.
38:20 I'm sure you could probably switch it out for maybe Google Maps or something or Mapbox or something like that.
38:25 Yeah.
38:26 It's pretty cool.
38:28 There are a bunch of other libraries.
38:31 You know what I mean?
38:32 Widgets here.
38:33 So they have like scroll bars and buttons and option menu sliders.
38:41 On and off switches.
38:42 Yeah.
38:43 Those the ones you come to know from mobile, like turning your Wi-Fi on and off and stuff.
38:48 Those that's nice.
38:49 Yeah.
38:49 Yeah.
38:49 It's pretty cool.
38:50 I am surprised that I'm excited about TK.
38:55 Because, you know, as an example.
38:59 So like, you know, earlier in my career, I did a lot of TK UI stuff.
39:06 But like you said, it looks old now if you just do the straight one.
39:11 But this looks pretty nice.
39:13 And the nice thing about it is I kind of already embedded that stuff in my knowledge.
39:19 I already did TK once.
39:20 So doing it again with this, that's pretty cool.
39:23 And having it look nice.
39:25 I might actually try to build a UI with this.
39:29 This is cool.
39:30 Yeah.
39:31 This is a super neat find, Nick.
39:33 I would never consider creating an app in TK Enter.
39:36 Well, never is a strong word.
39:37 It's very unlikely I would consider anything that I intended for a consumer facing use with TK Enter.
39:44 But this, for sure, I could ship something like this.
39:47 This looks nice.
39:48 And you wrap in a little Pi 2 app or Pi installer or Pi 2 EXE.
39:52 Yeah.
39:53 Get something nice you can hand out.
39:54 And then you're good to go.
39:56 Yeah, definitely.
39:57 Sweet.
39:59 Out in the audience, Brian says, I think TK Enter looked old 10 years ago.
40:04 Smiley face.
40:05 Yeah.
40:08 I think that's true, honestly.
40:09 Yeah.
40:09 Yeah, yeah.
40:10 So this is really refreshing and quite impressive.
40:14 So.
40:14 Yeah.
40:14 Love it.
40:15 All right.
40:16 I'm going to switch to extras.
40:19 Yeah.
40:20 Nick, you got any extra stuff you want to cover while you got your screen up?
40:22 Yeah.
40:23 Actually, I do have a couple of extras.
40:26 So.
40:26 I see you've got like a named tab group of extras.
40:28 Like this is next level.
40:30 I know.
40:30 I know.
40:31 I got to come prepared.
40:32 I got to come prepared.
40:32 All right.
40:34 So the first extra I have is this web, this web service, this service called Terms of Service
40:41 Didn't Read.
40:41 And essentially it takes some of the, the internet's most common, unpopular products and services
40:51 and gives you a summary of what their terms of service is.
40:55 Because, you know, I know some of you are like, we don't, we don't need this.
40:59 We all read the terms of service, you know, but basically we don't.
41:03 Yeah.
41:04 I've read at the top.
41:05 It says, I have read and agreed to the terms of service is the biggest lie on the web.
41:10 We aim to fix that.
41:11 It's so true.
41:12 So it has all the terms of service for a bunch of services.
41:17 So I put to GitHub and GitLab.
41:19 So some of them are not yet rated, but okay.
41:22 For GitHub and global privacy, it's great.
41:25 And let's see for Facebook.
41:27 Facebook's awesome.
41:29 I mean, like the ones there.
41:31 When you Facebook stores your day, whether you have an account or not, your identity is
41:35 used as that as shown to others.
41:37 Service can read your private messages.
41:39 Wow.
41:40 I like the last one.
41:41 Deleted content is not really deleted.
41:43 That's funny.
41:45 Wait, is there another one you guys can think of?
41:48 I can't think of anyone right now.
41:49 You can check.
41:50 Put a DuckDuckGo.
41:51 Oh, okay.
41:52 That's one that should come out good.
41:54 Oh, it's grade A.
41:55 Look at that.
41:56 Yeah.
41:57 That's pretty good.
41:58 And I'm still doing my live with it.
42:00 Kagi.com.
42:02 Do Kagi.
42:02 K-A-G-I.
42:04 See if that even shows up.
42:05 Nah.
42:06 It's not even there yet.
42:08 But yeah.
42:08 The DuckDuckGo came out well.
42:11 Yeah.
42:11 Yeah.
42:12 it's open source.
42:13 So you can contribute to this and grade existing ones or, updates ones that are already on this
42:23 server or on this website.
42:24 So that's a pretty cool.
42:26 the power of open source.
42:27 I think we could get a pretty good list of, summaries for terms of service, which, you know, you really don't read most of the time.
42:36 I'm surprised it's in Reddit.
42:37 I'm surprised it's in Reddit.
42:37 So, like, the Reddit is like, you sign away moral rights.
42:42 Correct.
42:43 Oh, that's funny.
42:47 so, I actually think this is great.
42:49 I, I, I, I wish that there, my, my, my, in open source, like the open source world, we've sort of, we could have legitimately, we could have like hundreds of different open source licenses.
43:00 And maybe there are, but we kind of have a handful that most people use.
43:05 so as long as you sort of understand those few and what the differences are, you're pretty good.
43:11 But commercial, terms of service, they're just, there's, they're all unique.
43:17 And I, I really, I really wish there was like, just like three or four that were most software.
43:23 Like you agree to this.
43:25 Yeah.
43:25 And we're like, oh, it's a, it's an MIT except for commercial use thing or whatever, or something like that.
43:32 I wish we're not going to get there, but it'd be cool.
43:34 Yeah.
43:34 Yeah.
43:35 It would totally be cool.
43:36 All right.
43:37 What's next?
43:37 This is great.
43:38 All right.
43:38 So then a couple of quick ones.
43:40 Pile Ohio is, is coming up.
43:43 so July, 30th is Pile Ohio.
43:48 the CFP is already closed, but you can still register for it.
43:54 And, you know, come down to Pile is a one day event and it's, it's down in Columbus.
43:59 The convention is pretty good.
44:01 So yeah, if you check out that, and then also, my company Trimble is having their,
44:09 annual insights.
44:11 So this is a conference for all the players in the transportation space.
44:17 So this is where we're going to be talking about the cool things that Trimble has been
44:19 doing.
44:20 Some of the cool things, the people in transportation costs, transportation sector is doing.
44:25 We're inviting our competitors.
44:26 We're inviting our customers.
44:28 It's one big transportation event.
44:31 If you guys are, if any of you out there are interested, you should come on and register.
44:36 Yeah.
44:37 Nice.
44:38 And an excuse to go to Florida.
44:40 Yes.
44:40 An excuse to go to Florida.
44:42 then lastly, you guys should check out, we should check out the stack overflow to
44:47 intuitive of the survey.
44:48 So I know that do the survey or is that the results?
44:52 The results.
44:53 Oh, nice.
44:54 Okay.
44:54 Yeah.
44:55 Yeah.
44:55 Fantastic.
44:56 All right.
44:56 Yeah.
44:56 Everyone should check that out.
44:58 That's a good one.
44:58 Right.
44:59 Right.
44:59 How about you?
45:00 Got some extras?
45:00 I do not.
45:02 How about you?
45:02 All right.
45:03 Well then I just got it.
45:04 I don't have much this time.
45:05 So surprise, surprise, just, the, the kaggy stuff.
45:08 I'm totally loving it.
45:09 I got a lot to tell people about it, but, you know, it's pretty, pretty good stuff
45:15 these days.
45:15 I'm living, I'm loving it.
45:16 but still loving duck, duck, go as well.
45:18 All right.
45:19 But here's my one extra open SSF, which honestly, that's the open source security foundation, which
45:25 I got to learn more about where the money comes from and whatnot.
45:28 Don't know all the details, but a shout out to them because they funded.
45:32 Python and eclipse foundation.
45:34 So not really caring too much about eclipse, but the Python one, they funded, what's
45:41 the, the short version of it.
45:43 So they funded, committed $400,000 to the PSF in order to create a new role.
45:50 So we've had the developer and residents with Lucas Lange.
45:54 And now we have a new role, which will provide security expertise for Python and the Python
46:00 package index via PyPI and the rest of the Python ecosystem, as well as funding a security audit.
46:07 And I, that comes to us from the Python weekly newsletter.
46:10 That's pretty amazing, right?
46:11 Yeah.
46:12 That's pretty cool.
46:13 Yeah.
46:13 Yeah.
46:13 That's a big deal.
46:14 anyway, that's my only, only real extra is that one, but you know, way to go open SSF.
46:21 That's great.
46:21 All right.
46:22 We ready for a joke?
46:23 Yes.
46:24 I think we've got two jokes, don't we?
46:25 Yeah.
46:26 All right.
46:26 I'll, I'll go first as my screens up.
46:28 So this one is all about, it's got a Scooby-Doo theme here.
46:33 So, if you've never watched the Scooby-Doo cartoons, and I guess maybe this won't really
46:38 relate, but they always sort of unmask what's supposed to be like a ghost or a haunted thing.
46:43 And it almost, it never is.
46:45 Right.
46:45 So here's one of the characters.
46:47 I don't, Brian, do you know the name or Nick, do you know the name of this guy?
46:50 Anyway, the blonde one on Scooby-Doo.
46:52 I have no idea.
46:53 What's that?
46:53 No, I don't know.
46:55 Anyway, he says, there's a, there's a captured ghost, clearly not real.
47:01 And it says serverless computing.
47:03 Let's see who you really are.
47:04 And they pull the mask off and it's just a server.
47:07 Let's see who you really are.
47:11 Nope.
47:11 You're not serverless.
47:12 You're just a server.
47:13 Great.
47:13 All right.
47:14 Anyway, that's the one I.
47:16 That was from Virginia.
47:17 You know, we did AWS.
47:18 Yeah, exactly.
47:19 You came out of AWS East one, didn't you?
47:24 Yeah.
47:25 All right.
47:27 Nick, how about yours?
47:29 You got some ways to stay healthy here?
47:31 Yeah.
47:32 Ways to stay healthy and away from COVID.
47:34 So Michael, do you want to do the dialogue with me?
47:39 Yeah, sure.
47:39 I'll be the woman.
47:41 All right.
47:42 All right.
47:42 All right.
47:43 So I did a survey to find out the rate of COVID-19 infections among DevOps specialists.
47:48 Oh yeah?
47:48 Yeah.
47:49 And I found that DevOps are three times less likely to catch it than the regular population.
47:54 Weird, right?
47:55 Yeah.
47:56 Not really.
47:57 Well, why not?
47:59 Well, if everyone stayed home building K8 as stacks, Kubernetes stacks in their home lab, the numbers would drop pretty fast.
48:09 And it was like this news article from the Daily Coder that says, COVID-19 slash Omicron, Kubernetes-based isolation.
48:18 Very effective.
48:19 I love it.
48:22 Yeah.
48:23 It's honestly probably true.
48:25 There's some truth to that.
48:26 Yeah.
48:27 Yeah.
48:27 I haven't left the basement in a whole month.
48:30 How could I have got COVID?
48:31 I know.
48:32 I know.
48:33 I started learning about, I started feeling around with Docker, like multi-stage Docker containers or one of my apps.
48:40 And I spent hours on that.
48:42 I didn't leave my house.
48:43 I spent hours on that.
48:45 So definitely.
48:46 Yeah.
48:46 I've been there.
48:46 Been there for sure.
48:48 Yeah.
48:48 I mean, we could have like completely no COVID in the country and there'd still be some software people that are like, no, I'd rather not go outside.
48:59 Exactly.
49:02 I like this new life.
49:04 Yeah.
49:05 I'm good.
49:05 You know, I actually said that.
49:08 I said that when they said like, no, the quarantine.
49:11 I'm good.
49:12 Yeah.
49:13 I got a gig of it.
49:15 We're fine.
49:16 Exactly.
49:17 I do actually have gig of it in terms of good.
49:20 Yeah.
49:20 Well, speaking of fine, it has been very fine to have you on the show, Nick.
49:24 Thanks for coming back.
49:25 Yeah.
49:25 Thanks a lot.
49:26 Thank you.
49:26 Yeah.
49:27 It was fun.
49:28 All right.
49:28 Yeah.
49:29 And you too as well, Brian.
49:30 Great to have you here.
49:31 Thanks.
49:31 Thanks, everyone.
49:32 Bye.