we'll see more on that in the future video on uh paidantic specifically. So now let me take this back to having good data here and rerun this really quick. Okay, so that's data validation. So where does data validation fit into our applications? So it's not so useful for our scripts where we're hard- coding our inputs like we're doing here in this script. It's mainly used with dynamic data where you're taking in data from other sources so that you can protect uh protect against taking in data that's incorrect. So it's great for API payloads, config loading, uh boundary checks where data is coming from external sources, things like that. So let me do a quick recap and overview of what we covered and also some misconceptions that I've heard when it comes to these terms. So first, type hinting. Uh, type hinting adds information to our code, type information to our code. They're not enforced by Python. They're just documentation and metadata that other tools can use. And second, we have type checking. Type checking analyzes our code before it runs and checks whether we're using the right types in the right places depending on what we specified with our type hints. It uses tools like my pi to do this analysis. and it still doesn't prevent our code from running. It just warns us about those potential issues. And third, we had data validation. It's a runtime verification that makes sure that our data meets specific requirements. And it's not strictly limited to just data types, although that is the big one and one of the main reasons that we use it. But it can be verification for anything like whether something is a valid email address or a valid phone number, something like that. And you don't always need all three of these. You should choose based on your needs. So I'm not making this video with the expectation that everyone should be using something like Pantic on every script that they write. I definitely don't do that myself. I only use Pyantic when I'm taking in data from external sources, which isn't the case with a lot of the code that I personally write. So for this example here, if I was writing this script myself and I was the only one who uh was going to be using it, I'm not going to do data validation on this because I can see right here that I'm passing in an integer. It's just unnecessary and uh you know extra code that we don't need. So here's kind of my recommended progression for real world projects and what we should be using. Now I would recommend using typense moving forward. So if you have an older codebase and want to add type hints, it doesn't have to be a complete overhaul. You can add type hints as you go and just fill in a little bit at a time. So if I had more functions here below this create user one, then I could add in the typants just to the create user and not even touch the other ones. I could just update a little bit at a time, commit that code, and then when I get back to this, add in some more. So, I'd also recommend using a type checker that integrates with your IDE uh so that you get early warnings when types aren't what they're supposed to be. So, I used My Pi in this video, but there are different tools out there. So, I've done some recent videos on astral tools like UV and Rough, and they have a new type checker coming out called TY, and it looks fairly promising. I've been messing around with it for a bit uh ever since I released the rough video and it seems to work pretty well and there's an early development extension for VS Code and you can choose that type checker if you want. It just depends on work what works best for you. I'm likely going to be using that TY extension once they flesh that out a little bit more. Now, in terms of data validation, uh like I said, don't go overboard here. Uh you don't need this everywhere. I don't use it on my local projects unless it's explicitly needed to prevent a critical mistake. Uh but you definitely want to validate external data. So things coming from APIs, from users, uh from environment variables. Uh you'll want to validate that with something like Pyantic to avoid saving bad data into your application or database. Now again, I used Pyantic for this video, but that's not the only option out there. Um, and some may depend on what framework you're using. So, for example, if you're using Django, they'll have their own data validation methods instead of something like Pyantic. And as I mentioned before, fast API uses Pantic extensively. So, like I said, in upcoming videos, I'm going to be doing a deep dive tutorial on type hinting best practices and also one on paidantic specifically. So, we'll do a deeper dive into those when those individual videos are released. In this video, I really just wanted to touch on the differences um and some confusion that I've seen floating around out there surrounding these terms specifically. So, having this video out there will allow me to move on to those more detailed videos without getting bogged down in those misunderstandings. So, be sure that you're subscribed if you want to be notified when those future videos are released. But with that said, I think that's going to do it for this video. Hopefully now you have a good idea of the differences between type hinting, type checking, and data validation, and when you might want to use each in one of your own projects. But if anyone has any questions about what we covered in this video, then feel free to ask in the comment section below, and I'll do my best to answer those. And if you enjoy these tutorials and would like to support them, there are several ways to do that. The easiest way is simply like the video and give it a thumbs up. Also, it's a huge help to share these videos with anyone who you think would find them useful. And if you have the means, you can contribute through Patreon or YouTube. And there are links to those pages in the description section below. Be sure to subscribe for future videos, and thank you all for watching.