Sean Tibor: Hello and welcome to Teaching Python. This is episode 141. My name's Sean Tyber. I'm a coder who teaches. Kelly Schuster-Paredes: My name's Kelly Schuster Paredes, and I'm a teacher who cooks. Sean Tibor: And this week, we've got special guest Trey Hunter in the studio. I've already flubbed it at the beginning of the show, but I'm sure we'll get. We'll get right back on track quickly. Trey, it's great to have you on the show. You've been a longtime friend, and we're excited to have you here. Trey Hunner: Yeah, thank you for having me here. It's great to be. Great to be on the show. I've been a listener for a long time as well, for longer than we've known each other. Kelly Schuster-Paredes: It's so funny because someone said to me, hey, why don't you have Trey Hunter on the. On the show? And I was laughing. I was like. Because 1. He's in my inbox all the time. I have stickers from him. He's always been nice to us. I was like, I feel like he's already all the way around. And I was like, wait, I guess I should share our wonderful knowledge person, you know, with the friends of the show. So I was like, yeah, that's a great idea. But I never even. I never even thought about it. It was funny. Sean Tibor: My reaction. My reaction when they brought that up was like, I can't believe we haven't had Trey on the show yet. Like, that was like, why haven't we done this? So I. You know, better late than never. I'm. I'm excited that you're awesome. Trey Hunner: Awesome. I'm. It's funny. I've thought about, you know, reaching out, like, hey, I could be on the show, but I'm just not. It's not a thing that I often do. Right. To say. Like, by the way, I'm here, too, because, like, we know each other, and I had the same thing. I used to do a thing called Weekly Python Chat, where it never really became as formal as what you're doing in the sense that it went. It didn't really go public. I kind of did it just for my mailing list. But there were folks who. Some of my closest friends were the last ones to be guests because I knew them too well. Right. I kind of was already in their world. Kelly Schuster-Paredes: Yeah. That's how I felt. Like, I've already listened to all. I read all your newsletters when they come into the email. So I'm like, yeah, I know what he's got to say, I'm like. But I'm excited we got to share it to everybody else. So we're going to let everybody else on the little secret of Trey Hunter. Trey Hunner: Awesome. Sean Tibor: Well, what. Before we get into all things Trey, why don't we start with the wins of the. With something. Trey. So, Trey, win of the week. Something good that's happened inside or outside of the classroom or however you define your classroom. Trey Hunner: Yep. So I guess my win of the week is I created a classroom which is kind of a funny. Win of the week. I just launched a 10 week, basically intro to Python course that's. It's not live, but it's not self paced. It's like a fixed paced thing, but folks in different time zones can join because we're not. Besides office hours, you can work on it, you know, whenever you want throughout your day. You've gotta do the daily check in though. It's all about accountability. So it's called Python High 5. And I launched it in Discord, which is the first time I've ever run a Discord, which is kind of nerve wracking, but it, it's, it seems like the launch is going successfully because I just did it today, so that's my win. Sean Tibor: Congratulations. That's awesome. Kelly Schuster-Paredes: They're like always people in Discord. That, that, that place, it's kind of like GitHub for me. It gives me a little bit of a scare. There's so much going on. Sometimes when you get in there, you start going on a, on a deep dive on 1:1 Discord, whatever chat they're called. I don't know, stream, I don't know what it's called. That, that place is a lot of black holes for me. Trey Hunner: It's definitely more opaque than I would like. As far as, you know, someone joining. I w. I was hesitant to run into the Discord, but I couldn't think of another platform that once you got over that initial hump was as kind of friendly. I mean, slack is close, but slack has its own downsides, you know. Cool. Kelly Schuster-Paredes: Good luck with that, Sean. You got a win. Sean Tibor: I think my win this week was, I mean, it's totally outside of work and outside of the classroom and I kind of needed that. Like it's been busy and intense for a while. So I had a long weekend from work, as many people in the US did. We live two and a half hours away from Disney World here in South Florida and my children love going to Disney, but we've been putting it off and putting it off for a long time and we realized that the last time we went to Disney was before COVID And my son, who's now 9, was 4 at the time. So the set of rides that he can ride is completely different than what it is what it was then, as well as the set of rides that are available now has changed and grown dramatically. So we just did a three day weekend at Disney. And I mean it's easy to be cynical about theme parks and about Disney and you know, the giant mouse and everything, but it's really hard to be cynical when you're at Disney World. It's just way too much fun. It is really, really well put together and well operated and you know, it's just, it was a lot of fun to be there with my family and walking around and having a great time and experiencing things together and sharing things that I love. Like I love the Indiana Jones stunt spectac where it's old school, it's awesome. There's explosions and fist fights and everything like that and no computer graphics anywhere. And I love every second of it. And my kids now do too. Like they, they watched it and they thought, yeah, that was pretty awesome. But I think the highlight and the part that appealed to the techie in me was they had the Tron Light Cycle ride that opened there last year. And for my entire life I've wanted to ride a Tron Light cycle and I got to do it. And not to spoil it, but it goes 0 to 60 in 28 seconds while you're riding on the light cycle and perfectly secure and safe and everything like that. And it's absolutely exhilarating and just incredible. So I did that with each of my children. We wrote it twice and I got to ride next to each of them. My wife got to ride with the other one right behind us and it was a blast. So that was my win. It was a lot of fun. Trey Hunner: That like to sound scarier than I. Kelly Schuster-Paredes: Would want, it's like a creativity overload. I love that though. It's so many things, right? It's like all these wow moments. Sean Tibor: I mean I, I as an adult and like going to Disney, I appreciate it on so many levels. There is the surface level of just like it is just fun and enjoyable. But then, you know, if you're an engineer or a programmer, someone who likes to see how things work, getting those little glimpses of how they put things together and how it all fits and the cleverness of what they do to make it all work is just, it's incredibly Stimulating and a lot of fun. Trey Hunner: So they're engineering happiness, right? Yeah, the buildings, the way everything's constructed, it's meant to make you like being there so you'll come back and future. Yeah, it's. Sean Tibor: Well, they're imagineering it. Right. So it's, it is really fun. And, and the, the more you learn about it, it's just fascinating to look at and I think it, it just sparks my own kind of creativity and thinking about things like, well, if Disney can come up with all these crazy ways to do stuff, I can probably figure out how to do this list expression the right way, you know, that's funny. Kelly Schuster-Paredes: That's great. Oh man. So my win. I have so many. I have so many. Well, well, first of all, started school and I've got a hu. Another batch of cute little sweet, innocent sixth graders and a bunch of pre, well, they're not pre pubescent but 8th graders that are my son's class. And so I know all these kids since Kender, so that's fun in itself. I have lots of win. I'm actually also teaching a teacher right now. She's in my class learning Python and she knows JavaScript. She's like, or Java. She knows Java, not JavaScript. She has Java. And she's like oh my gosh, that makes so much sense now. Why do people code in Java? And I'm like, yes, yes, I love Python. And I was just like laughing and just watching her learn. She, she's just been so, so great and we work really good together. So now there's three people in the classroom, three adults, which is really cool. So that's like a new like boost of energy having her in the classroom in the early morning. So that's my second one and then the third one. This was funny. This is like a personal haha, kind of funny thing. One of the colleagues of mine sent me this article. She's like, this is a really good article. It's in the observer or the Guardian. And she sends it and I start read and it's guy by this guy Andrew Smith who's written a couple of books. And it's. I learned the language of computer programming in my 50s. Here's what I discovered. And I start reading it and he started with JavaScript and he started learning HTML and then he takes on and he learns Python. And then almost towards the middle I'm reading, reading, reading and he's like. And then I went to Pycon and I met this guy named Nick Tolarvey and I was like, oh, my God, I know him. I sent back the email and I told her. I was like, I know that guy. And we're like best friends. I've gone to lunch with him in London and that's so crazy. I'm famous now. So I thought that was really cute. But it's a really good article. I was told his book is like a love story of Python. So I've got to find out which name of the book it is, but Andrew, his. The author is Andrew Smith and I'm going to reach out to him and see if he wants to come. But he learned how to code in his 50s and he loves it and he came to Pycon and he just talks about the friendliness and the openness and he went to Pie Ladies Auction. And the whole time I'm reading this article going, I've been there, I've done that. And it's just kind of nice to know that someone else was later in their years learning to code Python and they know Nick. So win, win, win. Lots of them this week. Trey Hunner: Those are awesome wins. Kelly Schuster-Paredes: Yeah, I want to share that in the show notes, so it's fun. Trey Hunner: This is a great way to kick things off, by the way. Like, I. I love this format because now I'm like excited for my win that I'd forgotten. Like, not that I forgot about it, but I wasn't thinking about it. And I'm excited for your wins. Kelly Schuster-Paredes: It's good. It's a nice, nice feeling, especially at the end of the day, to have such fun things to share. Trey Hunner: Absolutely. Sean Tibor: We haven't done the fails of the week for a while, I think as we're kind of dragging that out a little bit, like that introduction. But I love the fails of the week also because I think, you know, the winds, the wins are always awesome. But if you only listen to our win, it would sound like we are the most amazing programmers, the most amazing teachers, the, like, everything just goes beautifully. And meanwhile, I feel like I'm just failing my way through the week. Right. And occasionally cool things happen. Right. And, and I, and I know that anybody who feels the same way, sometimes it's a little bit lonely when you feel like you're the only one who's like not having it work every time you try. And most of are like that, you. Kelly Schuster-Paredes: Know, it's serious fail. On my Django app that I was making, I did it all with chat GPT, I totally scratched it and I started watching video tutorials. Just prove to everyone that you can't use AI alone. When you have no clue about a library, especially when that's got like 20 files going all over the place, it. Trey Hunner: Can be super useful, but it can also be a liability. Sean Tibor: Right, right. Kelly Schuster-Paredes: I believe I started for scratch. Sean Tibor: Maybe that's a good place to start because I think, you know, we are in this era now, like we are solidly what, 18 months into the gen AI, you know, world that changed around us, you know, so people are using ChatGPT and other tools as learning aids, as cheating aids, as, you know, like shortcuts for a lot of things. You know, one of the things that you've done, Trey, over the years is help people build expertise in Python, right? Like that's kind of your mantra. Your goal is like, let's take you from being someone who's starting to put the things together and starting to see how the pieces fit into someone who is an expert and can really tackle bigger, more advanced projects. How has, you know, like with that in mind and that, you know, thought of building expertise, why should people build expertise in a world that ChatGPT can do for you? Like what are the, what's the benefits of being an ex, an expert when you can ask an AI whatever you want? Trey Hunner: So I'm going to give an answer that I feel like is kind of similar to the answer I would have given, I don't know, 15 years ago if someone asked me that and said, you know, with Stack Overflow and Google having all the answ, what's the point of learning? Knowing how to use that tool is a really valuable thing. But also knowing what to stick into the tool and how to evaluate the output of the tool is a really valuable thing and it's hard to do that without at least some level of expertise. The thing is, I do suspect that our expertise that we focus on in, you know, a decade is probably going to be quite different than it is today. I mean, today I feel like we're playing catch up. Kind of the way, you know, when Napster happened, for example, the sort of what, how do the record labels react? How do we react? It's kind of a similar shakeup that's happening in sort of the sort of education, learning, teaching space, but also just programming in general in that I know folks who will not touch an LLM because they're for various reasons. I mean, you know, it might be like a self esteem thing, like I want to do it on my own. I don't, I'm afraid to ask a question or it could be, I don't want to be training this LLM of this company that might be evil or unethical, which Simon Willison, you know, he gave a keynote that at PyCon. But I think one of the things he mentioned there, at least I've heard him mention this else. Whereas your, that data is supposedly not used for training. You know, it says in the contract, at least for Claude, I think for ChatGPT as well, that they don't use that input for training because the Internet has so much more data for them to train on. But then there's also the, you know, am I going to actually know things if I'm just relying on an LLM? And I mean, I use LLMs to help me develop big features, but I spec out the feature first and I kind of argue with LLM, you know, we're going back and forth where I say, well, I didn't want you to do it that way. Do it this way or I'll update the code and pass it back in almost as I would with a person, except that it's faster and doesn't seem to care when, you know, I tell it, no, I want you to do it this way. Right. I don't have to kind of be careful about, you know, the human side of things and the, the back and forth. It's almost like you're getting a totally different person the next time in that if you say, no, I think this is incorrect, it might say, oh, I'm sorry, and then completely change its stance, which is useful on its own because it's a thing you don't really get with a person. So I, I think these things are going to be very valuable tools. But there's, there's a whole aspect of them that, that I don't ever think about, which is, for example, cheating. Because I don't care if you're cheating, because my audience, if you're cheating in my audience, you're cheating yourself. Right? There's, there's no grading involved. There's no, that's, it's entirely on you. If you're coming to me to learn, you're the one motivated there. Whereas if you're in a class, there's this grade that we, we care about, but you and I don't really care about it. Right? It's the, it's the institution that cares about it in a sense where you care about it for the sake of getting a job or something. And that kind of like, it makes cheating more of an issue. Whereas for me it's not an issue because if I tell you, oh, don't do it this way because it's, it's less effective for learning. Cheating doesn't. It's, it's no longer the thing we care about. It's. How can I use this thing as a learning tool? Sean Tibor: Kelly, I think you're muted there. It looked really smart, so really smart. Kelly Schuster-Paredes: I had to turn on the AC in the car. Sorry. Sweating in Florida heat. Yeah, so it's funny because I, I shifted a little bit in philosophy as well. Not so much in like major philosophy. We've always kind of felt this way, Sean and I. The grades, the grades were irrelevant to us. Like, you want an A? We always say, fine, you got an A. Who cares? Like here, what is, what is that A going to tell you? It's always about the learning. And the funny thing is I still kind of do that because they use Chat GPT. I actually force them to use Chat GPT because I always tell them, let's, let's like push the creative side right now in 8th grade, this is the last year you're going to do Python until you change me. Not after, just not ever in our school, in our classroom. Well, actually that's not true either because I still have. It's doing that on the side. But I say, you know, let's just push it on the creative side and see we can build. But I'm going to, I'm going to test you like, like you're getting an interview task and we're going to have, you know, these questions now that you can't go into anywhere else. I've actually used lockdown browser now, Sean, you should be very sad for me, but it's fun because it grades for me as well and it's multiple choice questions and it's code that they have to see or we get the pencil out and they have to write. Like, what is this code doing? So I've been finding it very useful, but I make them do stuff that, that they can't do. One girl emailed me and said, miss, I tried to do what it said on Chat GPT and I started downloading like stuff and then it said something like bash. And then it was like telling me to do this and I was like, so you understand the point of the lesson, right? It doesn't help you. So it was really cool. But having said that, what are you, what do you like, do with your strategies? Because this is one of the things for me that I struggle with of like balancing this, these common mistakes and misconceptions with your learners and how do you like, not necessarily keep them away from AI, but help them learn from that mistake? Because I feel like at least when you're in Stack overflow, you took a long time to try to search for an answer and it made you really process that, that issue or, you know, you had to search for it on Google or watch a video. How do, how do you, like, balance that for people? How do you keep them from making those mistakes all the time and not just. Or do you notice that, you know, it's. Trey Hunner: For me, it's tricky because I get, unfortunately, especially since the beginning of the pandemic, very little hands on time with an individual person who is, I'm seeing repeatedly over many weeks, right, where they're kind of. They got some output, they're working with the code, you know, there's a lesson to be learned from it. It's typically either. Here's an exercise that's done in Python Morsels, and at the moment, Python Morsels is. It doesn't involve a lot of interaction for me. It's less of a community right now, more of a service. What? Well, some, some of the things in there are being, you know, exception, like Python high five that course I mentioned. But when I do a training, I'm with a team for, you know, it might be days, it might be weeks, but they're either using or not using chat GPT and it. If they're just learning Python, typically they're not using it because they feel like they might be treating themselves out of it. So we don't really have an opportunity to have that discussion. So most of the discussions I've had here kind of more informally with folks who are, you know, I know, are learning. And the thing that I've, I guess, come across the most, and honestly, a lot of it is like scouring the, you know, learn Python subreddit or Python Discord or places where I know folks are hanging out, asking questions. And a lot of them are, they'll get code and then not know what to do with something. And a lot of times the next obvious thing to me is not obvious to them, which is similar to, you know, looking something up in a search engine or looking something up on Unstack Overflow, which is to then loop back and continue to ask the AI, you know, what does this bit mean? Like, I don't understand why this doesn't. Or here's the exception, here's the trace back. I'm seeing what might be the problems as opposed to just saying, fix it. Right? I mean, you can Sometimes you can say fix it and it just fixes it for this. But they didn't learned anything at that point. You're not really even sure you know, why. Why does the fix now work? It often is half decent at explaining things. I mean, it will explain things incorrectly, but it's, it's like you're having a conversation with someone that you don't know how much they really know. You just met them at a meetup and they're speaking confidently to you and, and you've got to kind of assess for yourself, you know, as you're reading, how much do they really know about this? Does that seem to match up with, you know, can I, can I catch them in a lie here in inconsistency? So I think skepticism is the biggest thing that folks who are really skeptical of a LLMs need to be less skeptical. Folks who are using them need to be more skeptical. Kelly Schuster-Paredes: Right, I agree. Sean Tibor: Do you know what? I just saw something that kind of blew my mind. Someone like reverse engineered like a prompt that was being used with ChatGPT or one of the other LLM where the prompt that was being generated and sent over had do not hallucinate added to the end of the prompt, which. Kelly Schuster-Paredes: It works. It does work. I promise you it works. I've tried it. Sean Tibor: It's. It's kind of amazing because I think that's. That to your point is one of the most interesting things to me about like maybe the, the difference between being a beginner and being an expert. Right. Like one of the things, one of the traits I think an expert has is the ability to evaluate what someone is telling them and compare that with the other knowledge and context that they have to be able to assess the validity. Right. And say like, yeah, what they're telling me all fits with what else I know and makes a lot of sense. And I've got enough other context to be able to have a reasonable assumption that it's right. But a beginner doesn't have that right. Like, so whatever the LLM tells them, or whatever the teacher tells them, or the person at the conference confidently speaking about something, how would they know that it's right or wrong if they sound authoritative? Right. If it sounds correct, they're, they don't have any context. They're just basing it on, on the word choice, tone of voice and how confident the words are rather than the actual content of what they're saying. Trey Hunner: Yeah, yeah, it's. You've got to use the content because you have none of those cues or at Least you can't trust the cues because it's always speaking with confidence. Right. It never says, I'm unsure about this so much. It's funny though that I do think, I mean, we're talking about skepticism being a valuable trait, but kind of choosing where and when to be lazy. You know, like you said, don't hallucinate. Simon has, I think, tweeted out at some point or I saw this somewhere that one of his favorite ways of basically saying, you know, I want a better output than what you just gave me. I mean there's, there's do better or like fix it or like not enough, that kind of thing. One that I loved was just two characters, colon, parenthesis, like a sad face. Sean Tibor: Yeah. Trey Hunner: Which apparently it would often respond to by just trying to give you another response. Kelly Schuster-Paredes: I gotta try that because the less I can type, the better I feel. Trey Hunner: Right, Exactly. Although then you gotta wait for it to generate the response. Response. Kelly Schuster-Paredes: Yeah. And lately we've waited a lot. But I want to switch real quick because I've been dying to like kind of ask you this. You have so many great Khan talks and a lot of your talks are like misconceptions or common errors or all that. But one, one that I wondered and I actually wrote this on, the question is, like, what are some of your favorite things or like the things that you see a lot when you're working with people features of Python. So when I'm teaching kids, you know, I focus on APIs and functions and cleaner code in the 8th grade years. But what else? What else is like a good thing I could add or other people should focus on, especially with always working with developers or people learning. Trey Hunner: I think it depends on the level. And the reason I say that is the things that come to mind, I'm also skeptical that I don't want to say them because I feel like it could be a distraction too. And so an example of one that I think is too high level for most folks, but good to kind of to have a pin in your head to know I should eventually go look at this is. I would call it looping helpers is the way I think of it. You could, you could sum it up by saying generators or generator functions maybe, but they don't even necessarily have to be generator functions or generator expressions. They could even just be mashing together a couple existing things or even writing a function that accepts like a list and returns a list. Something that helps you loop and augments your loop. Because our for loops in Python, unlike some other programming languages, they don't think in terms of indexes. It's, it's just given you the thing, every single thing in the next item, here's the next item. Because of that, they're limited on purpose, which means you kind of need looping helpers to augment your for loops occasionally if you want to do something extra. Or the alternative is you write bigger for loops where you're manually keeping track of, you know, a counter like counting upward, or you're manually indexing to loop over two things at the same time, which you know, there's enumerate for the first one, zip for the second one. So knowing about the looping helpers and also knowing that you could invent your own, which means other people could invent their own. So probably you could find some either code out there online or a third party library or maybe even embedded in Python. The itertools module is a great place to help you kind of with your looping. So it's kind of, it's both too advanced in the sense that you really often don't need to admit you're on looping helpers, but it's not too advanced in that if you're aware that you could, which means someone else could, which means, well, they might be floating around either in the standard library Python or somewhere else. I think that's an often overlooked thing, both from folks coming from other programming languages and folks just learning Python because you just don't think to think of that way oftentimes. Because a lot of times people teaching programming are teaching it from the perspective of a language that loops with indexes because that's just the more traditional thing to do. Kelly Schuster-Paredes: I, I loop, we do loop through the list and I always teach them enumerate because that's, you should see the sixth graders when they see enumerate, they have no clue what's going on sometimes at first and then they're like, when it starts counting out the list for them, it's always an easy thing. So they're like, ooh, Sephora item one. Sephora item two. Sean Tibor: I honestly think we could make this entire episode like a few of our favorite things in Python, right? Like there are these like little gems of, you know, whether it's in iter tools or just language features or whatever that are just like almost like magic when you see them for the first time. Because your brain immediately goes to the hard way of doing it right? Like, well, I got keep counter and I got to do this and I got to, you know, because you get, you Start to work with the tools that you know. But there, like, I still remember, I think it was my second, first or second year of teaching. There was a. We were trying to do something with turtle or with. Yeah, with Python. Turtle. Right. And we're. We wanted to draw rainbow color and, and have it cycle over like the full rainbow of colors. And I was thinking of everything in RGB colors and I'm like, okay, how am I going to do this? How am I going to make this work? And to be clear, this is pre chat GPT. So some. This sixth grader found this code and was like, I think this would work and did it. And that was the day that I learned something new, which was the HSV to RGB function that exists in, in the standard library. Trey Hunner: Yeah. Sean Tibor: And so what she had done was said, okay, I'm going to iterate over a value, right? Like I'm going to increase this value from 0 to 1, right. By 0.1 or 0.05 or whatever her incrementer was. But she passed that into the hue value and fix. Mix the saturation and vibrance or whatever it is. Right. Kelly Schuster-Paredes: That was Circuit Python. Sean Tibor: Yeah. Oh, it was Circuit Python. You're right. It was Circuit Python. I remember she had this whole thing set up so it would cycle the colors through the rainbow beautifully. Right. And it was one line of code. And that was the moment I was like, okay, this is awesome. Right? Like, this is the best feeling in the world because it's something really cool. It's beautifully elegant and simple and I had no idea that it existed before. Right. And, and the sixth grader showed me how to do it and I was like, that's amazing. Like, it was so cool. Trey Hunner: This is one of the great things about LLMs, right? I mean, even before LLMs, like the sixth grader found it from searching, I assume, on the Internet. Sean Tibor: Yeah. Trey Hunner: And somewhere, somewhere in some webpage they found that mention, they tried it out and they figured out how to get it working. And there were probably other answers that weren't right, that kind of stuff. But it's the same thing with an LLM. If you ask it, that question question, you have to first think to ask the question. And what even is the question? You know, figuring out the question to type in is tricky. And then you get an answer that isn't quite what you want. Figuring out, how do I nudge it in a way that it might give me an answer that I want or at least tell me, you know, in its confident way. Oh, in fact, this isn't easy, or it's not included in Python, or you need a third party library or something. And so to answer your question, Kelly, I almost feel like that's the more useful skill is the, like figuring out how to ask the questions I need to ask. Because honestly, the looping helper thing, as I was saying it, I was also thinking, you know, if you're doing web development with say, Django use, you're often looping over a query set object or something. You don't. Looping helpers are a little bit less common than if I'm making like a command line script or something. Everything you're using Python for because they're. Or if you're in Numpy and Pandas, totally different world there. You give different answers depending on what you're using Python for. And so knowing how to. Or trying to ask those questions or imagine yourself. If I was a developer of Python and I could imagine a feature that I would kind of, I just type this and it would know it, you know, and I feel like this should be a thing. And then figuring out how do I turn it into a question that I then asked. Is this in fact a thing that. That seems like the really useful skill. Kelly Schuster-Paredes: I, I have a question that I should have asked ChatGPT, speaking of not knowing how to ask. So, you know, I don't know if you've ever noticed, ChatGPT always generates four underscore, blah, blah, blah, blah. It always uses like that line, I don't know if you've ever noticed when it's using like a throwaway loop instead of, of an I, you know, a regular 4i in range, it just. Trey Hunner: Oh, yes, yep. 4 underscore. Yeah. Kelly Schuster-Paredes: Why? I'm assuming that's because it's in code from other people. Why would you choose to do that? Because it seems like it's less readable. And like, I know when the kids do, they're like, what is this? I'm like, well, they're not gonna. That's like a variable they don't care about. Because I'm like, why don't they just put in. I was like, you can just put an I there, it doesn't matter. But like, why? Trey Hunner: Yeah, well, Arnita, you're right. It's because it's encode from other people. But how. I mean, the underscore, it's a valid variable name. That looks weird. Yeah, and I think that's the only reason it's, it's used as a, you know, here's our throwaway Right. Well, I say that knowing that I also know that Perl, which is where I think Python borrowed this from, it does the same thing. It was invented, what, 10 years or more before Python. I don't know why it uses that, but I suspect it's kind of the same reason that it, it looks weird because it's a symbol not. And it's the only valid symbol you can have in a variable name name. And so it kind of feels like it means nothing, I'm guessing is the historical reason. But now we have this weird thing that like a thing that was borrowed from Perl, which is known for being kind of a write only language, it's hard to read into Python, which is almost more on the read only side of things. It's, you know, harder to write it than it is to read it probably typically. And it's just kind of a borrowed thing that's almost like a weirdness just due to history. And there's a number of those that I feel like are just floating around in Python because, you know, as much as they, they bucked the trend of, you know, we're not going to use Ampersand, Ampersand for. And we use A and D, we're going to spell it out in English and upset all the programmers to make the non programmers happy. They also, it was made by programmers, C programmers and so a lot of things were borrowed. Kelly Schuster-Paredes: That, that'll be my next answer. So that's when they ask, that's a long one. We'll figure a way to learn it. Sean Tibor: That's also one of the things I love about, about Python and other coding languages too though, is that like there's a lot of convention, right? And convention is, is useful because it's a shorthand that we all use to communicate with each other. The problem is, is that if you don't know the shorthand, if you're learning it for the first time, everything looks weird. Right? Why is this variable all in caps while this other one is all lowercase? Right. Well, one is a constant and one is a variable, but they're actually both variables. We're just trying to signal to each other that they're constant. Trey Hunner: Yep. Sean Tibor: Well, that seems weird. Trey Hunner: Well, which is why I have a screencast that we don't have constants in Python, but we kind of have constants. They're just by convention mentioned. And you know, some languages like JavaScript have constants even though their constants can point to mutable objects, which means their constants can change. And now you've got A whole weird thing, which is the reason we don't have constants in Python. I mean, this is a pro and con to both. But I do like at least that our conventions, there's a whole discussion because of the history of, you know, where Python came from. When we add something new to the language, folks chime in and say, how can I teach this? And in fact, it has to be in the PEPs. There's a new PEP750, I think that is, it will be a very weird feature if it's accepted in its current form or even some of the other suggested forms. But at least in its current form, it's a weird feature that I'm not sure someone, if I was learning the language, what I would try to type into a search engine to even look it up, because there's no symbol involved. It's sort of just things happen to be near each other and because of that a thing happens and that, that's where like, it gets weird. If you can't look it up, like, because you can look up all uppercase variants, you might end up on something useful or even asterisk symbol. You know, you can't maybe put an asterisk in Google. Well, maybe you can nowadays, but you, you couldn't originally. And yet you could type in the word asterisk at least. And so that the more it is, you know, Googleable, searchable, whatever, the, the better it is for something to be either in the language or a convention. And I love that that's kind of part of the Python world is let's not add something to the language that's going to be hard to teach or to learn or at least if we do do, let's make it so that the person using it can look it up, but the person who's, you know, defining the feature like match case is a very weird one. But I don't teach match case to a beginner because they're probably not going to encounter very often. It's for a very weird in the weeds situation. Kelly Schuster-Paredes: Speaking of new stuff. It's not necessarily new, I just was f. Was it the case instead of if or in case was the case? Trey Hunner: Yeah, batch case. Kelly Schuster-Paredes: Matt, what is that? Like, why, what did that come about? I felt like that is another thing I'm asking you, like, you know, and you obviously know, but I countered it, you know who I counted it from? Mission Encodable with Anna and Harry, and they put it in one of our, One of the things, because I use it as a review for the eighth Graders and we, we go through one through eight in two weeks because. And they had Match Case in there this year. And the kid says to me, this doesn't work. And I was like, sure it does. It has to. Harry and Anna put it in check. Isn't that a weird one? Trey Hunner: Yeah, it's. Sean, do you want to. Are you coming from languages with switch case? Sean Tibor: Yeah, I mean like, that was where I started. Right? Was it the early on, was it Java and php, I think had some of this. But, but the whole idea was that like, you know, when you get into Python and you have like if. And then you have an elif and then you have an ELIF and another elif and you're just basically comparing things. There was a different convention for that and that was basically like, basically, you know, go through this structure and as soon as you find something that matches that, that condition. Trey Hunner: Right. Sean Tibor: Or that that value equal to it. Yeah, yeah, go do this thing. Right. Well, you know, because Python, right. And we, we've had, we have the luxury of looking back on all that history and looking at all of these things and this is a relatively new introduction, I think, like 3.103.10. Yeah. And so it's, it's relatively recent. We had the luxury of looking back on all of that history of like the good, the bad and the ugly of how those switch case statements work and said, you know, we're going to do it as a match case instead. Which is a little different. Trey Hunner: Right? It's different and I'm glad it's different because it, it's a little subtle, but it at least subtly indicates to someone who's used to switch case. This isn't a switch case and maybe you shouldn't use it as a switch case. And I would actually recommend, most of the time you might look up, you know, I want to use a switch case here, use a dictionary instead. Almost every time I want a switch case, I'm trying to do a, a mapping from, oh, when I have this thing, I want this other value. When I have this value, I want this value. That's a key value lookup in a dictionary. But, but with, you know, sometimes there are situations where you can't do that. There's a more complex bit of code. You could make the values in your dictionary functions, which would get really weird and then you're calling. Sean Tibor: But, but this is pretty fun. It is pretty fun to do that. Trey Hunner: It's fun, but it's, it's maybe a bad idea. But the thing is with match case Almost always the time you want to use it. This, where this feature really shines is not as a switch case equivalent, but as a pattern matching tool. They call it structural pattern matching, which sounds scary and it kind of is scary. It's matching the size and the shape of the list or tuple or whatever iterable you give to it, popping out things out of it, while also matching other values within it. And you can do this with dictionaries as well. It can even do it with objects, the attributes and objects. And it's really useful for, like if you were making, for example, Django's template language, or you're inventing kind of a parser for your own language, in a sense, you might use Match Case to help you do the parsing bits. In fact, I don't remember where I put this. I think I stuck it on my own Pastebin tool. I probably tweeted it out years ago. But when it first came out, I, for fun, took some of Django's code, it's template language, and turned it into using Match case to see if it made it more readable. And there were definitely some functions that I felt were a lot more readable in this way, because the other way was, you know, if index negative 2 equals. Equals, you know, the. At the string as well, then we look at index negative one and we say something about it because there's just a bunch of like manual indexing of this interval capacity, which you had to do by necessity. It was just this messy code because it had to be messy for what it was doing. And Match Case kind of was a way to clean it up. That said, a lot of folks don't think it should have been added because it adds an extra complication and extra mental overhead for someone who's just learning. They might get distracted by it, you know. Yes, it does kind of help in these weird niche situations, but it is yet another thing someone might be worried about teaching. And I don't know, I don't have strong feelings on this. I feel like the walrus operators kind of simultaneously or some of the other newer features as well. Sean Tibor: Yeah, I, I would agree with that. I think, you know, and this is one that I don't even know that it's worth teaching. Right. Like, there's things that I would teach to people. Like, you know, we. We were talking before the episode a little bit about, like, what things would be great for teachers to know, like good features in life. I don't know that these are ones that I would teach to anyone. It Might be more at most like in a one on one setting, when you're working with a developer doing a code review or something like that, they're like, I'm. They, they fall into one of these use cases. You could suggest that as an approach and show them how to do it right. But I would never be. I can't imagine myself sitting in a classroom saying, let me teach you about the walrus operator and why that's better. Right? Trey Hunner: Yeah, yeah. One of the walrus operator is one that, you know, it might come up. But Match Case is certainly one I just linked to something we can, I can link it in show notes as well. But it. At the point where you're thinking about Match Case, you're often thinking about abstract syntax trees or something really in the weeds. And you, you learn it on your own. At that point that you were going to say Kelly. Kelly Schuster-Paredes: Yeah, I was going to say. So I, we. I always have one. I have this 8th grader who is off the charts intelligent. I almost think he's stronger than one of the kids we had a couple years ago. And he always comes to me, he's like, have you heard of blah blah blah? Like, no, tell me more. He's an eighth grader. He's so good. And then he was the one with, why do we have to use. I was like, you don't have to worry about Match Case. We're not doing that. It's not going to be. I'm not going to ask you to do that. That, you know, if it comes up in chat GPT ask it to simplify it. But he asked me and I was like, yeah, I try to explain it, but Sean knows it takes me a while to think of a metaphor. I have to think of a metaphor to teach the kids before I can fully feel comfortable explain it to the kids. And I just said to him, that's for you to figure out. Come up and teach me about it when you get it figured out. And this kid was like, don, okay, this kid's gonna be ruling the world in ninth grade. He's such a great coder. It's so impressive. Trey Hunner: So the two things I love about what you just said, the metaphors thing, I wish that I was more disciplined about that because almost all my best explanations of metaphor, but I don't always reach for them. I don't, I don't make it a requirement for any myself mentally as I should. And also that students kind of practicing elaboration, in a sense they're right. Which is, I mean, I know you have Barbara Oakley on the podcast at some point, but I love all the stuff she's written on this and other folks as well. But, like, she's got so many books that she's co authored with other people. I feel like I've, you know, I keep hearing her words more than others, but elaboration is one of those that I feel like is undervalued by folks in, you know, as part of a reason to speak at a talk or give a talk at a conference or ask questions about something you don't know about, or try to explain something you don't. Kelly Schuster-Paredes: Hundred percent. We actually got into a conversation, I think, on Twitter last year or the year before, about functions. I don't remember if it was Steven. Steven G. Who brought it up. I think you and I were trying to give a metaphor for functions. That was a fun. And mine was always, you know, it's always this book with a post it symbol, and I can give you the post it that's a print, or I could put it in the book and return the value. And that had. That was something that cleared everything up in my head for functions. And it's become like one of my awesome metaphors. Trey Hunner: We're going to have to talk about metaphors in Python. Kelly Schuster-Paredes: I love metaphors. Trey Hunner: I'm incredibly interested in this topic and I. Kelly Schuster-Paredes: Let's do a talk at PyCon together on metaphors. Trey Hunner: I would possibly be interested in that. I mean, the thing is, whenever it comes up at a conference, let's write a book together, let's do a talk together. Let's. I don't want to say yes, but I also don't want to say no. Right. Because how many things are you going to sign yourself up for? Kelly Schuster-Paredes: But zero. I'm not signed up. I know you. Sean Tibor: I think you could commit to making an outline together. And if the outline looks good, then maybe there's a talk. Trey Hunner: Well, that's the way you give a talk. Right. In fact, this Thursday, I think we're going to do like a Twitter space on this. Writing a talk at PyCon. Your talk that you're going to submit to Pycon this year, Kelly, you just got to write the outline. You don't have to write the talk. You write the outline, you submit it, and then in a few months, when they accept it, then you go, oh, do I tell them that I'm not going to give it at this point? I could do that. That's not too super implied. Or I actually give the talk now. They. I mean, they accepted it, which means they want to see it. I had, it just starts with the outline. Kelly Schuster-Paredes: The biggest scare ever is when Sean and I talked to the outside of the education field and we went to go talk and I turned around and I said, queen. He's like, where? And I'm like, don't look at him. That was a very scary moment. Trey Hunner: Yeah. I love how much Guido is into the teachability of Python. I mean, he really wants Python to grow as much as to be as accessible as it can be to everyone, which is, it's not his. I don't think he's the one who feels like he, he should be kind of holding that torch up. But he definitely seems to be, you know, interested in, and empowering it, which is great. I would, if the opposite were true, I would be really scared for the future of Python. Right. If the folks kind of near the top of it weren't interested in that. Sean Tibor: I mean, I also kind of see it as, and not, not having spoken with him about this, but just looking at it from the outside, it definitely feels like he's kind of accepted the fact that he's, he's the face of Pipe Py Python. Right. He, you know, as, he's the one that gets quoted in the articles, he's the one that everybody wants to come talk to at PyCon and you know, like, and, and reaches out for interviews and all those things. And I think he's had that realization that this is not going away. Right. Like that kind of notoriety and fame doesn't, isn't going anywhere, so how can I best employ it or use it towards something good and positive and meaningful? And that to me has always struck me as the best possible approach to take, like the best possible use of that kind of attention that you get to direct it into something productive and positive. And I, I, I really appreciate that. Trey Hunner: Yeah. I think it's also his way of coping with it. Cuz I, I think I would feel a little bit similar if I were in his situation in that he, he doesn't seem to crave the attention. Right. He seems like he's a, he's a reluctant champion, but he knows that if he isn't a champion, if he was always pushing people away, that it wouldn't, it wouldn't, you know, work out so great in that people would be, you know, maybe turned off from the language of the community a little bit. He's kind of a representative of the community. If someone wants to meet him, it's like wanting to meet anyone who's kind of your idol. You don't want it to. You don't want it to go completely south. Kelly Schuster-Paredes: Hey, question. Another change of questions. How do you keep. For. For me, it's hard because I'm always teaching the same thing. I feel like I'm always teaching. I. I'm always at a basic level. I'm not. My 8th graders are probably pretty advanced for 8th graders compared to some other people that we've talked to. But I feel like I've never. I don't say never because I am trying to learned Django, but it's a slow practice. How do you balance your, like, learning to keep up to date and your teaching of people back at the basics? Like, how do you move yourself? What do you do personally to get motivated to go further and learn more? Trey Hunner: I feel like this question comes up more often than it should, although I might be biased there. And I think part of my bias is when it comes to Python. I almost feel like if I had my head in the sand for five years, it wouldn't really matter that much because my curriculum has changed very little when it comes to new Python features. My curriculum has changed quite a bit, but it's because, you know, I read books by Barbara Oakley and others and I go, you know, maybe I should actually flip this and have them do the example before they know what they're doing. Like, you know, that's the way it changes in the teaching way, not in the. Or the example. I thought of this great metaphor, you know, that kind of thing. But I don't teach the walrus operator in Intro to Python unless someone asks about it. There are things, in fact, I've removed moving that I've taught for years that, what if I didn't teach that? Would anyone miss it? And I try it a few times and see how it goes. Django, though, that's where things get fuzzy in that you're typically on the newest version of Django, or you want to be, because it's. And the newest version of Django, more aggressively than Python, will deprecate a previous thing and then remove it or change it. Python is very conservative about that. If something gets deprecated and removed, it's deprecated for a while and there's warnings before it gets removed or it's a feature that you probably weren't using anyway. Whereas in Django, they're not nearly as conservative. They're a little bit more aggressive about, you know, we don't like this way of doing things. We'll deprecate it for a few versions, but you know, a few versions in Django land isn't all that long. And so from one lts to the next, from one, you know, stable release to the next, you, you may have a bit of code that you need to end up changing. So I, my way of doing that is I upgrade to the next version of Jenga. I try out my curriculum at a bare minimum, I need to make sure it works. Beyond that, if there's some cool new feature, I don't keep up with it super well, but I try to kind of read some of the, you know, what's new, that type of stuff and skim it and see is there something that I should know for myself and my own. Because Python Morse is also a Django app, though I'm, I'm conservative and that I'm always on the lts I don't, I do not like upgrading every six months. It's painful. But is there a feature I should know about for myself and is there a feature I should know about to make others aware of? And often it's a third party package is at least been floating around for a while. So even there, I think the biggest thing to be concerned with is does my curriculum even work on the newest version? Less so than do I need to stay up to date with all the latest and greatest stuff. I do that because I find it fun. I mean, the new Python repl, everyone's going to know about it in what, November I think is when the Python 313 is launched. But it's going to be amazing and you don't need to know about it today. You're going to be excited about it in a couple months. Months. I was excited about it a couple months ago because I heard about it and I decided, well, I'm going to compile my own version of Python and try out the new Python Repl just, just for that. And they even reported some bugs in it and you know, somebody fixed the bugs who knew more than I did about that or was willing to learn more than I was about that. And that's a thing that I did for fun, you know, I didn't need to do that really. And a little bit also selfish reasons that, you know, if I make sure the new Python Repl works well in the next version version that means it's going to be great for my students because they're going to be happier because they spend time in the Python repl because I'm typically using it as opposed to a jupyter notebook or Other or ipython for my own teaching, typically, at least for very, very fundamental Python. Sean Tibor: I think that was something that I recently thought about, was that, you know, when things. When you have a lot going on, there's a lot of, you know, competing priorities. Work, home, personal, like, you know, whatever. It is supposed to be fun at least part of the time, right? Trey Hunner: Yeah. Sean Tibor: And I think the new, new, you know, kind of guideline I have is about 30% of the time it should be fun, right? Well, you still have to pay your taxes, you still got to do the dishes, you still got to fill out the HR paperwork and all those things. But about 30% of the time, you should be having fun, going, wow, this is kind of awesome, right? Trey Hunner: I feel like maybe even more than that, but, I mean, it's kind of hard to. I understand that it's hard sometimes with work and everything. Like, sometimes it's just not going to be fun. But the more. The more fun you can have, I feel like the more it makes the non Fun stuff kind of a. Well, I want to get through this thing because then I can get to the fun thing. And, you know, you need something to look forward to. And I don't know, I'll mention this at the end, but I have a newsletter that I send that every Wednesday morning. And a few months ago, there was one just on having fun, because I feel like we don't do that enough with Python, where we just sit down and we just do a thing. We play with some code. There was some code I found on Mastodon that it was two lines of Python code. I think that made a. No, three lines, maybe that made a Sierpinski triangle, which was amazing because it's just the math is so simple. And. And I thought, you know, I could make this triangle look a little bit more like. What I have in my head is thinking of a Sierpinski triangle. It was kind of like a right triangle. And I was thinking about my soceles, I guess that is like. And so then I turned this three lines of code into, you know, like 30 or 40 lines of code or something. But it, like, it looped, and then it ended up being kind of like Al Swigert's scroll art thing, where it's, like, scrolling off the screen and getting bigger and bigger. And I was just having fun for like a half an hour, an hour at the end of the workday day. And I just decided, you know, 10 minutes into this, this is just the rest of my day. This is. I'm not going to work anymore. Today I'm just going to have fun on this. And it was, it was so fun. And you know, showing that script to someone else, they're not excited about it, but it doesn't matter. I was excited doing it. Kelly Schuster-Paredes: Someone once, I once read it was the have tos versus the get tos. Trey Hunner: Yeah. Kelly Schuster-Paredes: So I have to go and give someone a grade, but I get to see their faces and I get to try to get them excited and I, I get to, I get to nerd out with AI. I get to listen. Today when I forgot I had another win, I showed this biology teacher perplexity. And every day she's like, oh my God. I asked it a question about some sort of whatever it was, organelle theory. And she was telling me all this stuff about how the mitochondria developed its own DNA and the chloroplasts developed their own DNA because it came from another organism. And she learned this all because I showed her, I showed her perplexity. And every day she tells me, and I got to make it this page. So those are how I do it too. If I get to's and my have to's, I have to's. I try to like, if I don't get to them, they're on my still on my desk with a list and I cross them out, you know, I have to do these. But my get tos are what we live for. So. Yeah. Trey Hunner: Yeah. It's funny how one little thing that you're excited about can kind of like pull you through the day sometimes. Yeah, I mean, sometimes it's a big thing. Sometimes just one little thing can do it though. Kelly Schuster-Paredes: That's the get to is when you, where your code actually works and you've done it yourself and you haven't cheated. With ChatGPT, I get to finally feel that satisfaction of going did it by myself. Trey Hunner: Or in my case, I used ChatGPT to help me make the entire models file. And then I argued with it for a little bit and then I, you know, I made it and then I went, well, now that you've made the models file and you know all of my specs that I you, I pasted it this multi paragraph thing telling it what I wanted it to do because I needed to write out how I wanted this new feature to work first for myself. And then I asked it to make the admin PY file, which is never fun to make in Django. And it wrote the whole thing and it worked and it saved me I don't know how many Minutes of time because there's so many weird little quirks. It's all fiddling with bells and whistles, levers with the admin files. It's never making a thing. It's just customizing the thing to just do the thing you want it to do. And then after that, I could focus on the fun stuff, the fun part of the coding. Kelly Schuster-Paredes: So that's why I keep failing on my Django app, because I have no idea what the admins file is. See, I'm going to have to learn all this and go. I have to watch my videos. Sean Tibor: Well, unfortunately, I think we have to stop because we're a little bit over time already. But it has been a pleasure to get to speak with you, Trey, this week, and I hope we get to do it again soon. I love these sorts of conversations where we're just talking about little things that we love, little nuances, little teachers teaching tricks and techniques, and then stepping back and thinking about the philosophical impact of what we're doing and how that affects things. So, Trey, it's been really great to have you on the show. And I think I can speak for Kelly by saying we should have done this a long time ago. Kelly Schuster-Paredes: We'll do it again. Trey Hunner: I'd love to do it again. Yeah, it's been great to be here. And I guess the two things I'll close with is one that your audience probably already knows, but I guess I'll mention it because I mention this to my students all the time, because I like, especially to adults, students, to reinforce it, that you don't learn by putting information into your head. You learn by trying to retrieve it from your head. You know that it's tempting to watch the videos, tempting to, you know, read the things, but the writing of the code, the trying to get it out, or even flashcards, you know, whatever it is, that's. That's the way learning happens. Which, you know, Barbara O'Connell. That's the way I know these things. And then the other thing is, if you do do Python, I send out a Python tip every Wednesday morning. And I guess we'll drop a link to my newsletter. And that's. Actually, I do have a short URL. I could spell it out. P y m.dev/newsletter. Pretty sure that's the URL. Sean Tibor: Nice. Kelly Schuster-Paredes: We can put it in the comments and it'll show up on LinkedIn. Trey Hunner: It'd be awesome. Sean Tibor: Well, we. I know Kelly's been subscribed to those for years. I think I had them going for a while, and then I got. When I changed email addresses, I lost them, so I need to sign back up again. But I've always thought that the weekly newsletter helped a lot also because it was just a reminder if I was doing something else or busy with something else, it was something new that I maybe I hadn't seen before or it was something that I had seen. I was like, oh yeah, I can use that or I can try it. So if you need a little weekly pick me up python nuggets or morsels, if you will, I would definitely recommend it for sure. Trey Hunner: Kelly. Thank you. Sean Tibor: Kelly. Do we have any announcements this week? Kelly Schuster-Paredes: No, but I do have to put another plug for Dr. Fei Fei Li's book that I started reading. Oh my gosh, it's taken me a long time, but as a non computer science major, it is giving you the history of all these people who are in the AI. I'm at the point of the book and not to spoil Thriller, but she was a physics major. Like this super. She, she still is super intelligent physics major and like she went to Berkeley and they were sticking like neurons or whatever in a cat head to figure out how it sees images. You gotta get the book because I mean the history of AI and all these things that I'm learning that I didn't know as a non computer science major. It's so cool. It's so cool. And she was a, she was, she was an immigrant from China, so, so I'm going to plug that book again and hopefully she'll listen to and come on the show because I felt being like, feel like that doctor she's got some things to say. Trey Hunner: You could send her an email. I did, she might. Come on. Kelly Schuster-Paredes: I'm waiting, I'm waiting. I'm sure she gets to. Trey Hunner: I'm. That's, that's exciting. I didn't. AI was an elective for me in school. I didn't take it and I regret it today because, you know, 2024, I kind of wish I had. Kelly Schuster-Paredes: Well, I know. Well, you can go read the book and get some history. It's, it's, it's in the show notes. I'll post it. Sean Tibor: All right, well, I think then that will do it for this week. So once again, thank you, Trey, for joining us. Hopefully have you back very soon to talk more. But for this week, teaching Python, this. Kelly Schuster-Paredes: Is Sean, this is Kelly.