WEBVTT
00:00:00.001 -->
00:00:04.100Hello and welcome to Python Bytes, where we deliver news and headlines directly to your earbuds.
00:00:04.100 -->
00:00:10.500This is episode 229, recorded April 14th, 2021. And I am Brian Okken.
00:00:10.500 -->
00:00:11.340I'm Michael Kennedy.
00:00:11.340 -->
00:00:12.880Hi, I'm Gwen Faraday.
00:00:12.880 -->
00:00:15.140Hey, Gwen. Great to have you here. Thanks for coming.
00:00:15.140 -->
00:00:16.580Yeah, thanks for having me.
00:00:16.580 -->
00:00:20.240We invite you because you're doing really cool stuff with Python and you're doing some neat
00:00:20.240 -->
00:00:24.840things on YouTube and some, are you doing live streaming as well or just videos?
00:00:24.840 -->
00:00:28.600Maybe just tell people real quick about yourself before we get into our topics.
00:00:28.760 -->
00:00:34.080Yeah, sure. So I'm, I work as a senior software developer at a consulting company.
00:00:34.080 -->
00:00:40.340We do almost entirely Django projects there. And I've really loved getting to use Django for the
00:00:40.340 -->
00:00:47.560past couple of years. On the side, I also teach at a coding school where we do full stack JavaScript,
00:00:47.560 -->
00:00:52.760but most of our backend and computer science curriculum is actually Python. And then we also
00:00:52.760 -->
00:01:00.420use Django for the final portion of the curriculum as well as the final project. And then on the side,
00:01:00.420 -->
00:01:07.440as Michael mentioned, I really like to make videos and content and things like that. So I've done a
00:01:07.440 -->
00:01:14.940mixture of JavaScript and Python content under the name Faraday Academy. And I also have Twitch live
00:01:14.940 -->
00:01:23.020streams. So most recently for Python, I've been kind of diving into FastAPI live and trying to learn
00:01:23.020 -->
00:01:28.360async Python since I haven't really done much with async Python in the Django world.
00:01:28.360 -->
00:01:29.080Nice.
00:01:29.080 -->
00:01:34.800Yeah. Super fun. FastAPI is a great technology to work with. So you sound like you're busy,
00:01:34.800 -->
00:01:35.760but in a good way.
00:01:36.300 -->
00:01:41.500But I love programming. So it's like my passion. It's not burdensome, I guess.
00:01:41.500 -->
00:01:44.420Yeah, it doesn't count as work. That's great. Brian, you want to kick us off?
00:01:44.420 -->
00:01:52.560Yeah. The first story I want to cover is about coverage. Couldn't help the bad pun. So Ned
00:01:52.560 -->
00:02:01.240Batchelder put a post out just the other day. There's a beta out for coverage. It's a 5.6 beta one.
00:02:02.240 -->
00:02:09.020It's kind of a big revamp. Well, I don't know how much code he changed, but he says it's a big deal.
00:02:09.020 -->
00:02:16.960So the thing that's exciting about this is it's supposed to exclude third-party packages. This is
00:02:16.960 -->
00:02:24.300actually amazing because in the workflow, one of the problems I've had before is I'm just like,
00:02:24.300 -->
00:02:28.980I've just got some, just starting out with a project, say, and I got some code in a directory.
00:02:29.200 -->
00:02:33.940I've got my virtual environment there also, same directory, throw some test code in there.
00:02:33.940 -->
00:02:39.840And I want to tell, you got to have to tell coverage. If you don't give it any flags,
00:02:39.840 -->
00:02:47.880it just measures everything. But now it doesn't. Now, if you say like coverage run pytest or coverage
00:02:47.880 -->
00:02:53.620run your, like whatever your module is, because there's, you can run coverage without tests too.
00:02:53.720 -->
00:03:00.020It's a thing. It just, it just grabs everything and reports everything. And that's hardly ever what
00:03:00.020 -->
00:03:07.740you want. So the change in 5.6 beta one is to, to, to knock out the third-party packages and,
00:03:07.740 -->
00:03:12.760and not collect those. And I tried it out on a couple of projects. I want to try it out on more,
00:03:12.760 -->
00:03:17.960but like, for instance, if you do it on your current direct, even if you say, give it just your current
00:03:17.960 -->
00:03:22.580directory, it's going to include all your virtual environment there if it's there also. And you know what that,
00:03:22.640 -->
00:03:29.140so this is a really cool thing. and he's, he's also, it's beta because he'd like to hear
00:03:29.140 -->
00:03:35.140from people to find out if there's problems. So go out and test it out. I haven't tried it on,
00:03:35.140 -->
00:03:39.320um, pytest plugins yet. That's what I'd like to do next, but this is cool.
00:03:39.320 -->
00:03:43.160Yeah, that's really nice because obviously you want to have code coverage of your code,
00:03:43.160 -->
00:03:48.340but you absolutely have no interest in testing other people's projects, right? There, there are packages
00:03:48.340 -->
00:03:52.380that you're using and whatnot. So yeah, that's perfect. Do you have to do anything to make this turn on?
00:03:52.560 -->
00:03:57.360well, yes, you have to right now, because it's in beta, you have to initially,
00:03:57.360 -->
00:04:03.260you have to install coverage equals equals we've got, we've got it in our show notes, but coverage
00:04:03.260 -->
00:04:10.940equals equals 5.6 B one. It's also in the blog post that we linked to, but, and it works
00:04:10.940 -->
00:04:18.080with, so I tried it also with the pytest dash cov plugin. And if you install pytest cov and then install
00:04:18.080 -->
00:04:21.620this other version of coverage, they'll work together and you can use them together too.
00:04:21.620 -->
00:04:27.660So yeah, very nice. Gwen, what's the coverage story for you all? You do, unit testing,
00:04:27.660 -->
00:04:29.720code coverage analysis, things like that.
00:04:30.420 -->
00:05:00.400So as far as for Python and Django projects, we do some testing, I would say not enough testing. So just like most companies I've worked at, we always have the discussion. We should do more testing. And sometimes we do more testing and sometimes we don't. So, our development team has been talking about it. So actually this package, code or coverage.py I've never used before, but I was reading about it in the show notes and looking it up before this episode. So I was like, Oh, yeah.
00:05:00.400 -->
00:05:04.440That's a really nice tool. I think I'm going to use it, but mostly we do unit testing.
00:05:04.440 -->
00:05:04.440Yeah.
00:05:04.440 -->
00:05:11.440like really complicated areas that we think might break or might have edge cases or something like that.
00:05:11.440 -->
00:05:28.980That's actually a great use for coverage because you can, like, if you specify the sort, like which source to cover, you can zoom in and say, I just have this little directory or this, these few modules of code. You can say, just cover those. And, and you can check the coverage on that.
00:05:28.980 -->
00:05:29.480Yeah.
00:05:29.480 -->
00:05:34.420That's interesting. So you could generate reports on different areas, even.
00:05:34.420 -->
00:05:34.920Yeah.
00:05:34.920 -->
00:05:35.080Yeah.
00:05:35.080 -->
00:05:35.420Yeah.
00:05:35.420 -->
00:05:36.020Nice.
00:05:36.020 -->
00:05:39.720Yeah. Like I only care about this part. So just tell me about this part. Yeah, that's perfect.
00:05:39.720 -->
00:05:40.300Yeah.
00:05:40.300 -->
00:05:56.980All right. Well, this next one that I want to cover has to do with platform as a service. So we often hear about Azure, AWS and, and the Python world. Heroku is very popular, but you know, these platform as a service places, you, where you git push your code and then it makes servers go.
00:05:56.980 -->
00:06:17.840Servers go and new versions get deployed and who knows how that happens. It's all well and good if you want to run in the public cloud, but what if you want to run just on your own servers? So Ian Maurer sent over this thing called Piku. So Piku is the tiniest pass platform as a service you've ever seen. It allows you to do a git push deployment to your own servers. Isn't that cool?
00:06:17.840 -->
00:06:18.400Yeah.
00:06:18.400 -->
00:06:33.220Yeah. Yeah. So the idea is you basically set this up on your server and then you connect it basically directly through GitHub. And then whenever you do a git push that automatically kicks off a new server creation.
00:06:33.460 -->
00:06:45.760I think it probably is running on Docker or something like that, but not a hundred percent sure. I haven't dug into the internal tout runs, but so here you can even see on, on the right of the homepage, which is an animated GIF. You can go and check that out.
00:06:46.080 -->
00:07:00.800But you just need to sort of see what it does. It says, as soon as you do a git push, it'll come along and says, you're remote creating as opposed to just, you know, writing objects, you know, push done. It like continues on. It says remote creating app, deploying app, your branches up to date.
00:07:00.800 -->
00:07:17.420Now your app is created creating virtual environment. And you can basically tell it what your requirements files is, what the execute file, just like Heroku, you give it a, like a proc file or something. It's called something like that, where it just basically says, when you run this project, what command do you give it?
00:07:17.420 -->
00:07:35.880And then it just runs. And that's, that's pretty cool. So it's really meant to be especially useful for low end devices. So I think this originates actually from working on Raspberry Pi. So like git push deploy to Raspberry Pi, which is a Raspberry Pi clusters, which is awesome.
00:07:36.140 -->
00:07:47.720So that one of its, you know, some of its core ideas are it's supposed to run on low end devices. It's supposed to be accessible for hobbyists and, you know, lower school, like K through 12 school grade students.
00:07:47.720 -->
00:08:02.180The whole platform as a service is about a thousand lines of code of Python, I think, and quite functional. It adheres to the 12 factor app of like separation of concerns and separation of configuration and login and so on.
00:08:02.260 -->
00:08:10.040Yeah. It's, it's pretty neat, pretty simple to use. And then you just install the client and then you just do your, your git pushes with this thing.
00:08:10.040 -->
00:08:18.420So if you've got a bunch of Raspberry Pis or other devices you want to use as a platform as a service, here's a pretty interesting option.
00:08:18.420 -->
00:08:25.120If you just have also plain Linux x86 machines and you want to make them be, you know, something like Heroku.
00:08:25.640 -->
00:08:40.200You know, I went through a lot of work over at TalkByThon training so we can git push to a production branch and that automatically kicks off this whole workflow that, you know, not just updates the requirements and installs the new ones and restarts it, but a little bit more than that.
00:08:40.200 -->
00:08:46.140It was a lot of work. This thing sounds really handy if you've got a pretty straightforward case, but you kind of want that same workflow.
00:08:46.140 -->
00:08:51.200Do you know, does it just work with GitHub or can I use it with other things too?
00:08:51.200 -->
00:08:55.160I think it just works with Git. I don't think it has anything to do with GitHub itself.
00:08:55.160 -->
00:08:55.700Oh, okay.
00:08:55.700 -->
00:08:56.580Yeah.
00:08:56.580 -->
00:08:57.040That's great.
00:08:57.040 -->
00:09:04.480Yeah. Yeah. It's pretty cool. So if you go and you watch, if you watch the GIF, the animated GIF and you click on it, it becomes like a little movie type thing.
00:09:04.480 -->
00:09:11.780You can see they start from an empty directory with the code that they create or the code is already there, but it's not in source control.
00:09:11.780 -->
00:09:20.680Then they get in it, the local repository, then they add a remote, which is not GitHub. And then as soon as they push to it, it kicks off the creation and running of this thing.
00:09:21.100 -->
00:09:32.340I think we're going to use this because just for like internal servers. So I've got internal projects that we can't host them on Heroku or something like that. That just ain't going to work.
00:09:32.820 -->
00:09:33.260Yeah.
00:09:33.260 -->
00:09:40.620But we could, you know, update the website and stuff and push to Git and have it pull it into the server automatically.
00:09:40.620 -->
00:09:50.620Yeah. There's all these little internal web apps that people run at companies that wouldn't make sense necessarily to run on a public cloud because maybe they need to talk to local infrastructure.
00:09:50.620 -->
00:09:55.180And you guys even have hardware devices where you're working that you actually talk to.
00:09:55.380 -->
00:10:01.700So yeah, here's a way to get a better deployment story without making it your next project to keep maintaining.
00:10:01.700 -->
00:10:02.500Nice.
00:10:02.500 -->
00:10:14.960Yeah. I was, I was looking at this and I have a somewhat clunky setup for personal projects where I have different Docker containers and watching and the Watchmen Docker container running on my servers.
00:10:15.180 -->
00:10:19.660So I was looking at this, I was like, that's so easy. Why don't I just use this?
00:10:20.140 -->
00:10:32.240Exactly. Yeah. I don't know how flexible it is and how much of a general solution it is. Cause like I said, I already have a solution that is like this, but I'm super glad to be able to just get, you know, git push to a certain branch.
00:10:32.240 -->
00:10:41.780And that means in 30 seconds, it'll be deployed in a consistent, reliable way that I don't have to think about. It's, it just makes it so easy to go, Oh, this, this part of the code is ready for production.
00:10:41.940 -->
00:10:50.040Get push. And as opposed to all the steps that a lot of people go through manually to do various things. So yeah, cool. Definitely neat. All right.
00:10:50.040 -->
00:10:54.480Gwen, you got the next one, something kind of in the news these days.
00:10:54.480 -->
00:10:55.160Yes.
00:10:55.160 -->
00:11:09.360So this kind of fit in with, you know, everything that's going on Reddit and the news and everything. So blockchains, I think most of you have heard of blockchains and Bitcoin and Ethereum.
00:11:09.360 -->
00:11:29.500And there are ways to basically build applications for the blockchain using Python. So for example, web3.py is a popular library where you can interact with the Ethereum blockchain via a Python API.
00:11:30.280 -->
00:11:38.700So it's basically a wrapper that it gives you. And there's also a similar language to Python that was built for the Ethereum blockchain.
00:11:38.700 -->
00:11:45.600It's called Viper. So it's kind of a Python, get it? Python and Viper, they're both snakes.
00:11:45.600 -->
00:11:59.980But it's basically a Pythonic language. So you can actually write these smart contracts or applications for the blockchain in that language or in Solidity or, you know, some other language.
00:11:59.980 -->
00:12:00.560Yeah.
00:12:00.560 -->
00:12:12.060And you can deploy your applications to the blockchain and then you can interact with them or interact with any general blockchain information using Python with web3.py.
00:12:12.060 -->
00:12:28.800So it's a really robust library and solution. And especially with, you know, NFTs or non-fungible tokens and things like that being so big right now, you know, using web3.py,
00:12:28.800 -->
00:12:37.640you can also interact with those types of contracts that you deploy to the blockchain and build applications for people as well and for users.
00:12:37.640 -->
00:12:44.200Oh, this is really cool. You know, I haven't done nothing with the blockchain and nothing with cryptocurrency.
00:12:44.200 -->
00:12:52.100So Ethereum, is this more, this is more a blockchain thing, not a cryptocurrency thing? What's the distinction there or is it not?
00:12:52.600 -->
00:13:03.440So cryptocurrencies, basically, they're built on the blockchain, right? Or some other type of post-blockchain technology, which evolved from blockchain.
00:13:03.440 -->
00:13:14.060So you can use this to interact with cryptocurrencies.
00:13:14.060 -->
00:13:23.440So you can use this to interact with these. But you can also build really any type of application on the blockchain and use web3.py to interact with it.
00:13:23.440 -->
00:13:31.700Whether it's a voting application or some kind of exchange or whatever you want to do on the blockchain.
00:13:32.060 -->
00:13:35.680You will have the API interface with web3.py.
00:13:35.680 -->
00:13:44.360I just bring up non-fungible tokens because of all the artwork and, you know, all the hype around, what was it, Dogecoin.
00:13:44.360 -->
00:13:45.060Yeah.
00:13:45.060 -->
00:13:45.920And all of that stuff.
00:13:45.920 -->
00:13:50.040So you could have taken a screenshot of Brian and we can make it a non-fungible token and sell him.
00:13:50.040 -->
00:13:52.320What do you think we could get from Brian?
00:13:52.320 -->
00:13:58.240We could take multiple screenshots and just, you know, sell like hundreds of them.
00:13:58.240 -->
00:13:59.300Yes, exactly.
00:13:59.300 -->
00:14:03.500Yeah, I think the non-fungible token stuff is, it's really interesting.
00:14:03.500 -->
00:14:05.100It's really far out there.
00:14:05.100 -->
00:14:10.240But the blockchain seems to be the most concrete, practical, you know, you could build stuff.
00:14:10.240 -->
00:14:15.320Like you mentioned voting and other stuff, I could certainly see if the world could ever get it together.
00:14:15.320 -->
00:14:19.500Some kind of voting, online voting system based on the blockchain.
00:14:19.500 -->
00:14:20.220Yeah.
00:14:20.220 -->
00:14:30.340And some places, some organizations, and also I believe some countries and localities are already using the blockchain for things like that.
00:14:30.340 -->
00:14:30.980Nice.
00:14:30.980 -->
00:14:34.080I think it's even being talked about in our own government.
00:14:34.080 -->
00:14:47.220They have some committees that are talking about using blockchain in different ways, of course, with securities and how it's going to affect securities, but also with other possible future use cases, like things like voting.
00:14:47.220 -->
00:14:47.940Awesome.
00:14:47.940 -->
00:14:57.160Yeah, I'm going to have a woman from the FEC, Federal Election Commission, on Talk Python to talk about using Python for the FEC.
00:14:57.160 -->
00:15:00.480And I feel like we definitely got to talk about blockchain.
00:15:00.480 -->
00:15:01.020That's interesting.
00:15:01.020 -->
00:15:02.180Yeah, that'll be fun.
00:15:02.460 -->
00:15:05.880Man, you get some cool hosts or guests on your show.
00:15:05.880 -->
00:15:06.420That's great.
00:15:06.420 -->
00:15:07.500Thanks.
00:15:07.500 -->
00:15:08.140Thanks.
00:15:08.140 -->
00:15:19.960Yeah, so I'm really excited with where blockchain is going, you know, being used in supply chain, in refugee camps, in pretty much every major bank now.
00:15:19.960 -->
00:15:22.340Every country is looking into blockchain.
00:15:22.340 -->
00:15:24.600So I think it's a really good thing to get on board with.
00:15:24.600 -->
00:15:30.200And Python is a really easy entry way to prototype anything in Python.
00:15:30.200 -->
00:15:38.720So you'll see a lot of people want to find out about blockchain, like their own test blockchain in Python to understand it.
00:15:38.720 -->
00:15:45.220But there are also libraries where you can interact with real blockchains like Hyperledger SDKs in Python.
00:15:45.220 -->
00:15:52.180So you can use different kinds of popular blockchains or the most popular blockchain now, which is Ethereum.
00:15:52.460 -->
00:15:55.380So you can interact with that via Web3.py.
00:15:55.380 -->
00:15:55.860Yeah.
00:15:55.860 -->
00:15:56.840Okay, cool.
00:15:56.840 -->
00:15:59.440If people want to check it out, this is a great recommendation.
00:15:59.440 -->
00:16:03.160Quick question from or comment from the live show.
00:16:03.160 -->
00:16:06.540Tune Army Captain says, at what point does this become about monetizing?
00:16:06.540 -->
00:16:08.020Orcruxes.
00:16:08.020 -->
00:16:09.360Orcruxes, yes.
00:16:09.360 -->
00:16:10.020Orcruxes.
00:16:10.020 -->
00:16:10.720Brian, help me out here.
00:16:12.820 -->
00:16:14.360I think so.
00:16:14.360 -->
00:16:14.860Yeah.
00:16:14.860 -->
00:16:15.540Today.
00:16:15.540 -->
00:16:17.080It's gotten there today.
00:16:17.080 -->
00:16:17.820Absolutely.
00:16:17.820 -->
00:16:18.760All right.
00:16:18.760 -->
00:16:21.320Well, very cool, very cool recommendation.
00:16:21.320 -->
00:16:23.160What's the next one that you got here, Brian?
00:16:23.160 -->
00:16:23.840I checked this out.
00:16:23.840 -->
00:16:24.980I'm super excited about this.
00:16:24.980 -->
00:16:26.740This is a great idea.
00:16:26.740 -->
00:16:27.300Yeah.
00:16:27.300 -->
00:16:32.620So this was a recommendation from Johannes Lippmann.
00:16:32.620 -->
00:16:39.000He mentioned in episode 227, we talked about Snyk.
00:16:39.000 -->
00:16:39.420Snyk?
00:16:39.420 -->
00:16:40.240S-N-Y-K.
00:16:40.240 -->
00:16:41.360Snyk.
00:16:41.360 -->
00:16:42.060Snyk.
00:16:42.060 -->
00:16:42.260Snyk.
00:16:42.620 -->
00:16:44.480Snyk Package Advisor, I think it was.
00:16:44.480 -->
00:16:45.260Yeah.
00:16:45.260 -->
00:16:51.000It tells you how, it gives you a health recommendation or health score on any package,
00:16:51.000 -->
00:16:52.580Python package.
00:16:52.580 -->
00:16:56.000Well, this is a similar, well, it's not really similar.
00:16:56.000 -->
00:16:57.840It's, I guess, in the same category.
00:16:57.840 -->
00:16:59.460So dead dependency.
00:16:59.460 -->
00:17:02.340So D-E-A-D-Pendency.
00:17:02.340 -->
00:17:08.440So this is a tool that's got, there's a paid version, but it's free for open source projects.
00:17:09.040 -->
00:17:14.100And it's a GitHub thing or GitHub application that you plug in.
00:17:14.100 -->
00:17:14.780Yeah, GitHub app.
00:17:14.780 -->
00:17:15.040Yeah.
00:17:15.580 -->
00:17:19.020And what it does is it looks at your dependencies.
00:17:19.020 -->
00:17:25.560And so if you, and it looks at the, it looks at a lot of stuff and it looks at, so let's,
00:17:25.560 -->
00:17:27.400I'm just going to bring up an example.
00:17:27.400 -->
00:17:34.580Somebody who wants to add some functionality to your service and they, or your project, they
00:17:34.580 -->
00:17:37.020change it to, and it adds a dependency.
00:17:37.660 -->
00:17:43.460One of the things you'll see in the pull request, if you use, if you use this is a dead dependency.
00:17:43.460 -->
00:17:46.900We'll go out and look to see how healthy that dependency is.
00:17:46.900 -->
00:17:48.320So you've got a new one in there.
00:17:48.320 -->
00:17:55.020And, and it's got a whole bunch of configurable options that I really think are pretty cool.
00:17:55.720 -->
00:18:02.340It checks for things like how recent was, wanted to make sure that there's recent, recent releases, recent commits.
00:18:02.340 -->
00:18:04.580And they're pretty broad.
00:18:04.580 -->
00:18:09.380The defaults are like, has there been a commit in the last 12 months?
00:18:09.380 -->
00:18:10.820Yeah.
00:18:10.820 -->
00:18:13.140Can you scroll down just like one page to the jQuery example?
00:18:13.140 -->
00:18:13.960Yeah.
00:18:13.960 -->
00:18:14.480Okay.
00:18:14.480 -->
00:18:14.580Yeah.
00:18:14.580 -->
00:18:15.760That's a great example right there.
00:18:15.760 -->
00:18:16.480Yeah.
00:18:16.940 -->
00:18:21.580So the, one of the, their example is you've got a jQuery UI that's added.
00:18:21.580 -->
00:18:25.400And what it does is it doesn't just check for one thing.
00:18:25.400 -->
00:18:30.580It looks for all of your dependencies and it shows that, you know, a couple like jQuery UI
00:18:30.580 -->
00:18:33.140hasn't been released for over 12 months.
00:18:33.140 -->
00:18:39.420And then a package called nom nom that's no commits for the last nine months.
00:18:39.420 -->
00:18:42.620And it's been deprecated in the package registry.
00:18:43.120 -->
00:18:49.740So it checks for deprecations and, and, and also things like, yeah, if it's been deprecated
00:18:49.740 -->
00:18:54.840or if there's just, it's gone down to a single author, maybe that might be at risk for some
00:18:54.840 -->
00:18:55.320projects.
00:18:55.320 -->
00:18:57.140So, but all of it's configurable.
00:18:57.140 -->
00:18:58.320So this is pretty neat.
00:18:58.320 -->
00:18:58.920Yeah.
00:18:58.920 -->
00:18:59.640I love the idea.
00:18:59.640 -->
00:19:05.900And it works not just for Python or as JavaScript as you mentioned, but also Rust, Ruby, C#,
00:19:05.900 -->
00:19:07.160Kotlin, a bunch of stuff.
00:19:07.160 -->
00:19:07.700Yep.
00:19:07.700 -->
00:19:13.080There are some, I tried it out and I couldn't get it to work, but I know why I couldn't get
00:19:13.080 -->
00:19:13.520it to work.
00:19:13.520 -->
00:19:16.880I'm using Flit now.
00:19:16.880 -->
00:19:21.220So I'm using pyproject.toml for my dependencies and stuff in my projects.
00:19:21.220 -->
00:19:23.140And this doesn't support it yet.
00:19:23.140 -->
00:19:25.980It supports requirements.txt and pip file.
00:19:25.980 -->
00:19:30.660And last night I was playing with it and I sent him an email and said, it'd be really great
00:19:30.660 -->
00:19:33.820if it would support setup.py and pyproject.toml.
00:19:33.820 -->
00:19:38.200And gosh, within an hour, I got a response back and said, yeah, you're right.
00:19:38.200 -->
00:19:40.160We should do pyproject.toml.
00:19:40.860 -->
00:19:43.120It's a simple format and we'll try to support it.
00:19:43.120 -->
00:19:50.480But setup.py, a little more difficult because as we know, setup.py has no real restrictions
00:19:50.480 -->
00:19:51.460on its formatting.
00:19:51.460 -->
00:19:54.420So there's a lot of crazy stuff out there for that.
00:19:54.820 -->
00:19:56.000Yeah, for sure.
00:19:56.000 -->
00:19:57.540Quinn, what do you think?
00:19:57.540 -->
00:20:02.440Yeah, I was just going to say I was going to try this out on a project, but I also use
00:20:02.440 -->
00:20:02.880poetry.
00:20:02.880 -->
00:20:06.820So I use pyproject.toml for the dependencies.
00:20:06.820 -->
00:20:10.120But like you said, it's an easy format.
00:20:10.120 -->
00:20:13.540So maybe if they support it soon, I'll try this out.
00:20:13.540 -->
00:20:15.320It seems like a really good idea.
00:20:15.800 -->
00:20:17.280Yeah, it's fairly new too.
00:20:17.280 -->
00:20:18.940It looks really slick.
00:20:18.940 -->
00:20:20.700Their website's all nice and great.
00:20:20.700 -->
00:20:22.100And I'm like, oh, they must have been up for a while.
00:20:22.100 -->
00:20:27.880As far as I can tell, it looks like at least their defect tracker, they've got a GitHub defect
00:20:27.880 -->
00:20:31.300tracker that's only been alive since last September.
00:20:31.300 -->
00:20:34.620And they already support a whole bunch of stuff.
00:20:34.620 -->
00:20:36.960So hopefully we'll get some new features here soon.
00:20:36.960 -->
00:20:37.920Yeah, fantastic.
00:20:38.080 -->
00:20:40.060And I just came up with a new idea for a GitHub bot.
00:20:40.060 -->
00:20:46.300So you have a GitHub bot that if you put a pyproject.toml or a pip file, it'll automatically
00:20:46.300 -->
00:20:48.520create the others and keep them in sync.
00:20:48.520 -->
00:20:53.620So if you check in your pyproject.toml, it'll automatically generate a requirements.txt that's
00:20:53.620 -->
00:20:53.980in sync.
00:20:53.980 -->
00:20:55.840And if you make changes, it'll update it.
00:20:55.840 -->
00:20:58.420And so you can work with whatever tools you want.
00:20:58.420 -->
00:21:00.320That's my new idea.
00:21:00.320 -->
00:21:06.680Isn't everything switching over to pyproject.toml now, though?
00:21:06.680 -->
00:21:09.620Well, for packages, it's not everything is.
00:21:09.620 -->
00:21:12.420A setup is going to be supported for a long time.
00:21:12.420 -->
00:21:15.640But you can use setup tools with pyproject.toml.
00:21:15.640 -->
00:21:17.760So there is a lot of people converting.
00:21:17.760 -->
00:21:21.060But that's for packages and stuff and libraries.
00:21:21.060 -->
00:21:24.280A lot of applications don't use anything like that.
00:21:24.280 -->
00:21:26.380They just use a requirements file.
00:21:26.380 -->
00:21:29.320Yeah, I used to use a requirements file.
00:21:29.320 -->
00:21:32.340And then I switched to using poetry like a year ago.
00:21:32.340 -->
00:21:34.120And I was like, what have I been doing all this time?
00:21:34.120 -->
00:21:35.480So much nicer.
00:21:35.480 -->
00:21:36.500Yeah, poetry is nice.
00:21:36.860 -->
00:21:37.200Very cool.
00:21:37.200 -->
00:21:37.820Yeah.
00:21:37.820 -->
00:21:43.540Speaking of switching to new things, I wanted to talk about all the important changes and
00:21:43.540 -->
00:21:45.180features in Python 3.10.
00:21:45.180 -->
00:21:46.500So excited.
00:21:46.500 -->
00:21:47.480So exciting.
00:21:47.480 -->
00:21:47.680Yeah.
00:21:47.740 -->
00:21:52.120So this is a blog post by Martin Hines.
00:21:52.120 -->
00:21:54.480Apparently, blog post number 47.
00:21:54.480 -->
00:21:56.040Look at the URL here, which is interesting.
00:21:56.040 -->
00:22:01.140And basically what it does, it just walks you through all the stuff coming in Python 3.10.
00:22:01.140 -->
00:22:04.020So Python 3.10 has been in alpha for a little while.
00:22:04.020 -->
00:22:05.600That means features changing.
00:22:05.600 -->
00:22:06.780But now it's about to go beta.
00:22:06.900 -->
00:22:07.780So it's about to stabilize.
00:22:07.780 -->
00:22:12.700And it's time to start thinking about what features are coming because they're most likely
00:22:12.700 -->
00:22:14.560going to be fixed as they are.
00:22:14.560 -->
00:22:20.000First thing it talks about is how to go through installing the alpha or the beta, whatever the
00:22:20.000 -->
00:22:21.180latest version is.
00:22:21.320 -->
00:22:22.360It's pretty simple.
00:22:22.360 -->
00:22:26.800So you just do the, you know, download and install from source, except for it has this
00:22:26.800 -->
00:22:29.060comment to say make install.
00:22:29.060 -->
00:22:33.000You're welcome to run make install, but that will make your Python 3 and your system be
00:22:33.000 -->
00:22:36.340the alpha Python 3.10, which you might not want to do.
00:22:36.680 -->
00:22:37.860I mean, you may, but you might not.
00:22:37.860 -->
00:22:43.540If you say make alt, A-L-T install, alt install is one word, then it'll just install it.
00:22:43.540 -->
00:22:48.240So you can refer to it as Python 3.10, but it won't replace your system Python, which I
00:22:48.240 -->
00:22:48.660would recommend.
00:22:48.660 -->
00:22:52.480So there's some interesting improvements for type checking.
00:22:52.480 -->
00:22:56.860One of the things that's really nice about Python is you have this optional type hint type
00:22:56.860 -->
00:23:03.220checking, type hint type annotation stuff, but it can get kind of crazy with the generics.
00:23:03.220 -->
00:23:09.080Like if I have a generator that returns a list of integer, I mean, it's just like the way
00:23:09.080 -->
00:23:15.760you express that and kind of almost like generic syntax, like generic from C++ style, it gets
00:23:15.760 -->
00:23:16.480a little wild.
00:23:16.480 -->
00:23:20.980So one of the improvements is around union because you can say, well, this thing will either take
00:23:20.980 -->
00:23:24.900an int or a float and I can just deal with it as basically a number.
00:23:24.900 -->
00:23:31.840So you used to have to say from typing import union, and then you would say union bracket
00:23:31.840 -->
00:23:33.520int comma float bracket.
00:23:33.520 -->
00:23:34.820And that was the thing.
00:23:34.820 -->
00:23:39.120So now you can just use the pipe or the or the bitwise or operator.
00:23:39.120 -->
00:23:41.940So int or vertical pipe float.
00:23:41.940 -->
00:23:44.020And that tells you it's a int or a float.
00:23:44.020 -->
00:23:44.960What do you think of this?
00:23:44.960 -->
00:23:46.120You'll like it?
00:23:46.120 -->
00:23:47.180I think it's nice.
00:23:47.180 -->
00:23:48.580That seems cleaner to me.
00:23:48.580 -->
00:23:49.040Yeah.
00:23:49.040 -->
00:23:50.540Wonky.
00:23:50.540 -->
00:23:51.160Yeah.
00:23:51.160 -->
00:23:52.340I didn't like the union before.
00:23:52.340 -->
00:23:57.100I mean, I was glad it was there because we needed it, but the or makes it nice and clean.
00:23:57.520 -->
00:23:57.660Yeah.
00:23:57.660 -->
00:24:00.820I almost never used the union because it was just, it was just messy.
00:24:00.820 -->
00:24:02.200Anyway, this is pretty nice.
00:24:02.200 -->
00:24:06.620There's also some stuff about is instance and is instance.
00:24:06.620 -->
00:24:11.940So you can, you know, that exists already, but you can pass this int or string, you know,
00:24:11.940 -->
00:24:16.480int pipe string in, and it'll tell you if it's either an int or a string as an instance,
00:24:16.480 -->
00:24:18.180which is kind of a cool thing as well.
00:24:18.180 -->
00:24:18.920Oh, wow.
00:24:19.280 -->
00:24:19.500Yeah.
00:24:19.500 -->
00:24:23.320You can also create type aliases and you could do that previously.
00:24:23.320 -->
00:24:27.080So if I have a thing, I want to call a file name and right now it's a string, but maybe
00:24:27.080 -->
00:24:30.060it becomes a class later because we're going to upgrade it.
00:24:30.060 -->
00:24:33.580And I just want to refer to it as this right now as a file name, right?
00:24:33.580 -->
00:24:37.260So you used to say file name equals str, S-T-R.
00:24:37.260 -->
00:24:39.540And there's no real way to understand that.
00:24:39.540 -->
00:24:44.520I'm just, I'm trying to create a type definition, but in fact, it just tells me, well, there's
00:24:44.520 -->
00:24:46.720this other name for the string class, right?
00:24:46.720 -->
00:24:51.320And that worked, but there was no way for the tools to know what your intention was.
00:24:51.320 -->
00:24:55.540So now there's going to be a file name colon type alias equals string.
00:24:55.540 -->
00:25:00.840And that will tell you file name is an actual alias for the class string, not just it happens
00:25:00.840 -->
00:25:02.520to be a thing that looks a whole lot like it.
00:25:02.520 -->
00:25:03.180So that's kind of cool.
00:25:03.180 -->
00:25:09.140There's some stuff about knowing on integers to figure out how many bits are involved.
00:25:09.140 -->
00:25:11.420That's not super applicable or usable.
00:25:11.420 -->
00:25:16.500Disky tools, speaking, I mean, you may want to know, but it's like not, I doubt it's a big
00:25:16.500 -->
00:25:16.840question.
00:25:16.840 -->
00:25:17.720People want to know often.
00:25:17.720 -->
00:25:23.280Disk details are being deprecated and they've pretty much been deprecated for a while and
00:25:23.280 -->
00:25:25.760you should be using setup tools and packaging.
00:25:25.760 -->
00:25:30.980But, you know, they were officially deprecated in 3.10 and will be gone in 3.12, just so you
00:25:30.980 -->
00:25:31.240all know.
00:25:31.240 -->
00:25:33.780This next one I'm excited about quite a bit.
00:25:33.780 -->
00:25:40.680It's super common to want to have more than one thing that is tied to a context block, like
00:25:40.680 -->
00:25:41.600a with statement.
00:25:42.060 -->
00:25:46.660So if I'm going to open two files and I want to make sure I close them both, even if there's
00:25:46.660 -->
00:25:51.220an error, it would make a lot of sense to say with file one, with file two.
00:25:51.220 -->
00:25:52.640And so what were your options?
00:25:52.640 -->
00:25:56.620You could have one with block and then indent another one just to have the second file, which
00:25:56.620 -->
00:25:57.060is weird.
00:25:57.060 -->
00:26:03.040You could create the files separately, the file object separately and say with file one, comma
00:26:03.040 -->
00:26:04.340file two, and then use them.
00:26:04.340 -->
00:26:05.120That actually worked.
00:26:05.400 -->
00:26:10.260But what if file two crashed when you tried to create it, then file one would leak?
00:26:10.260 -->
00:26:12.040And there's just like all these weird situations.
00:26:12.040 -->
00:26:16.440So now with blocks support multiple lines with parentheses.
00:26:16.440 -->
00:26:21.480So I can say with parentheses thing one that has to be managed in the context thing two that
00:26:21.480 -->
00:26:24.300has to be managed in the context and so on, and then work with them.
00:26:24.300 -->
00:26:26.680And they're treated as a block, which I think is sweet.
00:26:27.100 -->
00:26:31.220That's going to be very useful because I've had times where we've had two or three levels
00:26:31.220 -->
00:26:32.180all the time.
00:26:32.180 -->
00:26:33.000So yeah.
00:26:33.000 -->
00:26:33.600Yeah.
00:26:33.600 -->
00:26:37.160So you're usually juggling some edge case that might not quite work, but usually works.
00:26:37.160 -->
00:26:40.100And this is just make it part of the language, make sure it always works.
00:26:40.100 -->
00:26:40.640I love it.
00:26:40.640 -->
00:26:42.340Also a performance.
00:26:42.340 -->
00:26:49.300So it brings some performance improvements for constructors like strings, bytes, byte arrays,
00:26:49.300 -->
00:26:50.020and so on.
00:26:50.020 -->
00:26:55.980And then also working with functions that have type annotations, I think are something
00:26:55.980 -->
00:26:57.000like two times faster.
00:26:57.000 -->
00:27:02.340They are now the type annotations are evaluated at compilation time.
00:27:02.340 -->
00:27:05.680They are evaluated at runtime, which would slow them down.
00:27:05.680 -->
00:27:06.540So that's nice.
00:27:06.540 -->
00:27:11.380And then the big one is the switch statement, which we're not calling switch statement.
00:27:11.380 -->
00:27:12.180It's pattern matching.
00:27:12.180 -->
00:27:15.000And we actually talked a lot with Brett Cannon about that.
00:27:15.000 -->
00:27:18.280And I think people appreciated that episode where we got to dig into that, right?
00:27:18.280 -->
00:27:18.840Yeah.
00:27:18.840 -->
00:27:19.840Yeah, that was fun.
00:27:19.840 -->
00:27:24.500So there's some nice examples of what you can do, like basically how it works, you know,
00:27:24.500 -->
00:27:29.300match on day, case Monday, case Friday, case Saturday or Sunday, and so on.
00:27:29.300 -->
00:27:35.040And then some more interesting ones about matching objects like classes where you're looking at
00:27:35.040 -->
00:27:35.820multiple fields.
00:27:35.820 -->
00:27:40.740So you can match on age and you could match on gender.
00:27:40.740 -->
00:27:45.080This is like a person example, name, age, gender, and you could match on different things.
00:27:45.080 -->
00:27:48.200And depending on how it matches, you kind of fall into these case statements.
00:27:48.200 -->
00:27:49.720So we've gone over that a lot.
00:27:49.720 -->
00:27:54.060I don't want to dive into it too much, but pretty neat to see these examples here.
00:27:54.060 -->
00:27:56.420So that's, I would say that's the big change that's coming.
00:27:56.420 -->
00:27:57.660Don't know what you two think.
00:27:57.660 -->
00:28:00.860Do the case statements fall through like JavaScript?
00:28:00.860 -->
00:28:02.600There is a fall through.
00:28:02.600 -->
00:28:05.860It's not in these examples, but there is a fall through mechanism.
00:28:05.860 -->
00:28:06.580Okay.
00:28:06.580 -->
00:28:07.900But not by default.
00:28:08.340 -->
00:28:11.600Well, it's not called default, but I think there is, I can't remember the syntax.
00:28:11.600 -->
00:28:15.940Oh, I mean like, so from the first case.
00:28:15.940 -->
00:28:16.800Oh, right.
00:28:16.800 -->
00:28:17.080Yeah.
00:28:17.080 -->
00:28:17.400Yeah.
00:28:17.400 -->
00:28:18.560You don't have to say break.
00:28:18.560 -->
00:28:19.600I don't think it falls through.
00:28:19.600 -->
00:28:20.140Yeah.
00:28:20.140 -->
00:28:20.820It doesn't fall through.
00:28:20.820 -->
00:28:21.380Yeah.
00:28:21.380 -->
00:28:21.940Yeah.
00:28:21.940 -->
00:28:26.240Because in C++, if you don't say break, you're going to print all, it's going to run every
00:28:26.240 -->
00:28:27.400case top to bottom, right?
00:28:27.400 -->
00:28:30.820Well, depending where it matches, from where it matches onward, basically.
00:28:30.820 -->
00:28:31.240Yeah.
00:28:31.240 -->
00:28:33.800No, I don't think it falls through in that sense.
00:28:33.800 -->
00:28:36.140But there's a default.
00:28:36.300 -->
00:28:43.680But the fall through mechanism in C++ and C and Java, other type language, C-like languages,
00:28:43.680 -->
00:28:46.740it's caused me more problems than it ever solved.
00:28:46.740 -->
00:28:49.480I mean, I've actually wanted it to fall through.
00:28:49.480 -->
00:28:54.420I'd rather have a fall through keyword than have it have to put a break everywhere.
00:28:54.420 -->
00:28:55.080Yeah.
00:28:55.080 -->
00:28:55.860I agree.
00:28:55.860 -->
00:28:56.100Yeah.
00:28:56.100 -->
00:28:57.900I just use my go-to statements and we're good.
00:28:57.900 -->
00:28:58.780So, it's still fine.
00:28:58.780 -->
00:29:05.380Dean out there in the live stream says, can't wait for 310 now with a double context or multi-line
00:29:05.380 -->
00:29:05.780context.
00:29:05.780 -->
00:29:06.280I agree.
00:29:06.280 -->
00:29:09.000Those are quite awesome.
00:29:09.000 -->
00:29:10.320I think that's a really good feature.
00:29:10.320 -->
00:29:11.280And it's super simple.
00:29:11.280 -->
00:29:12.760So, I like that a lot.
00:29:12.760 -->
00:29:14.320I wanted to add a couple things.
00:29:14.320 -->
00:29:25.160I just found out today that one of the things that's going in 310 is some better error messages
00:29:25.160 -->
00:29:34.200if you use an attribute error, if you try to access from name tuple import something else.
00:29:34.200 -->
00:29:35.200And you get something wrong.
00:29:35.200 -->
00:29:36.120And you get something wrong.
00:29:36.120 -->
00:29:40.080It tries to give you a suggestion for what the right thing is.
00:29:40.200 -->
00:29:44.580And that'll be really cool, especially for working on the REPL and stuff.
00:29:44.580 -->
00:29:49.740And I also wanted to point out that I don't think I would build Python.
00:29:49.740 -->
00:29:51.300I would just download it.
00:29:51.300 -->
00:29:57.920If you Google Python 310 download, you can get it just from Python.org.
00:29:57.920 -->
00:29:59.360You can download it there.
00:29:59.580 -->
00:30:00.660Without compiling it?
00:30:00.660 -->
00:30:01.160Yeah.
00:30:01.160 -->
00:30:02.200It's just the installer.
00:30:02.200 -->
00:30:03.600I'll put a link in the show notes.
00:30:03.600 -->
00:30:04.240Yeah.
00:30:04.240 -->
00:30:05.660Or use PyEv.
00:30:05.660 -->
00:30:06.860Yeah, PyEv.
00:30:06.860 -->
00:30:07.360Right.
00:30:07.360 -->
00:30:07.540Yeah.
00:30:07.540 -->
00:30:08.160You can use PyEv.
00:30:08.160 -->
00:30:08.380Yeah.
00:30:08.380 -->
00:30:08.760Sure.
00:30:08.760 -->
00:30:09.300Cool.
00:30:09.800 -->
00:30:10.260All right.
00:30:10.260 -->
00:30:14.980Well, that brings us to the next item, but I don't have the link to it.
00:30:14.980 -->
00:30:15.820That's yours, Glenn.
00:30:15.820 -->
00:30:16.880So you want to tell us about it?
00:30:16.880 -->
00:30:18.220I think I can just Google it.
00:30:18.220 -->
00:30:19.460I'm not going to Google it.
00:30:19.460 -->
00:30:20.860I'm going to DuckDuckGo, but carry on.
00:30:20.860 -->
00:30:21.320Good.
00:30:21.320 -->
00:30:22.660I use DuckDuckGo too.
00:30:22.660 -->
00:30:23.380Nice.
00:30:23.760 -->
00:30:29.040So yeah, I wanted to give a shout out to FreeCodeCamp's Python curriculum.
00:30:29.040 -->
00:30:37.140So last year, they launched a Python curriculum with, I think it's almost a thousand hours of
00:30:37.140 -->
00:30:47.980curriculum material between challenges, lessons, and of course, projects and certifications as
00:30:47.980 -->
00:30:54.500well on topics from Python basics to data science, machine learning, algorithms, all sorts of things.
00:30:54.500 -->
00:31:00.800And that's in addition to the thousands of hours they already had learning JavaScript and basic
00:31:00.800 -->
00:31:04.500programming skills and algorithms and other types of things.
00:31:04.500 -->
00:31:08.080So that Python curriculum was in the works for a few years.
00:31:08.080 -->
00:31:12.740I've been a top contributor with FreeCodeCamp for a couple of years.
00:31:12.740 -->
00:31:16.060So I got to go to their summit before the whole COVID thing hit.
00:31:16.860 -->
00:31:22.680And I remember everyone getting together, kind of talking excitedly several years ago about Python
00:31:22.680 -->
00:31:23.240coming out.
00:31:23.240 -->
00:31:25.940So it was definitely in the works for a long time.
00:31:25.940 -->
00:31:28.280And a lot of people put a lot of effort into it.
00:31:28.280 -->
00:31:30.540So I think it's a really good curriculum.
00:31:30.540 -->
00:31:38.020And FreeCodeCamp has also done a really good job of putting out a lot of supplementary material
00:31:38.020 -->
00:31:39.560in Python and data science.
00:31:39.560 -->
00:31:46.420So you can see on their YouTube channel, I believe they have over 100 hours of Python content,
00:31:46.740 -->
00:31:52.360including this one 12-hour Python data science crash course on their YouTube channel.
00:31:52.360 -->
00:31:57.260And they also have one of the most popular developer blogs on the internet.
00:31:57.260 -->
00:31:58.780I'm also a writer for them.
00:31:58.780 -->
00:32:06.120So recently I wrote one Django article and I have a whole bunch more Django articles that I'm
00:32:06.120 -->
00:32:08.000planning to write when I get around to it.
00:32:08.000 -->
00:32:17.940So as far as Python education, I think this is a really good option that's free, accessible
00:32:17.940 -->
00:32:20.120to anybody, even on mobile devices.
00:32:20.120 -->
00:32:22.800And one that stayed true to its mission.
00:32:22.800 -->
00:32:25.620It didn't just build to kind of sell out to another company.
00:32:25.620 -->
00:32:33.620But since I believe the end of 2014, when it's launched, it's kept this mission of making coding
00:32:33.620 -->
00:32:35.360education accessible to everyone.
00:32:35.360 -->
00:32:40.680So I think they've done a really good comprehensive job of now adding Python onto that.
00:32:40.680 -->
00:32:42.440Oh, and they're also adding on...
00:32:42.440 -->
00:32:51.240Right now they're working on an even bigger expanded curriculum for that data science and machine
00:32:51.240 -->
00:32:52.680learning that they have right now in Python.
00:32:52.680 -->
00:32:59.440It's going to include all the different math and a lot more elements of machine learning than
00:32:59.440 -->
00:33:00.360it currently covers.
00:33:00.360 -->
00:33:02.540So yeah, I'm excited for that.
00:33:02.540 -->
00:33:06.540They were raising money for it this year and they've been working on it since last year.
00:33:07.020 -->
00:33:11.540So I'm hoping we'll see at least the initial stages of that soon.
00:33:11.540 -->
00:33:12.860Yeah, very cool.
00:33:12.860 -->
00:33:14.500I put my...
00:33:14.500 -->
00:33:18.560I worked with them to put my free MongoDB course up there, which is a Python course.
00:33:18.560 -->
00:33:19.480Oh, awesome.
00:33:19.480 -->
00:33:20.760A little bit up there, yeah.
00:33:20.760 -->
00:33:23.360What were you using with MongoDB?
00:33:23.360 -->
00:33:25.400It was just some...
00:33:25.400 -->
00:33:26.820It wasn't even a real web framework.
00:33:26.820 -->
00:33:31.880It was something that kind of was just a simple CLI app that talked to it to keep it not complex.
00:33:31.880 -->
00:33:32.800Oh, okay.
00:33:32.800 -->
00:33:33.380Yeah.
00:33:33.380 -->
00:33:34.240Very cool.
00:33:34.700 -->
00:33:38.240I've been using Django for Django and MongoDB.
00:33:38.240 -->
00:33:39.940Okay, that's cool.
00:33:39.940 -->
00:33:44.960It actually works pretty well, except the migrations are a little bit funky.
00:33:44.960 -->
00:33:45.880Okay.
00:33:45.880 -->
00:33:51.320So it's not easy to roll back the migrations like it is if you use Postgres.
00:33:51.320 -->
00:33:56.060But overall, it works really well and you can use the same ORM in Django.
00:33:56.060 -->
00:33:57.200Oh, that's fantastic.
00:33:57.200 -->
00:34:04.160I use MongoEngine for my main stuff, which is very much modeled on Django, but it's not Django itself.
00:34:04.160 -->
00:34:04.640Yeah.
00:34:04.640 -->
00:34:05.300Nice.
00:34:05.300 -->
00:34:06.460Let's see.
00:34:06.460 -->
00:34:08.620Really quick, a couple of fallbacks.
00:34:08.620 -->
00:34:13.800Robert Robertson says they should create an error message package that breaks down your error into plain English.
00:34:13.800 -->
00:34:14.700That's a good idea.
00:34:14.700 -->
00:34:14.980Cool.
00:34:14.980 -->
00:34:16.040Yeah, that's a great idea.
00:34:16.040 -->
00:34:18.880And then Dean says there are third-party packages that do it nicely.
00:34:18.880 -->
00:34:20.320Brian, do you remember if we've covered any?
00:34:20.320 -->
00:34:20.720I don't.
00:34:20.720 -->
00:34:22.500I mean, Dean, if you've got some ideas, throw them out there.
00:34:22.520 -->
00:34:25.500I think we do, but I think we did cover them, but I don't remember them.
00:34:25.500 -->
00:34:32.080I know we've covered stuff that do things like pretty print the message or highlight certain parts so it's clearer.
00:34:32.160 -->
00:34:32.600Yeah.
00:34:32.600 -->
00:34:41.860But I feel like it would be cool if it would just print the first stack overflow response, accepted response underneath the crash.
00:34:41.860 -->
00:34:42.760That would be fantastic.
00:34:43.220 -->
00:34:54.200Well, and we talked about possibly just formatting your error message nicely so that you could Google it or duck-duck-go it of like how to search for this on the internet.
00:34:55.000 -->
00:34:57.640So, like escaping quotes and things like that.
00:34:57.640 -->
00:34:58.400Exactly.
00:34:58.400 -->
00:34:59.100That'd be cool.
00:34:59.100 -->
00:35:08.940Somebody else, let's see, PyLine mentioned, and I think this is right, that the fall-through on the pattern matching is the underscore.
00:35:08.940 -->
00:35:09.660I think that's correct.
00:35:09.660 -->
00:35:10.420Is that the default?
00:35:10.420 -->
00:35:12.380I think that's the default case, not the fall-through.
00:35:12.380 -->
00:35:13.100Is that right?
00:35:13.100 -->
00:35:13.360Right.
00:35:13.360 -->
00:35:13.780Right.
00:35:13.780 -->
00:35:15.200Not the fall-through, the default case.
00:35:15.200 -->
00:35:15.600Yeah.
00:35:15.600 -->
00:35:15.860Okay.
00:35:15.860 -->
00:35:16.340Thanks.
00:35:16.340 -->
00:35:19.600So, I don't think there is a way to, I don't know.
00:35:19.600 -->
00:35:20.780There might be a way to fall-through.
00:35:20.780 -->
00:35:23.100There's like always, yeah, I don't know.
00:35:23.100 -->
00:35:24.020I haven't played with it yet.
00:35:24.020 -->
00:35:24.500Yeah.
00:35:24.700 -->
00:35:27.840Dean points out that we covered the one that has, you can ask why.
00:35:27.840 -->
00:35:30.100Remember, you'd ask like why, what?
00:35:30.100 -->
00:35:40.320There's a bunch of Ws, and we're kind of coming up with the name of like a name for the better name or for another what we can ask, like WTF or something like that.
00:35:40.320 -->
00:35:41.760I don't remember what that's called, though, sadly.
00:35:41.760 -->
00:35:43.460That was a fun one.
00:35:43.460 -->
00:35:46.040Oh, that'd be a great package name, Python WTF.
00:35:46.040 -->
00:35:49.160All right, Brian, is that it for our main topics?
00:35:49.160 -->
00:35:49.900Yeah.
00:35:49.900 -->
00:35:50.480Yeah.
00:35:50.480 -->
00:35:51.160All right.
00:35:51.160 -->
00:35:52.840You got any extras you want to cover?
00:35:52.840 -->
00:35:53.200Yeah.
00:35:53.460 -->
00:35:55.380I do, as always, but yeah, how about you?
00:35:55.380 -->
00:35:59.460Well, I don't know when it'll get released, but I just recorded it.
00:35:59.460 -->
00:36:06.660But a few episodes ago, we talked about Python Adventure, so an adventure game, a text-based adventure in Python.
00:36:06.660 -->
00:36:07.740Yeah, there's Python.
00:36:08.300 -->
00:36:15.260Yeah, I got to talk to the creator on the testing code, so there'll be an upcoming testing code.
00:36:15.260 -->
00:36:17.840I'll go in-depth into that, so that'll be good.
00:36:17.840 -->
00:36:18.980Yeah, yeah, very fun.
00:36:18.980 -->
00:36:20.320How about you?
00:36:20.320 -->
00:36:21.560Let's see.
00:36:21.560 -->
00:36:22.440I got a couple things.
00:36:22.900 -->
00:36:24.520Let's see this one.
00:36:24.520 -->
00:36:29.960We talked about the Supreme Court ruling on Java, the Google versus Oracle.
00:36:29.960 -->
00:36:32.980Maybe for the Oracle versus Google is maybe how it should be said.
00:36:32.980 -->
00:36:38.880But I think it's just, in passing, interesting that Microsoft has now unveiled its own Java distribution,
00:36:38.880 -->
00:36:44.380the Microsoft version of OpenJDK, to compete with Oracle in the Java distribution space.
00:36:44.900 -->
00:36:53.760I know that we're not really a Java podcast, for sure, and I don't do any Java, but I think it's an interesting open source follow-on to covering that last time.
00:36:53.760 -->
00:36:54.340What do you think?
00:36:54.340 -->
00:36:57.820I think this is going to be big.
00:36:57.820 -->
00:37:01.380A lot of people already have Microsoft distributions all over their workplace.
00:37:01.380 -->
00:37:02.180Yeah.
00:37:02.180 -->
00:37:02.740Gwen?
00:37:02.740 -->
00:37:03.540Yes.
00:37:03.540 -->
00:37:04.360Any comments?
00:37:04.360 -->
00:37:04.980Any thoughts?
00:37:04.980 -->
00:37:07.000Oh, comments on Java?
00:37:07.000 -->
00:37:08.140Yeah, yeah, yeah.
00:37:08.140 -->
00:37:08.880This ain't no.
00:37:08.880 -->
00:37:09.080Okay.
00:37:09.080 -->
00:37:12.320I got a couple more, and then I know you have some things to throw out there as well.
00:37:14.320 -->
00:37:18.860It's a very colorful splash screen, which is always fun.
00:37:18.860 -->
00:37:23.240But its main thing is it has much better support for a Windows subsystem for Linux.
00:37:23.240 -->
00:37:28.100It has better indexing, so much faster indexing.
00:37:28.100 -->
00:37:36.320It does cool things like if you need to type, let's say you have requests installed, but you haven't imported it into the file.
00:37:36.320 -->
00:37:45.080If you type RG, it very likely may propose to you request.get as an autocomplete option.
00:37:45.080 -->
00:37:52.180If you choose it, it'll write import request and then autocomplete request.get all in one tab completion.
00:37:52.740 -->
00:37:56.260So they've done some really cool stuff with the autocomplete to kind of ramp that up.
00:37:56.260 -->
00:37:57.800And there's a few other things as well.
00:37:57.800 -->
00:37:58.500But yeah.
00:37:58.500 -->
00:38:00.560Anyway, if people are into that, check that out.
00:38:00.560 -->
00:38:03.700We covered Beanie a couple times.
00:38:03.700 -->
00:38:11.660We covered Beanie the first time introducing it, which is an ODM for MongoDB based on Pydantic, which is super cool, by Roman Wright.
00:38:12.300 -->
00:38:17.400And then I said, I reached out to him and said, oh, that's great, but you should have a way to add indexes.
00:38:17.400 -->
00:38:19.060So he did, which was really cool.
00:38:19.060 -->
00:38:21.060And Gwen just mentioned migrations.
00:38:21.060 -->
00:38:25.420So he just added migrations for Beanie as well.
00:38:25.420 -->
00:38:31.560And there's some really interesting ways to write your migrations and convert from one schema to another.
00:38:31.560 -->
00:38:33.640So basically you say, here's the old model.
00:38:33.640 -->
00:38:34.400Here's the new model.
00:38:34.400 -->
00:38:35.440Fix it.
00:38:35.440 -->
00:38:38.020It's more or less the way that you say that.
00:38:38.020 -->
00:38:39.840So yeah, that's pretty cool.
00:38:40.580 -->
00:38:45.640We already covered it, but definitely just a neat thing to see that he's adding it.
00:38:45.640 -->
00:38:47.760So congrats on seeing that thing grow.
00:38:47.760 -->
00:38:50.020Gwen, I know you got a couple of things you want to talk about.
00:38:50.020 -->
00:38:51.020Mem.dev.
00:38:51.020 -->
00:38:52.600That's a really cool thing.
00:38:52.600 -->
00:38:55.460I didn't know about this before, but I checked it out when you put it in the show notes.
00:38:55.460 -->
00:39:01.660Yeah, it's basically a spaced repetition learning system, but built specifically for developers.
00:39:01.660 -->
00:39:05.140So a lot of people use Anki, which is its own algorithm.
00:39:05.140 -->
00:39:10.120I also use Anki synced across my desktop and mobile phone and everything.
00:39:10.120 -->
00:39:15.520To learn different concepts, mostly programming, computer science, all of that stuff.
00:39:15.520 -->
00:39:22.920But one thing I like about also using Mem.dev is that there's a browser plugin and I can
00:39:22.920 -->
00:39:27.040directly copy snippets from places like Stack Overflow.
00:39:27.040 -->
00:39:33.180In all those coding boxes, it will have like a Mem.dev icon in the corner of any coding box.
00:39:33.760 -->
00:39:39.200And I can just copy the snippet to make into a card later on Mem.dev.
00:39:39.200 -->
00:39:44.140Another really cool feature is it lets you practice keyboard shortcuts now.
00:39:44.140 -->
00:39:52.580So to get faster and better as a developer, it's really good to practice different kinds of keyboard shortcuts.
00:39:53.220 -->
00:39:57.700Also, I find it helpful because things like Django have a massive API.
00:39:57.700 -->
00:40:02.460And as a consultant, I feel like I'm being pulled in so many directions.
00:40:02.460 -->
00:40:10.760It's really hard for me to keep up with everything I'm doing and still feel like I'm really good at the technologies I'm using.
00:40:11.120 -->
00:40:16.680So that's why I'm using supplementary resources like these space repetition learning systems.
00:40:16.680 -->
00:40:22.220So I don't forget different parts of the API, even if I haven't used it in a couple months,
00:40:22.220 -->
00:40:26.240because I'll have to recall that for a future project or something like that.
00:40:26.240 -->
00:40:26.760Yeah.
00:40:26.760 -->
00:40:32.400So I looked at this and you can go to places and sort of save these web snippets
00:40:32.400 -->
00:40:36.100and then turn them into stuff you want to remember and practice, almost like flashcards.
00:40:36.260 -->
00:40:40.860So one example is if I'm on Stack Overflow and I see some code, I can go to that code thing and say,
00:40:40.860 -->
00:40:41.800make this a snippet.
00:40:41.800 -->
00:40:45.300And then I could even upgrade that to this like repetition practice.
00:40:45.300 -->
00:40:46.700Yeah, that's pretty neat.
00:40:46.700 -->
00:40:47.280Yeah.
00:40:47.280 -->
00:40:48.480Cool.
00:40:48.480 -->
00:40:52.140And then what about Graphene Django?
00:40:52.140 -->
00:40:53.080Yeah.
00:40:53.080 -->
00:40:56.760So this probably isn't a secret to anybody.
00:40:56.760 -->
00:41:04.300So it's basically the kind of the standard package to be able to use GraphQL with Django.
00:41:04.900 -->
00:41:09.680But as I've been using it more and more, because I use mostly Django REST framework,
00:41:09.680 -->
00:41:14.740but now that I'm using Graphene Django, it's like, oh, this is so nice.
00:41:14.740 -->
00:41:19.220You know, I don't have to update and manage all of these different endpoints.
00:41:19.220 -->
00:41:20.580I just have one endpoint.
00:41:20.580 -->
00:41:30.880And then I'm managing, you know, how my data gets sent back from my different schemas and stuff.
00:41:30.880 -->
00:41:41.020I feel like as your application grows, it's much more easy to manage and maintain with GraphQL than with a standard REST interface.
00:41:41.260 -->
00:41:44.080So that's something that I've been playing around with a lot.
00:41:44.080 -->
00:41:51.400I want to, before I use it in a professional project, I want to kind of get better with using authentication with it.
00:41:51.540 -->
00:41:56.100So there is kind of a standard library for Graphene Django.
00:41:56.100 -->
00:42:00.540I think it's called Graphene Django Auth and it uses JWT tokens.
00:42:00.540 -->
00:42:03.560So I'm going to play around with that a little bit soon.
00:42:03.560 -->
00:42:04.160Yeah.
00:42:04.160 -->
00:42:04.840Very cool.
00:42:04.840 -->
00:42:05.220Yeah.
00:42:05.220 -->
00:42:09.180So it's Django enhancement built upon Graphene itself.
00:42:09.180 -->
00:42:09.900Yes.
00:42:09.900 -->
00:42:11.120Very cool.
00:42:11.120 -->
00:42:16.280And Brian, out in the live stream, who was it that it told us?
00:42:16.280 -->
00:42:17.460It was Dean.
00:42:17.460 -->
00:42:28.840Dean told us that we did in fact cover Friendly, the Friendly library, which allows you to ask, you know, it gives you, when it crashes, you get like, what is it?
00:42:28.840 -->
00:42:31.220Like a little REPL type thing that you can go ask questions about.
00:42:31.220 -->
00:42:31.820Yeah.
00:42:32.000 -->
00:42:34.580That's the one where you're going to ask who, what, why, where.
00:42:34.580 -->
00:42:35.540Yeah, exactly.
00:42:35.540 -->
00:42:36.120Yeah.
00:42:36.120 -->
00:42:37.420I guess maybe not who.
00:42:37.420 -->
00:42:38.080Yeah.
00:42:38.080 -->
00:42:38.660Perfect.
00:42:38.660 -->
00:42:39.340That's interesting.
00:42:39.340 -->
00:42:40.860That's it for this one.
00:42:40.860 -->
00:42:43.200Well, thanks a lot for joining us, Gwen.
00:42:43.200 -->
00:42:44.220Yeah, thank you.
00:42:44.220 -->
00:42:45.940Yeah, Gwen, it was great to have you here.
00:42:45.940 -->
00:42:50.140Thanks so much for being here and keep up the good work on YouTube and everywhere else.
00:42:50.140 -->
00:42:50.760Yeah.
00:42:50.760 -->
00:42:51.700Thanks, Michael.
00:42:51.700 -->
00:42:52.260Thanks, Brian.
00:42:52.260 -->
00:42:53.160Yeah, you bet.
00:42:53.160 -->
00:42:53.800Bye, Brian.
00:42:53.800 -->
00:42:54.400Bye, everyone.