WEBVTT
00:00:00.001 -->
00:00:05.220Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:00:05.220 -->
00:00:11.480This is episode 221, I think, recorded, when is it? February 17th, 2021.
00:00:11.480 -->
00:00:12.800I'm Brian Okken.
00:00:12.800 -->
00:00:13.800I'm Michael Kennedy.
00:00:13.800 -->
00:00:15.720And we also have Brett Cannon, yeah.
00:00:15.720 -->
00:00:19.500I always talk over the third person. I'm not sure why.
00:00:19.500 -->
00:00:23.980Well, you're always going like, is there going to be an introduction or should I just join the Brady Bunch theme?
00:00:23.980 -->
00:00:26.020Let's just go in a circle and just introduce ourselves.
00:00:26.720 -->
00:00:33.280Well, if we're going to do Brady Bunch, we've got to have more people so we can fill out, what is that, rows of three or whatever in the picture?
00:00:33.280 -->
00:00:38.560I'm sure Anthony Shaw and Paul Everitt are available based on how often they show up here, so I'm sure they're waiting in the ways.
00:00:38.560 -->
00:00:41.320That's right. We'll just swoop them in here for the right picture.
00:00:41.320 -->
00:00:42.900Welcome, Brett. It's great to have you here.
00:00:42.900 -->
00:00:44.060Lovely to be back.
00:00:44.060 -->
00:00:47.640You know what, Brian, I'm impressed with Brett's microphone.
00:00:47.640 -->
00:00:49.760He has mastered the work from home.
00:00:49.760 -->
00:00:53.900Yeah, I love this. We're going to have to put a link in the show notes to this thing.
00:00:53.900 -->
00:00:55.720Tell people about this.
00:00:55.720 -->
00:00:57.960So, Brian and I both have good microphones.
00:00:57.960 -->
00:01:03.220We have many different microphones we've tried, but yours has a visual aspect, which is unusual for audio.
00:01:03.220 -->
00:01:03.820Yeah.
00:01:03.820 -->
00:01:11.360So, it's a HyperX Quadcast S specifically, and it comes with RGB lighting because it's really a gamer mic.
00:01:11.360 -->
00:01:15.000But, obviously, in pandemic times, I work from home.
00:01:15.320 -->
00:01:17.640And my wife is also at home because of the pandemic.
00:01:17.640 -->
00:01:31.100And we always had an issue of her wanting to come in and not knowing whether I was actually occupied actually in a meeting, because I'm in them a lot for work, or whether or not I was just sitting there with my headphones on listening to music or whatever, and she could totally just walk in.
00:01:31.100 -->
00:01:37.940And so, the great thing about this microphone is if it has a touch sensitive top, and if you tap it, the LEDs turn off.
00:01:38.260 -->
00:01:41.020And so, it acts as like an on-air light for the room.
00:01:41.020 -->
00:01:46.440I mean, it's not that bright specifically, but if she opens the door, she can totally just look in and go, is the mic lit?
00:01:46.680 -->
00:01:53.820And if the mic's not lit, she knows she's not going to be heard or be directly interrupting me, and I can just turn and answer any questions she has.
00:01:53.820 -->
00:01:54.600And it's awesome.
00:01:54.600 -->
00:01:55.680It works out great that way.
00:01:55.680 -->
00:01:56.840That is so fantastic.
00:01:56.840 -->
00:01:59.440The whole mic glows when it's on and active.
00:01:59.440 -->
00:02:00.240Different colors.
00:02:00.240 -->
00:02:00.680It's beautiful.
00:02:00.680 -->
00:02:01.160I love it.
00:02:01.160 -->
00:02:03.180Yeah, and you can even change which colors it uses.
00:02:03.180 -->
00:02:11.080I can't remember if it's waterfall or not, but you can actually change how the color spectrum changes from side to side in terms of colors and whether it's top to bottom or not.
00:02:11.080 -->
00:02:12.100It's very pretty.
00:02:12.420 -->
00:02:17.520I think I once did Harry Potter color theme for a co-worker of mine who's a big Harry Potter fan for all the houses.
00:02:17.520 -->
00:02:25.140And I've purposely not played with it and kept with the defaults because it's definitely one of those things I could totally nerd out on and play with the colors all day long.
00:02:25.140 -->
00:02:26.700I tried Python colors once.
00:02:26.700 -->
00:02:29.060The transitions didn't look quite as nice, but, you know.
00:02:29.060 -->
00:02:29.960Yeah, no, it's good.
00:02:29.960 -->
00:02:31.540I have the microphone that matches.
00:02:31.540 -->
00:02:33.300I'm sorry, the mouse that matches it.
00:02:33.300 -->
00:02:33.760Oh, nice.
00:02:33.760 -->
00:02:34.480And it pulses.
00:02:34.480 -->
00:02:38.340So, I didn't get it for the color, but it's the only one I could get that had color.
00:02:38.340 -->
00:02:39.240I'm like, why is it of color?
00:02:39.240 -->
00:02:40.100How do I turn this off?
00:02:40.100 -->
00:02:41.040But no, it just has color.
00:02:41.040 -->
00:02:41.380It's fine.
00:02:41.660 -->
00:02:42.620But anyway, great mic.
00:02:42.620 -->
00:02:48.400I think people should check that out if they have like weird work from home situations and people are interrupting.
00:02:48.400 -->
00:02:49.300It's super cool.
00:02:49.300 -->
00:02:49.680I love it.
00:02:49.680 -->
00:02:51.780Definitely get a mic stand, though.
00:02:51.780 -->
00:02:53.340The default stand is a little low.
00:02:53.340 -->
00:02:57.820And I have found that getting a cheap, like $10, $15 stand.
00:02:57.820 -->
00:03:02.100I got this from Amazon that pushes it off about seven inches, I think.
00:03:02.100 -->
00:03:03.540I'm trying to do the American units.
00:03:03.540 -->
00:03:06.240It pushes up about 15 centimeters.
00:03:06.240 -->
00:03:06.820Perfect.
00:03:06.820 -->
00:03:11.320It's a nice sweet spot in terms of distance while it's still not completely taking up your vision in the screen.
00:03:11.320 -->
00:03:12.160Yeah, excellent.
00:03:12.160 -->
00:03:12.560Excellent.
00:03:13.120 -->
00:03:15.960Well, Brian, you want to kick us off here with our first topic?
00:03:15.960 -->
00:03:16.720Yeah.
00:03:16.720 -->
00:03:21.760Well, we've got тАУ it's hard to keep up with Will McGugan.
00:03:21.760 -->
00:03:22.880Sorry, Will.
00:03:22.880 -->
00:03:28.020Will wrote Rich, which is a тАУ I forget what he calls it.
00:03:28.120 -->
00:03:29.520Basically, it's a CLI tool.
00:03:29.520 -->
00:03:35.760But there's been a whole bunch of really cool things he's done recently, like really recently.
00:03:35.760 -->
00:03:47.660So in December, he added Live View, which allows you to just тАУ it continually updates whenever an event happens or something in that part of the screen, which is cool.
00:03:47.660 -->
00:03:50.460He didn't write a blog post on that.
00:03:50.460 -->
00:03:53.760But then in January, Tree View came out.
00:03:53.760 -->
00:03:56.400And the Tree Views are lovely.
00:03:56.620 -->
00:03:59.220You can do all sorts of stuff with the Tree View.
00:03:59.220 -->
00:04:04.620And yeah, it's a nice thing to have in a CLI tool.
00:04:04.620 -->
00:04:09.140And then what's really impressive to me, I think, was layouts.
00:04:09.140 -->
00:04:12.460So this month, he released layouts.
00:04:12.460 -->
00:04:16.140And it allows you to split the screen up.
00:04:16.140 -->
00:04:22.480And his demo even shows it happening within a VS Code.
00:04:22.480 -->
00:04:25.080Oh, yeah.
00:04:25.360 -->
00:04:26.620Within the bottom.
00:04:26.620 -->
00:04:27.160Yeah.
00:04:27.160 -->
00:04:28.840Terminal part of VS Code.
00:04:28.840 -->
00:04:29.220Yeah.
00:04:29.220 -->
00:04:30.800Brett, you've heard of this, right?
00:04:30.800 -->
00:04:31.420You've heard of this tool?
00:04:31.420 -->
00:04:32.720How can I not?
00:04:32.720 -->
00:04:33.760I'm a fan of the podcast.
00:04:33.760 -->
00:04:35.040And Brian loves this tool.
00:04:35.040 -->
00:04:36.660So I've heard about it multiple times.
00:04:36.660 -->
00:04:40.000So I guess we've covered it before.
00:04:40.160 -->
00:04:45.700But one of the reasons why I'm covering it again, there's a couple of reasons, is the layout's neat.
00:04:45.700 -->
00:04:49.400And really, now I want to click on stuff and I want to do entry.
00:04:49.400 -->
00:04:56.140And he sort of hinted at that, that he's kind of going towards a full TUI, which I had never heard of before.
00:04:56.140 -->
00:04:57.400Text user interface.
00:04:57.400 -->
00:04:58.340Yeah, TUIs.
00:04:58.340 -->
00:04:58.900All right.
00:04:58.900 -->
00:04:59.400Right on.
00:04:59.400 -->
00:04:59.940That'd be cool.
00:05:00.300 -->
00:05:01.540So I think that would be neat.
00:05:01.540 -->
00:05:03.320And I'd like to encourage that.
00:05:03.320 -->
00:05:08.660So the other thing that's going on with Rich is he's accepting sponsorships now.
00:05:08.660 -->
00:05:11.280And it's kind of hidden in the demo window.
00:05:11.280 -->
00:05:16.040But we're highlighting it on the show so more people can know about it.
00:05:17.300 -->
00:05:20.300So on GitHub, he's doing sponsorships on GitHub.
00:05:20.300 -->
00:05:22.400And I like how GitHub sponsorships work.
00:05:22.400 -->
00:05:24.240It's kind of neat.
00:05:24.240 -->
00:05:25.380So check it out.
00:05:25.380 -->
00:05:33.100The other thing that I guess when I was playing with these layout things that I didn't really realize before is you can just say Python-mrich.
00:05:33.100 -->
00:05:36.180And it shows a little demo of a whole bunch of stuff.
00:05:36.180 -->
00:05:41.100And then some of the particular parts of it, you can demo them individually.
00:05:41.100 -->
00:05:45.260Like for the layout, you can say Python-mrich.layout.
00:05:45.260 -->
00:05:47.120And it'll show a demo.
00:05:48.080 -->
00:05:48.180That's cool.
00:05:48.180 -->
00:05:50.500The tree is also as a demo.
00:05:50.500 -->
00:05:54.500And the live one, actually, I couldn't escape it.
00:05:54.500 -->
00:05:55.460I had to kill my window.
00:05:55.460 -->
00:06:00.640So the live one just continually updates some, like, I think it does.
00:06:00.640 -->
00:06:03.980I don't know if it's actually going out to the internet.
00:06:03.980 -->
00:06:08.980But it's doing some, like, conversions of monetary conversions.
00:06:08.980 -->
00:06:10.520And it just kept updating.
00:06:10.520 -->
00:06:12.500And it doesn't hit Control-C.
00:06:12.500 -->
00:06:15.520So it's got a bear except somewhere they shouldn't have.
00:06:16.560 -->
00:06:17.940I think it's very reliable.
00:06:17.940 -->
00:06:19.680I mean, the only way to exit it is forced quit.
00:06:19.680 -->
00:06:21.260So we're all...
00:06:21.260 -->
00:06:21.880Kill Dash 9.
00:06:21.880 -->
00:06:23.260Where's your friend?
00:06:23.260 -->
00:06:25.920So, yeah.
00:06:25.920 -->
00:06:30.820I'd love to have Rich continue with this and make it a full 2E.
00:06:30.820 -->
00:06:31.420That would be fun.
00:06:31.620 -->
00:06:32.520That would be very cool.
00:06:32.520 -->
00:06:34.520Because the presentation is really nice here.
00:06:34.520 -->
00:06:37.920I will also fully support Will making this a full-on thing.
00:06:37.920 -->
00:06:44.140Because actually, a couple months ago, I did a slight dive on a weekend trying to find some TUI libraries.
00:06:44.140 -->
00:06:49.640Because I have a personal project for work purposes that I've been trying to do a GUI for.
00:06:49.640 -->
00:06:54.300And two years in a row, I've tried to do it during hackathon week at Microsoft.
00:06:54.300 -->
00:07:00.400And I keep failing because I don't have enough time to dive into all the GUI libraries that go from, like, here's how to do Hello World.
00:07:00.400 -->
00:07:01.640Here's the reference.
00:07:01.640 -->
00:07:02.500And it's like, no, no.
00:07:02.500 -->
00:07:04.500I need more steps there.
00:07:04.500 -->
00:07:06.820Where's that middle ground?
00:07:06.820 -->
00:07:07.100Come on.
00:07:07.140 -->
00:07:07.620Yeah, exactly.
00:07:07.620 -->
00:07:11.180And then I decided, oh, well, I totally could just do this in Curses.
00:07:11.180 -->
00:07:13.940It's like, it's literally just to keep track of what I do every day.
00:07:13.940 -->
00:07:19.520And it's just like, it's snippets from Google is where I picked up the habit of just literally just, oh, I did this today.
00:07:19.520 -->
00:07:20.500That was out of ordinary.
00:07:20.500 -->
00:07:21.480I did this today.
00:07:21.480 -->
00:07:22.160That was out of ordinary.
00:07:22.160 -->
00:07:26.780Just to kind of track the high level, not just meanings, but I actually did something different today.
00:07:26.780 -->
00:07:29.640And it's like, oh, I could totally do this in the terminals.
00:07:29.640 -->
00:07:32.220Like, suddenly pull up in Curses library.
00:07:32.220 -->
00:07:33.020It's in the Snare library.
00:07:33.020 -->
00:07:36.720And it's like, oh, yes, you need to know the size of your terminal window and all this other stuff.
00:07:36.760 -->
00:07:38.580And, oh, how to move the cursor to this specific position.
00:07:38.580 -->
00:07:40.200It's like, yeah, no, I still don't have time for this.
00:07:40.200 -->
00:07:47.740So if we're trying to move this along and make input work, I mean, I would be totally down for giving it a shot.
00:07:47.740 -->
00:07:48.180Yeah.
00:07:48.180 -->
00:07:49.200Yeah, quite cool.
00:07:49.200 -->
00:07:52.600And if people don't know, you kind of live an alter ego.
00:07:52.600 -->
00:08:00.540You've got Brett Cannon Open Source Steering Council and also work closely with VS Code at Microsoft, right?
00:08:00.540 -->
00:08:04.240So having the screenshot on the screen is right at home.
00:08:04.240 -->
00:08:05.220Yeah, yeah.
00:08:05.340 -->
00:08:09.040Just for people who don't know, I'm the dev manager for the Python extension for VS Code.
00:08:10.000 -->
00:08:17.420That's how I pay for my open source habit, which includes being on the Python Steering Council and the core dev.
00:08:17.420 -->
00:08:18.620Yeah, yeah, quite cool.
00:08:18.620 -->
00:08:29.040So Gandalfor says, I've been using Prompt Toolkit for the Tui library for a while, but this rich seems a lot nicer if it actually accepted input, which I agree.
00:08:29.040 -->
00:08:29.820It seems very cool.
00:08:30.160 -->
00:08:31.980And I've heard some people using them together.
00:08:31.980 -->
00:08:33.600I just don't know how to do that.
00:08:33.600 -->
00:08:39.200So if somebody wants to write a tutorial on how to use both rich and Prompt Toolkit together, that'd be cool.
00:08:39.200 -->
00:08:40.420Yeah, that would be cool, actually.
00:08:40.420 -->
00:08:41.720All right.
00:08:41.860 -->
00:08:50.900What I want to talk about is this article I ran across and some tools that I went to play with afterwards after reading it called 12 requests per second.
00:08:50.900 -->
00:08:52.020Sounds amazing, right?
00:08:53.320 -->
00:08:58.240So it's a realistic look at web frameworks and Python web frameworks.
00:08:58.240 -->
00:09:05.140So if you look out there, you'll hear things like, oh, we're getting 100,000 requests per second on uvloop with a single thread.
00:09:05.140 -->
00:09:14.120Or, you know, we've got Sanic doing 100,000 requests or even Jopronto up to 1.2 million requests per second, right?
00:09:14.120 -->
00:09:14.980Which is amazing.
00:09:14.980 -->
00:09:21.920And then a lot of these examples are doing like really not real type of work, right?
00:09:21.920 -->
00:09:26.920They're just doing some little tiny thing like, oh, here, let's add two numbers and tell you how fast we can do that.
00:09:26.920 -->
00:09:34.340So this article is more like, well, let's go through a real application and see what kind of performance you might expect.
00:09:34.340 -->
00:09:39.280So I thought it'd be fun to talk about this because it gives some people some things to think about.
00:09:39.280 -->
00:09:44.920You know, how can you compare your app to these types of quotes that people are getting and so on?
00:09:44.920 -->
00:09:54.440And would it be better to choose something like Jopronto or AIoHTP or FastAPI or something like that over, say, Flask or Django,
00:09:54.600 -->
00:09:57.080which don't have so much support for things like Async.
00:09:57.080 -->
00:09:59.900So I thought this was fun to go through and just kind of look at it.
00:09:59.900 -->
00:10:06.480They start out by profiling just sort of a Hello World app and they get, all right, well, Hello World's pretty good.
00:10:06.480 -->
00:10:11.660If you run Flask on CPython, you get some amount here.
00:10:11.660 -->
00:10:14.260Maybe it was 500 to 1,000.
00:10:14.260 -->
00:10:15.940You run it on PyPy.
00:10:16.140 -->
00:10:17.840They were able to get 3,000.
00:10:17.840 -->
00:10:18.520You run it.
00:10:18.520 -->
00:10:20.840And so that's just, you know, Flask run, right?
00:10:20.840 -->
00:10:23.280Which is not really the way you should probably be doing things.
00:10:23.280 -->
00:10:27.100You should be running on Gunicorn or uWSGI or something like that.
00:10:27.100 -->
00:10:32.260So if they ran the same thing on Gunicorn, right, it's up to like 12,000.
00:10:32.260 -->
00:10:37.140And you run it on, compare that against Sanic, you get, you know, Sanic was doing like 24,000 or something.
00:10:37.260 -->
00:10:39.540So these comparisons I thought would be fun for people.
00:10:39.540 -->
00:10:43.000You can go through, they've got a bunch of graphs that you can check out.
00:10:43.000 -->
00:10:46.400But then they write one that actually talks to a database doing database-y things.
00:10:46.400 -->
00:10:49.980And then let me get down to the numbers here, the bottom for that.
00:10:49.980 -->
00:10:55.700And they're like, okay, well, with this one, now we're running at, you know, quite a bit lower request per second.
00:10:55.700 -->
00:11:02.060And I think in the end they said for our real app, what we ended up with is a whopping like 12 requests per second.
00:11:02.060 -->
00:11:02.780Yeah, here we go.
00:11:02.780 -->
00:11:03.960Here's the graph I was looking for.
00:11:04.580 -->
00:11:11.920Where like, this is Flask running the synchronous Postgres driver there.
00:11:11.920 -->
00:11:13.480And that's all pretty interesting.
00:11:13.480 -->
00:11:17.820I think, you know, even be able to answer the question, you know, well, what about me?
00:11:17.820 -->
00:11:18.980What about my app?
00:11:18.980 -->
00:11:21.260How would it do if I were to run these things against it?
00:11:21.260 -->
00:11:23.340And we've talked about Locus before.
00:11:23.340 -->
00:11:32.840Locus is a really fantastic way to write load testing and user interaction testing against websites,
00:11:33.360 -->
00:11:34.720web APIs and so on.
00:11:34.720 -->
00:11:35.800And it's all about Python.
00:11:35.800 -->
00:11:40.680So what you do with this is you go through and you write some kind of class and you say, okay, here's a test,
00:11:40.680 -->
00:11:45.060like a representation of what people might do to my website.
00:11:45.060 -->
00:11:46.180They might log in.
00:11:46.180 -->
00:11:48.280They might go view the episode page.
00:11:48.280 -->
00:11:51.880If we were testing the Python Bytes site, they go check out the episode page.
00:11:51.880 -->
00:11:52.920They might drill into an episode.
00:11:52.920 -->
00:11:53.960They might do a search.
00:11:53.960 -->
00:12:00.060And what you can do is you write simple little bits of Python to say, here's a function that does this action.
00:12:00.060 -->
00:12:01.580Here's a function that does that action.
00:12:01.580 -->
00:12:03.940Like, here's one that goes to the episode listing.
00:12:03.940 -->
00:12:12.000And then you can actually, it's not shown in the example here, but you can say things like, well, you know, 10 out of 15 times, I want them to view an episode page.
00:12:12.320 -->
00:12:14.380One out of the 10 times, I want them to do a search.
00:12:14.380 -->
00:12:18.660And three out of the 10 times, I want them to actually go to the listing, right?
00:12:18.660 -->
00:12:21.780So you can sort of break it up to what the normal look would be.
00:12:21.780 -->
00:12:27.300Then you just run Locus and you get like this web UI where you enter some information.
00:12:27.300 -->
00:12:33.880And then it just runs, if you want, even in a distributed way against your site and then, you know, pounds it until it gives up, basically.
00:12:33.880 -->
00:12:35.860Brett, have you heard this tool?
00:12:35.860 -->
00:12:37.500No, I actually haven't.
00:12:37.500 -->
00:12:44.300I mean, you hear about different tools for different things, but this is pretty, looking at this example, it's pretty simple, which is pretty great.
00:12:44.300 -->
00:12:46.260Yeah, the simplicity is really great.
00:12:46.260 -->
00:12:49.660And then when you run it, you actually get a web view into it.
00:12:49.660 -->
00:12:53.480Then the web UI lets you basically control and monitor the tests in real time.
00:12:53.480 -->
00:13:02.960So anyway, coming back to some numbers off of that, I decided, well, if they're getting, you know, 12 to 80 requests per second, what does my stuff look like?
00:13:02.960 -->
00:13:04.840Like, for example, I talk to Python training stuff.
00:13:04.840 -->
00:13:07.220It's not using any of this async stuff.
00:13:07.220 -->
00:13:07.920How is it doing?
00:13:07.920 -->
00:13:12.280So it's Python 3, uWSGI, Pyramid, MongoDB on a $20 server.
00:13:12.280 -->
00:13:14.940Would it get 12 requests per second?
00:13:14.940 -->
00:13:15.400I don't know.
00:13:15.400 -->
00:13:22.020So I turned this thing loose and it'll do about 125 requests per second.
00:13:22.480 -->
00:13:24.880I felt better than, that's better than 12.
00:13:24.880 -->
00:13:25.600I felt pretty good.
00:13:25.600 -->
00:13:37.260But one of the things that's cool about Locus is you can tell it, not just, I want you to use this partitioning, but also I would like you to have a distribution of how often the user actually does something.
00:13:37.260 -->
00:13:45.100So you can say, well, this user is going to make between every 10 to 60 seconds, it's going to do one of these things among this mix.
00:13:45.100 -->
00:13:51.280So instead of just pounding it, it's like, well, an average user doesn't just hit F5 or control command R as hard as they can.
00:13:51.280 -->
00:13:53.340They move around and they pause, right?
00:13:53.340 -->
00:13:54.120So you can pause that.
00:13:54.120 -->
00:13:59.900So I don't know, maybe it's 10 to 20,000 realistic users I was able to sort of map out with this.
00:13:59.960 -->
00:14:03.760Anyway, it was just a fun deep dive into like, well, what does performance look like?
00:14:03.760 -->
00:14:05.440How important is async?
00:14:05.440 -->
00:14:07.040Some of the tools to do it.
00:14:07.040 -->
00:14:07.480I don't know.
00:14:07.480 -->
00:14:12.500If people are, if that's interesting, people definitely check out this 12 requests per second article here.
00:14:12.500 -->
00:14:14.780I think you'll enjoy it.
00:14:14.780 -->
00:14:17.940Then also check out Locus if you want to try to answer that question for yourself.
00:14:17.940 -->
00:14:26.840So I was curious how, when you're testing your site, did anybody else like experience downtime or something while you're being on it?
00:14:26.840 -->
00:14:28.320Well, so that's the question, right?
00:14:28.320 -->
00:14:34.980Like with the Locus thing, you can start to see what the like real time, what the response times are and everything.
00:14:34.980 -->
00:14:36.340It never crashed.
00:14:36.340 -->
00:14:37.760It just got a little bit slow.
00:14:37.760 -->
00:14:41.820So I was, you know, I ran it locally and I'm like, well, what's it look like in production, right?
00:14:41.820 -->
00:14:47.560So I'm like, I really want to know what with all the way that everything's put together, what number will I get?
00:14:47.640 -->
00:14:49.140So I'm like, I'm just going to turn it loose on it.
00:14:49.140 -->
00:14:52.660And if it starts to overwhelm it, I'll just hit the stop button, you know, and it never died.
00:14:52.660 -->
00:14:56.180It just got to where it took like three or 400 milliseconds to get back to me.
00:14:56.180 -->
00:14:56.860So it was okay.
00:14:56.860 -->
00:14:57.820Okay, good.
00:14:57.820 -->
00:14:58.200Yeah.
00:14:58.200 -->
00:14:58.980So pretty fun.
00:14:58.980 -->
00:15:00.300Pretty fun example there.
00:15:00.300 -->
00:15:08.680I think one other thing I appreciate about that blog post actually was they pointed out towards the end that at some point scaling is no longer a Python problem and it's an infrastructure problem.
00:15:08.680 -->
00:15:11.360Like, oh, it's probably better to update your database and stuff.
00:15:11.360 -->
00:15:14.000And I've heard this from a lot of people too.
00:15:14.700 -->
00:15:20.240There's kind of a misnomer if you're not in the Python community that, oh, Python's so slow, it's going to be your bottleneck.
00:15:20.240 -->
00:15:23.620And instead, I've heard it from a lot of people in the community that, oh, actually it's not.
00:15:23.620 -->
00:15:26.380I can get it done, get my work done a third of a time.
00:15:26.380 -->
00:15:30.540And then the two thirds of time it would have taken me to do it in, I don't know, Java, just choosing a language.
00:15:30.540 -->
00:15:32.500I can optimize my infrastructure.
00:15:32.500 -->
00:15:33.280And guess what?
00:15:33.320 -->
00:15:38.420I end up with the same performance with more time to bug fix and test than I would have in the other platform.
00:15:38.420 -->
00:15:44.480And the other thing is, is obviously there's, there is always throwing more hardware at the problem if you need to horizontally scale.
00:15:44.480 -->
00:15:52.040But, and honestly, I think when I say this post also, I think from our correctly pointed out, not everyone needs a thousand requests a second.
00:15:52.040 -->
00:15:54.240Most people don't.
00:15:54.240 -->
00:15:57.880Even popular websites are not doing a thousand.
00:15:57.880 -->
00:15:59.460I mean, that's a lot of requests.
00:15:59.460 -->
00:16:00.380A thousand requests a second.
00:16:00.380 -->
00:16:00.600That is a lot.
00:16:00.600 -->
00:16:04.340Like most people measure in queries per minute, not per second.
00:16:04.340 -->
00:16:04.800Right?
00:16:04.800 -->
00:16:05.020Yeah.
00:16:05.060 -->
00:16:12.700So like even 12 per second, like we're still talking 720, if my math is not finding me on the spot, requests per minute.
00:16:12.700 -->
00:16:12.980Right?
00:16:12.980 -->
00:16:14.640That's still a decent cliff.
00:16:14.640 -->
00:16:20.540Like if you're running a business that's getting that much traffic every single minute, you're probably still doing pretty good for yourself.
00:16:20.540 -->
00:16:21.180Yeah.
00:16:21.180 -->
00:16:23.860That's 32 million page views per month.
00:16:23.860 -->
00:16:24.160Right?
00:16:24.160 -->
00:16:28.320That's like you're at a limit where you've got some real stuff going on, some real infrastructure.
00:16:28.320 -->
00:16:29.540Well, okay.
00:16:29.540 -->
00:16:34.300So, but there's also, if I've got services running, I've got a bunch of services that include this.
00:16:34.300 -->
00:16:38.260So, I mean, one user interaction isn't one hit.
00:16:38.260 -->
00:16:39.880It might be dozens.
00:16:39.880 -->
00:16:40.960Yeah.
00:16:40.960 -->
00:16:45.640So, my rule of thumb is honestly, don't worry unless you're going over a hundred a second.
00:16:45.640 -->
00:16:48.460Like you should be able to hit a hundred a second without too much effort.
00:16:48.460 -->
00:16:50.340And after that, you might have to start doing some planning.
00:16:50.340 -->
00:16:55.720But I would suspect as a general rule of thumb, you can handle hundreds without a whole lot of effort in Python.
00:16:55.720 -->
00:16:56.200Yeah.
00:16:56.200 -->
00:17:01.520If you're getting to a thousand, you might have to do a bit more planning for it, but it's solely serviceable for that kind of thing.
00:17:01.520 -->
00:17:01.980Yeah.
00:17:01.980 -->
00:17:02.700Totally agree.
00:17:03.540 -->
00:17:06.060Magnus Carlson has a quick comment.
00:17:06.060 -->
00:17:06.460Nice.
00:17:06.460 -->
00:17:12.240So, I can now see if my work turning my FastAPI app into async was worth it.
00:17:12.240 -->
00:17:13.320Yes, you can.
00:17:13.320 -->
00:17:15.700That's a very good use of that.
00:17:15.700 -->
00:17:18.260I'm going to be biased and just say it was totally worth it, Magnus.
00:17:18.260 -->
00:17:19.100You just don't know yet.
00:17:19.100 -->
00:17:23.260Because it's got the cool new design patterns.
00:17:23.260 -->
00:17:23.620Absolutely.
00:17:23.620 -->
00:17:24.240Exactly.
00:17:24.760 -->
00:17:25.980All right, Brett, you're up next.
00:17:25.980 -->
00:17:27.840You've got something special for us.
00:17:27.840 -->
00:17:28.400Yeah.
00:17:28.400 -->
00:17:28.840Yeah.
00:17:28.840 -->
00:17:38.680So, the world exclusive news breaking thing is the Python launcher for Unix is probably at RC stage.
00:17:39.480 -->
00:17:45.580For those of you who don't know about this, it's a project I've been working on since May of 2018.
00:17:45.580 -->
00:17:49.160And if you're a Windows user, you probably know what I'm talking about.
00:17:49.160 -->
00:17:53.980But on Windows, there's a little app called the Python launcher for Windows.
00:17:54.200 -->
00:17:55.240And it ships with Python.
00:17:55.240 -->
00:17:56.920And it gives you the Py command.
00:17:56.920 -->
00:18:01.420So, sometimes you might see this on websites where they say, well, if you're on Windows, you run Python using PY.
00:18:01.420 -->
00:18:05.380And then the command and other platforms just run with Python 3.
00:18:05.380 -->
00:18:10.160And I decided that I kind of wanted this on Unix.
00:18:10.160 -->
00:18:14.700I had enough people complain to me about how it's difficult to get started.
00:18:14.700 -->
00:18:19.740We're having the Windows instructions on how to run something was always different from the Unix version and all this.
00:18:19.740 -->
00:18:20.260Yes.
00:18:20.260 -->
00:18:21.420That is really annoying.
00:18:21.620 -->
00:18:24.840The very first thing you got to do, like right at the start, like, oh, it's so easy.
00:18:24.840 -->
00:18:25.780But there's these two ways.
00:18:25.780 -->
00:18:27.380There's like this diversion, right?
00:18:27.380 -->
00:18:28.180Exactly.
00:18:28.180 -->
00:18:36.600And I saw some benefits of the Python launcher because what it does on Windows is it serves kind of two key purposes.
00:18:36.600 -->
00:18:44.320One is it kind of makes up for the lack of shebang support on Windows because the launcher will actually look for a shebang line,
00:18:44.320 -->
00:18:48.440figure out what version of Python is required, and then finds the right version of Python to run it.
00:18:48.660 -->
00:18:54.400The other thing is it does away with the need of caring about what order you installed your Pythons in.
00:18:54.400 -->
00:18:57.820Because, like, for instance, on Unix, like Python 3, what does that point at?
00:18:57.820 -->
00:19:03.840Well, what it points at is the last version of Python 3 that you installed, not the newest version of Python.
00:19:03.840 -->
00:19:04.100Yeah.
00:19:04.100 -->
00:19:13.980So if you installed 3.9 today, but then installed the 3.8 security release that I think happened yesterday, you will get 3.8 as your version for Python 3.
00:19:13.980 -->
00:19:17.100So if you don't specify Python 3.9, you won't be running it.
00:19:17.100 -->
00:19:20.900Like, you have to either create your virtual environment and be using it that way or remember that.
00:19:20.900 -->
00:19:22.440Python launcher takes care of all that.
00:19:22.500 -->
00:19:27.280It will automatically just figure out what versions you have installed and just automatically run the newest version.
00:19:27.280 -->
00:19:29.160And so I really like that.
00:19:29.160 -->
00:19:36.480So I decided to implement it in Rust, partially as a Rust project of decent size, and it's about a thousand lines of Rust code.
00:19:36.840 -->
00:19:43.880And also because I wanted it, because if this works out, hopefully some projects can stop listing two different ways to run things.
00:19:43.880 -->
00:19:52.120So in the Unix version, it's a little different from the Windows version, and I'll ask for feedback from the two of you and anyone in the live stream if they want to provide it.
00:19:52.120 -->
00:19:55.640First, it looks to see if a virtual environment is activated.
00:19:55.640 -->
00:19:59.760So it looks for the virtual under env environment variable, and if it's there, it just uses that.
00:19:59.760 -->
00:20:04.240So automatically, this is a little shorter and easier if you have an activated virtual environment.
00:20:04.240 -->
00:20:06.320It's just PY now instead of having to type Python.
00:20:06.640 -->
00:20:08.160The next one is if you have...
00:20:08.160 -->
00:20:10.320You're here to save us from RSI already.
00:20:10.320 -->
00:20:12.840I'm kidding, but this is really interesting.
00:20:12.840 -->
00:20:13.200Keep going.
00:20:13.200 -->
00:20:13.660Yeah.
00:20:13.660 -->
00:20:14.780One third the typing.
00:20:14.780 -->
00:20:24.600The other thing is if you create a virtual environment in a .venv directory, it will also automatically use that without activation.
00:20:24.600 -->
00:20:34.720So once again, if you use the, I personally think, standard nomenclature, naming your virtual environments .venv, you don't even have to activate them anymore.
00:20:34.740 -->
00:20:42.480Because activation is just a shorthand for the shell that, honestly, I typically just use to make Python do the right thing.
00:20:42.480 -->
00:20:46.160Because I use dashed m for everything, even when I'm in an activated environment.
00:20:46.160 -->
00:20:49.580This takes care of that entire step for me, so I don't have to activate my environments anymore.
00:20:49.580 -->
00:20:50.920That's super cool.
00:20:51.260 -->
00:20:56.320After that, it does the shebang, just like on Windows, trying to figure out what the right Python might be for that.
00:20:56.320 -->
00:20:58.420And then after that, it checks some environment variables.
00:20:58.420 -->
00:21:02.660Like if you want to, if you have 3.10 installed, for instance, for Python, you have an alpha installed.
00:21:02.780 -->
00:21:16.160But you want to make sure that if you ever say, hey, if I say Python, if I run Py with no arguments or say, hey, I want to run a Python 3 version of Python, you can actually set the environment variables to restrict it and basically specify the exact version you want.
00:21:16.160 -->
00:21:20.440And then after that, it just, if none of that triggers, it just finds the newest version and runs that.
00:21:20.820 -->
00:21:22.440I've been running this personally for a while.
00:21:22.440 -->
00:21:28.680And when I added the .venv support, I've completely switched.
00:21:28.680 -->
00:21:36.820I don't even bother typing Python anymore because this completely fits my workflow of just doing exactly what I think it should do whenever I need.
00:21:36.820 -->
00:21:44.560Now, the question I have for the two of you and anyone in the audience who cares to answer is, do you think prioritizing virtual environments over shebangs makes sense?
00:21:44.560 -->
00:21:48.160Now, my argument is yes, obviously, or else I would have done it this way.
00:21:48.260 -->
00:21:58.020But this is partially, I don't know how much of this is a Unixism versus just in general, because I do hope to actually add Windows support to this as well and make this a universal Python launcher.
00:21:58.020 -->
00:22:04.220So the reason I did it this way was on Unix, you can just chmod a file and add the executable bit.
00:22:04.220 -->
00:22:05.700And that's how you can execute it.
00:22:05.700 -->
00:22:13.120And honestly, most of my files at this point are going to be in a virtual environment anyway, whether it's sold via PipX or I create an entry point and I install that.
00:22:13.120 -->
00:22:16.200So once again, I don't need the shebang directly.
00:22:16.260 -->
00:22:21.000It's just going to be baked into the executable and Windows will do the exact same thing, right?
00:22:21.000 -->
00:22:22.600Like set of tools will give you that little shim.
00:22:22.600 -->
00:22:30.300So to me, if I am running in a project directory with a virtual environment, whether activated or not, I'm assuming that's what I want.
00:22:30.300 -->
00:22:36.160Don't try to figure it out for me or else I'd be running this somewhere else and I would not have a virtual environment installed.
00:22:36.160 -->
00:22:37.440Does that logic make sense?
00:22:37.440 -->
00:22:43.380Do people do you think I made the right decision here and choosing virtual environments over shebang lines or am I crazy?
00:22:43.380 -->
00:22:45.520I forgot shebangs were even supported.
00:22:45.520 -->
00:22:47.980I'm all about virtual environments.
00:22:47.980 -->
00:22:48.320Yes.
00:22:48.320 -->
00:22:49.180Okay, cool.
00:22:49.180 -->
00:22:50.580I think this is fantastic.
00:22:50.580 -->
00:22:55.600I've long wanted an easy way to just say I'm down inside.
00:22:56.820 -->
00:22:58.420Maybe you can tell me if it works this way.
00:22:58.420 -->
00:23:01.880Does it traverse up looking for a virtual environment?
00:23:01.880 -->
00:23:08.300Like if I'm in a subdirectory and I try to pie a file, but one directory up, there's a virtual environment.
00:23:08.300 -->
00:23:10.380Will it go up and find that and then use it?
00:23:10.380 -->
00:23:11.980No, I did not implement it that way.
00:23:11.980 -->
00:23:14.320It would not be too difficult to do it that way.
00:23:14.440 -->
00:23:21.520But for simplicity reasons, when I first plugged this in, for my purposes, I'm not an SRC guy like Brian is, for instance.
00:23:21.520 -->
00:23:23.720So I don't need to worry about that as much.
00:23:24.660 -->
00:23:31.360But that would be totally reasonable feature request to ask for to be able to traverse up a directory who's looking for the .vnv directory.
00:23:31.360 -->
00:23:32.320Yeah, very cool.
00:23:32.320 -->
00:23:34.420I'm down a level in my SRC.
00:23:34.420 -->
00:23:36.920Go up a level to find the actual.
00:23:36.920 -->
00:23:40.820Right, like I have a lot of things that will do like maintenance for my website.
00:23:40.820 -->
00:23:44.400So I'll have like a bin folder as one of the subfolders of my website.
00:23:44.400 -->
00:23:46.020Then I'll go in there and I want to run something.
00:23:46.020 -->
00:23:49.000If I'm like, oh, I should have run and gone up and then bin slash.
00:23:49.000 -->
00:23:50.060I think it'd just be really cool.
00:23:50.060 -->
00:23:55.060Like I'm sort of in the realm of this virtual environment, even if it's not at the same working directory.
00:23:56.020 -->
00:24:01.600Yeah, and one thing I do want to clarify here is this is very much about simplifying running Python manually.
00:24:01.600 -->
00:24:05.200It is not meant to completely replace running Python, right?
00:24:05.200 -->
00:24:16.380Like a misnomer I hear from people when I tell them about this is like, oh, hey, are you going to add a config file to be able to alias to PyPy versus specifically or this thing or a framework builder that thing is.
00:24:16.380 -->
00:24:25.300And for me is if you have that kind of specific requirement of a specific version of Python you have installed, just use the absolute paths of that version of Python.
00:24:25.300 -->
00:24:28.940Yeah, I don't think this is this is purely for I just want the newest version.
00:24:28.940 -->
00:24:30.760I don't care what it is.
00:24:30.760 -->
00:24:32.840Just give it to me or I have a virtual environment.
00:24:32.840 -->
00:24:34.040Just give me the virtual environment.
00:24:34.040 -->
00:24:35.680I don't want to have to think about it.
00:24:35.680 -->
00:24:41.500If you have to put thought into what kind of Python you want to run, I think you should be specifying that manually, not be using this.
00:24:41.500 -->
00:24:50.220Well, so on the side of the being able to go up a couple directories looking for virtual environments, I'm often not in the source directory.
00:24:50.320 -->
00:24:58.200I'm often sitting in the tests directory running pytest on stuff, in which case, I guess I already am in a virtual environment.
00:24:58.200 -->
00:24:59.000So it doesn't matter.
00:24:59.000 -->
00:25:06.560But I might just open up another terminal and try to just run Python.
00:25:06.800 -->
00:25:07.680So I like this.
00:25:07.680 -->
00:25:12.420I'm excited to hear that this is eventually going to be a Windows thing also, hopefully.
00:25:12.860 -->
00:25:16.860I don't actually normally use the Python launcher on Windows.
00:25:16.860 -->
00:25:17.580Does it?
00:25:17.580 -->
00:25:20.100It doesn't do looking for virtual environments, does it?
00:25:20.100 -->
00:25:21.860No, that's exclusive.
00:25:21.860 -->
00:25:24.420That is exclusive to the Unix version of this launcher.
00:25:25.620 -->
00:25:31.100So basically, the environment variable it will use, it doesn't actually look on path.
00:25:31.100 -->
00:25:32.860It completely uses the Windows registry.
00:25:32.860 -->
00:25:34.280It does the shebang.
00:25:34.280 -->
00:25:35.400And that's it.
00:25:35.400 -->
00:25:40.180So looking in the .venv folder, that is entirely my addition.
00:25:40.180 -->
00:25:45.720And the order of execution here is kind of tweaked to what I think.
00:25:46.580 -->
00:25:48.160And it doesn't search on path, actually.
00:25:48.160 -->
00:25:50.480So that's a Unix thing specifically.
00:25:50.480 -->
00:25:56.000But I suspect this will actually help with the Windows Store, although I think Steve Dower fixed that issue with the Windows Store install.
00:25:56.000 -->
00:25:59.280But yeah, so there's slight tweaks.
00:25:59.280 -->
00:26:05.480But I figure if I have all the logic done already, there's no reason not to just make it universal to support multiple platforms.
00:26:05.480 -->
00:26:06.540So why not?
00:26:06.540 -->
00:26:07.020Yeah.
00:26:07.020 -->
00:26:11.720So your announcement here has kind of lit up the live stream.
00:26:11.720 -->
00:26:15.720So ZDocs is just a Brett Cannon fan, which is awesome.
00:26:15.720 -->
00:26:21.300So Gendal Forth asks, is the Rust version cross-platform in any way?
00:26:21.300 -->
00:26:22.800Is there a chance of this on Windows?
00:26:22.800 -->
00:26:25.020No, I don't.
00:26:25.020 -->
00:26:26.760I've not tried it on Windows.
00:26:26.760 -->
00:26:29.480It definitely works on Mac and Linux, right?
00:26:29.480 -->
00:26:31.800So it truly is Unix-based.
00:26:31.800 -->
00:26:33.240So it will handle that no problem.
00:26:33.240 -->
00:26:37.120I've not tried to wire it up into the registry at all.
00:26:37.120 -->
00:26:37.760So that's not there.
00:26:37.760 -->
00:26:40.660I have an open enhancement issue to do that.
00:26:40.660 -->
00:26:43.300I honestly don't know what would happen if you tried running this on Windows.
00:26:43.300 -->
00:26:44.120I haven't tried.
00:26:45.120 -->
00:26:48.620Everything's very hard-coded to Unix at the moment, just to get this done.
00:26:48.620 -->
00:26:52.720If you look at the readme, you'll notice everything is slash bin.
00:26:52.720 -->
00:26:54.720Slash user slash bin, yeah.
00:26:54.720 -->
00:26:57.660There's no scripts support here.
00:26:57.660 -->
00:27:00.000If slash one, I do Windows support.
00:27:00.000 -->
00:27:01.040Obviously, I'll look at fix.
00:27:01.040 -->
00:27:03.160But I have tried putting zero effort.
00:27:03.160 -->
00:27:07.020Because the Python launcher for Windows just comes with the install from Python.org, right?
00:27:07.020 -->
00:27:09.600So there was no real time pressure to try to get that done.
00:27:09.600 -->
00:27:11.160So I haven't tried it.
00:27:11.160 -->
00:27:11.800I'm a big fan.
00:27:11.860 -->
00:27:14.520I could try this on my macOS and I'd be happy now.
00:27:14.520 -->
00:27:14.980Yeah.
00:27:14.980 -->
00:27:16.080This is how I do it.
00:27:16.080 -->
00:27:16.780I have it on my Mac.
00:27:16.780 -->
00:27:17.460I just installed.
00:27:17.460 -->
00:27:19.600You do have to install Rust to install it right now.
00:27:19.600 -->
00:27:24.500Because I haven't figured out how to do distributable binaries that you can just download.
00:27:24.500 -->
00:27:28.780But yeah, if you have Rust installed, which you can get through rustup or Homebrew or whatever,
00:27:28.780 -->
00:27:30.320it's just a cargo install away.
00:27:30.320 -->
00:27:32.260So if you want to get a shot, please do so.
00:27:32.360 -->
00:27:32.800Fantastic.
00:27:32.800 -->
00:27:36.620And then I kind of forgot that my Mac was Unix-y.
00:27:36.620 -->
00:27:38.880That's right.
00:27:38.880 -->
00:27:41.460And Magnus agrees on the VNV over shebang.
00:27:41.460 -->
00:27:42.020Awesome.
00:27:42.020 -->
00:27:44.320And Gandalfor says same as well.
00:27:44.320 -->
00:27:48.480I don't think I've ever seen a shebang that was more specific than user bin Python 3 anyway.
00:27:48.480 -->
00:27:49.080Yeah.
00:27:49.080 -->
00:27:52.880And I actually suspect the shebang support was partially because the Python launcher has been
00:27:52.880 -->
00:27:55.160around back in Python 2 days, right?
00:27:55.160 -->
00:27:56.300Where that was much more of a concern.
00:27:56.640 -->
00:27:58.820So like, as I said, I started this in 2018.
00:27:58.820 -->
00:28:01.560So it was pre-Python 2 deprecation.
00:28:01.560 -->
00:28:03.720So it's still supported there.
00:28:03.720 -->
00:28:07.300But a lot of this, I think, was also partially to support the 2 to 3 transition.
00:28:07.300 -->
00:28:12.660So those little extras here, I don't think are quite as important unless Python 4 happens
00:28:12.660 -->
00:28:14.480someday, which there are zero plans for.
00:28:14.480 -->
00:28:15.360So I don't think so.
00:28:15.360 -->
00:28:15.460Yeah.
00:28:15.460 -->
00:28:16.580Don't hold your breath.
00:28:16.580 -->
00:28:23.180By the way, one extra nicety I want to tell people is if you're a Starship user, the Starship
00:28:23.180 -->
00:28:31.000cross shell prompt, there's a setting in Starship that lets you specify how it figures out what
00:28:31.000 -->
00:28:32.060version of Python you have.
00:28:32.060 -->
00:28:36.520Now, it does look for virtualenv, but otherwise it has a list of binaries that it will execute
00:28:36.520 -->
00:28:39.000to try to figure out what version of Python you have.
00:28:39.000 -->
00:28:44.500If you set it to Py using this, it will always tell you either what the virtual environment's
00:28:44.500 -->
00:28:48.680Python version is in the prompt or whatever the newest version of Python is installed.
00:28:48.680 -->
00:28:50.380So it has a really nice side effect.
00:28:50.460 -->
00:28:54.800Because if you read the docs in Starship, there's a big tip saying, hey, if you have
00:28:54.800 -->
00:28:56.840a Python installed that's default, i.e.
00:28:56.840 -->
00:29:01.040macOS, and it'll always say 2.7 unless you happen to have an activated virtual environment,
00:29:01.040 -->
00:29:04.040which always threw me because it's like, yeah, I'm not using 2.7 in this project.
00:29:04.040 -->
00:29:09.000As soon as I added this support for .venv files and tweaked my Starship config for this,
00:29:09.000 -->
00:29:14.020it always tells me the exact version that I happen to have set up for my virtual environment.
00:29:14.020 -->
00:29:15.220It's really handy.
00:29:15.620 -->
00:29:17.620For those of us not in the know, what's Starship?
00:29:17.620 -->
00:29:22.600So Starship is a cross-platform shell prompt tool.
00:29:22.600 -->
00:29:24.000So it's written in Rust.
00:29:24.000 -->
00:29:29.560But basically what you do is it has instructions for Bash and Zeesh and Phish and PowerShell and
00:29:29.560 -->
00:29:30.140everything else.
00:29:30.140 -->
00:29:31.680And basically it just gives you a line.
00:29:31.680 -->
00:29:36.440Brian's got it pulled up on the screen for those on the live stream.
00:29:36.440 -->
00:29:40.220And it's basically just an easy way to just say like, hey, this is how I want my prompt
00:29:40.220 -->
00:29:40.480to look.
00:29:40.480 -->
00:29:43.880Don't worry about whether it being Bash or Zeesh or Phish, whatever.
00:29:43.880 -->
00:29:44.980Like I'm a Phish user.
00:29:44.980 -->
00:29:48.480I'm sure Michael's probably a Zeesh user being a macOS user like he is.
00:29:48.480 -->
00:29:48.700Yep.
00:29:48.700 -->
00:29:50.720But it shouldn't matter.
00:29:50.720 -->
00:29:51.940My prompt is a prompt.
00:29:51.940 -->
00:29:55.040And pretty much they have pretty consistent user support.
00:29:55.040 -->
00:29:57.500So I decided, yeah, you know what?
00:29:57.500 -->
00:30:00.160I like some of the niceties it has automatically baked in.
00:30:00.240 -->
00:30:06.080It does like notification, it changes prompt for the usual, oh, I edited my Git checkout.
00:30:06.080 -->
00:30:07.440It'll tell you what branch you're on.
00:30:07.440 -->
00:30:08.460All these little nice things.
00:30:08.460 -->
00:30:13.060And setting fear code as my font gives me all the nice little glyphs that I want.
00:30:13.060 -->
00:30:14.400And so I said, nice.
00:30:14.400 -->
00:30:14.940All right, cool.
00:30:14.940 -->
00:30:17.360It'll tell me what version of Python is currently activated.
00:30:17.360 -->
00:30:20.280Except for that annoyance of being on Mac.
00:30:20.280 -->
00:30:22.820It kept saying, oh, you've got 2.7 until I activated.
00:30:22.820 -->
00:30:24.340And I was like, no, I don't like this.
00:30:24.340 -->
00:30:26.660So I prioritized getting the .vnv done.
00:30:26.660 -->
00:30:30.420And then lo and behold, it magically now tells me exactly what I want for Python.
00:30:30.420 -->
00:30:31.000Nice.
00:30:31.000 -->
00:30:32.100Wow, that's super cool.
00:30:32.100 -->
00:30:33.380Yeah, now we know.
00:30:33.380 -->
00:30:34.240Starship, fantastic.
00:30:34.240 -->
00:30:39.400Yeah, so before we move on, I'd like to thank our sponsor.
00:30:39.400 -->
00:30:43.060So this episode of Python Bytes is brought to you by Datadog.
00:30:43.060 -->
00:30:47.840Are you having trouble visualizing latency, CPU, and memory bottlenecks in your apps?
00:30:47.840 -->
00:30:51.380And not sure where the issue is coming from or how to solve it?
00:30:51.380 -->
00:30:56.640Datadog seamlessly correlates logs and traces at the level of individual requests
00:30:56.640 -->
00:30:59.720allowing you to quickly troubleshoot your Python application.
00:30:59.720 -->
00:31:05.020Plus, their continuous profiler allows you to find most resource-consuming parts
00:31:05.020 -->
00:31:09.860in your production code all the time at any scale with minimal overhead.
00:31:09.860 -->
00:31:13.700Be the hero that got your app back on track at your company.
00:31:13.700 -->
00:31:18.440Get started today with a free trial at pythonbytes.fm/Datadog
00:31:18.440 -->
00:31:22.000or just click the link in your podcast player show notes.
00:31:22.000 -->
00:31:22.820Ooh, that's neat.
00:31:22.820 -->
00:31:23.780Yeah, very cool.
00:31:23.780 -->
00:31:24.320Thanks, Datadog.
00:31:24.720 -->
00:31:28.220So, Brett, I want to take you down a little bit lower.
00:31:28.220 -->
00:31:32.640If it's turtles all the way down, a few turtles down to this whole TUI world
00:31:32.640 -->
00:31:36.680and talk about this thing called build a text editor with Python and curses.
00:31:36.680 -->
00:31:40.800Is curses, is that what you do when you get upset because it's too low level?
00:31:40.800 -->
00:31:42.360Or, oh, no, it's about the curses.
00:31:42.360 -->
00:31:42.620Sorry.
00:31:43.020 -->
00:31:43.220Okay.
00:31:43.220 -->
00:31:45.520Got to remember, I'm on the Python Bytes podcast.
00:31:45.520 -->
00:31:46.820There are going to be jokes like that.
00:31:46.820 -->
00:31:48.740They're going to be bad, too, by the way.
00:31:48.740 -->
00:31:56.340So, no, here's a really cool article by Wasim Lorgat about basically walking you through building
00:31:56.340 -->
00:32:02.220a text editor like Vim or Emacs in the terminal using curses, which is a library that lets you
00:32:02.220 -->
00:32:06.800control what happens on the screen much better than, like, print and log and warn and whatnot.
00:32:07.320 -->
00:32:09.540So, there's a couple of just interesting things.
00:32:09.540 -->
00:32:12.420I thought going through this might just give people a sense of, like, what it's like to
00:32:12.420 -->
00:32:13.060work with curses.
00:32:13.060 -->
00:32:16.060And then there's this context of this text editor you can play with.
00:32:16.060 -->
00:32:20.440So, for example, a minimal curses app, all you got to do is define a function.
00:32:20.440 -->
00:32:21.700That's your main function.
00:32:21.700 -->
00:32:25.040And then while true, go to the screen and get the key.
00:32:25.040 -->
00:32:25.660And that's it.
00:32:25.660 -->
00:32:26.320You just say get key.
00:32:26.380 -->
00:32:28.140And it just gives you whatever gets pressed.
00:32:28.140 -->
00:32:31.960Without any help here, there's probably not a way to get out of it.
00:32:31.960 -->
00:32:32.780No.
00:32:32.780 -->
00:32:34.200Maybe control C.
00:32:34.200 -->
00:32:36.280But, yeah, there's not, like, a quit or anything.
00:32:36.280 -->
00:32:41.080So, you can really easily add, like, some tests and say, well, if they gave me the key,
00:32:41.080 -->
00:32:43.620you know, escape, then show the little colon.
00:32:43.620 -->
00:32:46.780You can WQ, exclamation mark, whatever, to get out of it.
00:32:46.780 -->
00:32:50.600However you want to exit your text editor that you're building.
00:32:50.600 -->
00:32:53.160And then they talk about how to show stuff on the screen.
00:32:53.360 -->
00:32:58.480So, if you want to just add a line, you can say, at this X, Y screen, you know,
00:32:58.480 -->
00:33:02.400cursor location, just write this line of text on the screen.
00:33:02.400 -->
00:33:04.200And it'll add that.
00:33:04.200 -->
00:33:04.820So, really easy.
00:33:04.820 -->
00:33:08.180And, you know, one of the things they do is they pass over the file name.
00:33:08.180 -->
00:33:09.500And it's kind of meta.
00:33:09.500 -->
00:33:14.140Like, they edit the file that is the demo for the editor with the editor as they're building it,
00:33:14.140 -->
00:33:15.160which is always fun to do.
00:33:15.160 -->
00:33:17.740So, you can do that.
00:33:17.740 -->
00:33:22.880But then, through this article, they go through and they build out, like, a window class
00:33:22.880 -->
00:33:24.700that talks about how big is the screen.
00:33:24.700 -->
00:33:26.100This is what Brett was talking about.
00:33:26.100 -->
00:33:28.920Like, ah, I got to figure out what my screen looks like and all that stuff.
00:33:28.920 -->
00:33:31.220And also, a cursor where you are on the screen.
00:33:31.220 -->
00:33:34.720How to have, like, a view into the file.
00:33:34.720 -->
00:33:37.180Because you might have, like, moved to the right a little bit.
00:33:37.180 -->
00:33:38.700And the file might be a thousand lines.
00:33:38.700 -->
00:33:41.260But you've only got a 40 on your screen or whatever.
00:33:41.260 -->
00:33:43.420So, anyway, if this is interesting to you,
00:33:43.420 -->
00:33:45.520I think you should go through this article and check it out.
00:33:45.520 -->
00:33:49.540In the end, you end up with a pretty simple but non-trivial little text editor
00:33:49.540 -->
00:33:50.580that lets you do stuff.
00:33:50.900 -->
00:33:51.860So, I think it's pretty neat.
00:33:51.860 -->
00:33:52.680What do you guys think?
00:33:52.680 -->
00:33:56.060This shows me why I really hope Will grants Brian's wish
00:33:56.060 -->
00:33:58.240of making Rich a full ty library.
00:33:58.240 -->
00:33:59.260Yeah.
00:33:59.260 -->
00:34:00.260I do agree.
00:34:00.260 -->
00:34:04.780I think if Rich, if something like that that has a really beautiful display technology,
00:34:04.780 -->
00:34:06.320but also has input.
00:34:06.320 -->
00:34:09.560Like, this is cool because it has a really great way to accept user input
00:34:09.560 -->
00:34:10.900and, like, update the screen.
00:34:10.900 -->
00:34:12.260But it's very low level.
00:34:12.260 -->
00:34:16.620It's like, I don't know, it's OpenGL versus Pi game or arcade.
00:34:16.620 -->
00:34:20.960You're, like, at the level of, here's what I put at this cursor, this XY coordinate.
00:34:20.960 -->
00:34:21.740Let's put that there.
00:34:21.740 -->
00:34:22.200Yeah.
00:34:22.200 -->
00:34:26.520I think it's a great showing of actually how much work it actually needs to go into making
00:34:26.520 -->
00:34:31.460those full text-based UIs that you see, like you used to see at the grocery store and those
00:34:31.460 -->
00:34:34.660screen, you probably still do at some of your grocery stores on that screen and just like,
00:34:34.660 -->
00:34:38.140or when they book your airline ticket and you're like, oh my God, what the hell are you using?
00:34:38.140 -->
00:34:39.260You do this all day?
00:34:39.260 -->
00:34:40.620Yeah, exactly.
00:34:40.620 -->
00:34:42.960It takes a lot of work to make those things happen.
00:34:43.080 -->
00:34:48.620It's surprising how much work it is and hence why getting higher level libraries like,
00:34:48.620 -->
00:34:52.800I think, that was the prompt toolkit we were told about earlier and Rich and all that would
00:34:52.800 -->
00:34:55.160be very welcome in existing.
00:34:55.160 -->
00:34:56.000Yeah, absolutely.
00:34:56.000 -->
00:34:59.480Do you got, either of you guys know if there's any curses libraries for Windows?
00:34:59.480 -->
00:35:01.060Magnus is asking.
00:35:01.060 -->
00:35:05.020That's why he's used prompt toolkit before, but I'm not sure actually.
00:35:05.020 -->
00:35:05.900Neither am I.
00:35:05.900 -->
00:35:06.480Yeah.
00:35:06.480 -->
00:35:06.900Yeah.
00:35:06.900 -->
00:35:07.600Cool, cool.
00:35:07.600 -->
00:35:08.240All right.
00:35:08.240 -->
00:35:09.920What's the next one?
00:35:09.920 -->
00:35:11.200Brian, you got the next one, right?
00:35:11.800 -->
00:35:12.900Actually, I skipped.
00:35:12.900 -->
00:35:14.340So, Brett's next.
00:35:14.340 -->
00:35:16.280All right, Brett's next and I'll pull up Brett's thing.
00:35:16.280 -->
00:35:16.800All right, Brett.
00:35:16.800 -->
00:35:17.540Okay.
00:35:17.540 -->
00:35:23.280So, there's been a major language feature announced that is coming in 3.10, right?
00:35:23.280 -->
00:35:30.920Yes, which actually was in your quick links at the end of episode 220, which Brian called
00:35:30.920 -->
00:35:34.140the five-barrel foot gun, which is pattern matching.
00:35:34.140 -->
00:35:41.020So, one of the things that always happens whenever there's a new Python feature that gets announced,
00:35:41.020 -->
00:35:46.020and especially one of this size that gets out into the general community, is some interesting
00:35:46.020 -->
00:35:47.260feelings from people.
00:35:47.260 -->
00:35:54.720And so, this is kind of slash, I don't want to say rant, but a little just me as a steering
00:35:54.720 -->
00:35:59.940council member just trying to explain how this all came about, where we're coming from as
00:35:59.940 -->
00:36:01.520a steering council in general.
00:36:01.660 -->
00:36:06.000I mean, obviously, I'm speaking for me directly, but generally, I think how the steering council
00:36:06.000 -->
00:36:06.440kind of thought.
00:36:06.440 -->
00:36:10.140But also, just kind of helping put all this in perspective, because I think for a lot of
00:36:10.140 -->
00:36:13.960people, this might be the first big feature that they've seen, because we used to do this
00:36:13.960 -->
00:36:14.920all the time in Python 2.
00:36:15.400 -->
00:36:17.800But things kind of slowed down for Python 3.
00:36:17.800 -->
00:36:22.720So, as I said, I've seen around the internet a lot of people ranging from, oh, this looks really cool.
00:36:22.720 -->
00:36:26.820I can't wait till I can use it, to people screaming bloody murder that we're killing Python.
00:36:26.820 -->
00:36:29.040And oh my God, it's the death knell of the language.
00:36:29.040 -->
00:36:30.980I've been doing this for 17 years.
00:36:30.980 -->
00:36:31.660Is it stressful for you?
00:36:31.660 -->
00:36:33.360Because it used to be?
00:36:33.360 -->
00:36:35.080It used to be stressful.
00:36:35.080 -->
00:36:36.420Now, it's just frustrating.
00:36:36.420 -->
00:36:40.960So, for instance, I gave a talk at PyCon US 2018.
00:36:40.960 -->
00:36:43.760It was one of the keynotes about participating in open source.
00:36:43.760 -->
00:36:47.980And one of the key things I said in it was people just need to try to be kind to each other.
00:36:47.980 -->
00:36:50.740It's kind of a very generic thing, I know.
00:36:50.740 -->
00:36:52.500But it really makes a difference.
00:36:52.500 -->
00:36:58.780As a project maintainer myself, having people tell me what they think I need to be doing or what
00:36:58.780 -->
00:37:01.540I should be doing is really frustrating, right?
00:37:01.540 -->
00:37:04.940Like, I put my personal time and effort into helping make this happen.
00:37:04.940 -->
00:37:09.720And the way you respond to that is telling me what I should be doing.
00:37:09.720 -->
00:37:10.180Yeah.
00:37:10.180 -->
00:37:15.800Like, I can only imagine people who are parents having other people tell them how they should
00:37:15.800 -->
00:37:16.680be raising their children.
00:37:16.680 -->
00:37:18.680It's worse than helicopter parents.
00:37:18.680 -->
00:37:20.780It's like helicopter backseat parenting.
00:37:20.780 -->
00:37:21.460Exactly.
00:37:21.460 -->
00:37:25.200And it's kind of the equivalent for open source maintainers.
00:37:25.200 -->
00:37:26.900People doing the backseat.
00:37:27.220 -->
00:37:31.800Oh, here's what you really should be doing with your free time, with what little time
00:37:31.800 -->
00:37:33.140you have left on this planet, right?
00:37:33.140 -->
00:37:33.580Yeah.
00:37:33.580 -->
00:37:37.300So it used to get really upsetting.
00:37:37.300 -->
00:37:41.420And now I'm just frustrated and just disappointed that this still happens.
00:37:41.420 -->
00:37:44.520It's also a little weird, too, because in Python, right?
00:37:44.520 -->
00:37:47.580I mean, we have tens of millions of people using language at this point, right?
00:37:47.580 -->
00:37:48.800It's immeasurable.
00:37:48.800 -->
00:37:50.000It's just cute.
00:37:50.000 -->
00:37:54.920Which means even if you assume one out of a thousand people are jerks, right?
00:37:54.920 -->
00:37:55.8000.1%.
00:37:55.800 -->
00:37:57.860Let's do 0.01%, right?
00:37:57.860 -->
00:38:01.980Like, we're still talking tens of thousands of people out there who basically know my face,
00:38:01.980 -->
00:38:07.600name, and address and feel totally fine sending me mail on occasion or just posting out in the
00:38:07.600 -->
00:38:12.440comments outside where we all congregate about what they think I should be doing with my life.
00:38:13.160 -->
00:38:17.680So it's one of these things where it's just frustrating.
00:38:17.680 -->
00:38:20.000I don't know how a lot of people feel about it.
00:38:20.000 -->
00:38:20.140Sorry.
00:38:20.140 -->
00:38:24.860But I think when you hear those negative things said to you, even if a thousand people are
00:38:24.860 -->
00:38:28.520appreciative, the one negative thing you get feels so much.
00:38:28.520 -->
00:38:31.240It makes such a bigger disproportionate impact.
00:38:31.240 -->
00:38:32.380Yeah, at least.
00:38:32.380 -->
00:38:32.940At least.
00:38:32.940 -->
00:38:33.400At least.
00:38:33.500 -->
00:38:35.620And the problem is it's not relative numbers.
00:38:35.620 -->
00:38:36.660It's absolute numbers.
00:38:36.660 -->
00:38:40.860And at the scale that we're at with Python, the absolute number of people who just don't
00:38:40.860 -->
00:38:44.760haven't quite either just, I mean, honestly, some people are just totally ignorant that they
00:38:44.760 -->
00:38:48.440are speaking this way and that they don't really realize the way they're phrasing things matters
00:38:48.440 -->
00:38:51.060or even that the way they're phrasing it comes off that way.
00:38:51.060 -->
00:38:53.980Like not everyone who says should really means for it to come off that way.
00:38:53.980 -->
00:38:54.580Thank you, Dean.
00:38:54.580 -->
00:38:57.220I appreciate the awesomeness call out.
00:38:57.220 -->
00:39:03.020But it's one of these things where I have to bring this up every couple of years.
00:39:03.020 -->
00:39:06.520And then I usually end up doing a blog post, which honestly, this is kind of a rough draft
00:39:06.520 -->
00:39:07.260of the blog post.
00:39:07.260 -->
00:39:08.800I'm just talking out loud with all of you.
00:39:08.800 -->
00:39:09.020Yeah.
00:39:09.020 -->
00:39:12.640And bouncing ideas off all of you for the feedback.
00:39:12.640 -->
00:39:17.000But it's just it gets a little exhausting that this is something I have to bring up every
00:39:17.000 -->
00:39:17.560couple of years.
00:39:17.560 -->
00:39:20.260You'd hope that we'd all learn this by now.
00:39:20.260 -->
00:39:23.160It's not like open source is a new newfangled thing we've all just discovered.
00:39:23.160 -->
00:39:28.740But there's still this disconnect between the consumer slash user slash takers of open
00:39:28.740 -->
00:39:33.420source versus the maintainer slash producer slash givers of the community.
00:39:33.420 -->
00:39:37.500And the disconnect of how to kind of just communicate with each other is still there.
00:39:37.500 -->
00:39:42.240And so specifically when it comes to this stuff with Python, right, is people go like, oh, my
00:39:42.240 -->
00:39:43.360God, this is crazy.
00:39:43.360 -->
00:39:45.400And it's like, no, it's not.
00:39:45.400 -->
00:39:47.020I've been doing this for 17 years.
00:39:47.020 -->
00:39:49.320Everything is controversial when it comes to syntax.
00:39:49.320 -->
00:39:51.920True and false were controversial, right?
00:39:51.980 -->
00:39:53.260Like true and false.
00:39:53.260 -->
00:39:56.920There were arguments on Python dev and whether or not we should add those keywords because
00:39:56.920 -->
00:40:01.620they would break code that chose to define those constants as one and zero.
00:40:01.620 -->
00:40:03.780Is that why it's capital T?
00:40:03.780 -->
00:40:05.840Well, it's also because they're singletons, right?
00:40:05.840 -->
00:40:07.700And that's just kind of the practice we follow with none.
00:40:07.700 -->
00:40:09.680So that was really kind of where it tied in.
00:40:09.680 -->
00:40:13.560I mean, it definitely helped that capital T lower the chance.
00:40:13.560 -->
00:40:14.340It's less likely.
00:40:14.340 -->
00:40:15.020Yeah, exactly.
00:40:15.020 -->
00:40:15.640It's less likely.
00:40:15.640 -->
00:40:20.140But that was an actual discussion we had was do we want to add booleans to the language?
00:40:20.140 -->
00:40:23.120Now, today, everyone scoffs at that and laughs.
00:40:23.120 -->
00:40:23.880Like, what?
00:40:23.880 -->
00:40:24.700Are you kidding me?
00:40:24.700 -->
00:40:25.120Booleans?
00:40:25.120 -->
00:40:25.460Really?
00:40:25.460 -->
00:40:28.540Everything in the language gets debated, right?
00:40:28.540 -->
00:40:29.880And in this too, right?
00:40:29.880 -->
00:40:31.560Like everyone's going like, oh, my God, what are you doing?
00:40:31.560 -->
00:40:33.420Like, do you understand the timeline of this?
00:40:33.420 -->
00:40:37.620Guido brought this up, I think, in July, maybe?
00:40:37.620 -->
00:40:43.540And had as one pep, got a massive amount of feedback on Python dev on this, went back with
00:40:43.540 -->
00:40:49.340his co-authors, broke it up into three peps, 634, 635, and 636, so that there was a pep
00:40:49.340 -->
00:40:52.900about the design, a PEP about the rationale behind the design, and a PEP that acts as
00:40:52.900 -->
00:40:55.920a tutorial to try to make it more easy to consume.
00:40:55.920 -->
00:40:57.540Brought that out in October.
00:40:57.540 -->
00:41:00.280We discussed it on Steering Council 2020.
00:41:00.280 -->
00:41:04.120We made a recommendation that probably the next one should accept it, but we still didn't
00:41:04.120 -->
00:41:06.340feel we had enough time to accept such a large thing.
00:41:06.340 -->
00:41:10.580Fast forward now to today, where Steering Council 2021 had a chance to sit down and look
00:41:10.580 -->
00:41:14.560at the recommendation and the peps and have a discussion, including calling Guido in personally
00:41:14.560 -->
00:41:19.100at least two times to talk directly to the Steering Council to help us understand where
00:41:19.100 -->
00:41:19.860he was coming from.
00:41:19.860 -->
00:41:23.040Like, this was not a snap decision, but everyone acts like it was.
00:41:23.040 -->
00:41:23.400Right.
00:41:23.400 -->
00:41:24.280This is literally taking over half.
00:41:24.280 -->
00:41:27.120It finally appears on their radar, and they're like, oh, where'd this come from?
00:41:27.120 -->
00:41:27.640Exactly.
00:41:27.640 -->
00:41:29.260Oh, it's like on Hacker News today.
00:41:29.260 -->
00:41:30.020Suddenly it happened.
00:41:30.020 -->
00:41:30.580Like, no, no, no.
00:41:30.580 -->
00:41:31.180This has been happening.
00:41:31.180 -->
00:41:35.000This has been in discussion actively in public for six months.
00:41:35.000 -->
00:41:40.280I first heard Guido talking with someone at a language summit in 2018 about the idea of
00:41:40.280 -->
00:41:40.780pattern matching.
00:41:40.780 -->
00:41:44.480Like, this has been on people's radar as something people have wanted for that long.
00:41:44.480 -->
00:41:46.280And I'll fully admit I wanted it.
00:41:46.280 -->
00:41:48.480Like, pattern matching is something I've wanted for a long time.
00:41:48.480 -->
00:41:52.980But it's just one of these things, once again, people just don't stop and think about the
00:41:52.980 -->
00:41:55.180time and effort that go into all this behind the scenes.
00:41:55.180 -->
00:42:00.200It's just, in my worldview, this just happened versus, oh, there's probably stuff that happened
00:42:00.200 -->
00:42:01.340that I'm just not aware of.
00:42:02.280 -->
00:42:06.760And specifically about this, one thing I always notice about this is people need to understand
00:42:06.760 -->
00:42:08.060the way the language is designed, right?
00:42:08.060 -->
00:42:10.440Like, we aim to increase your productivity.
00:42:10.440 -->
00:42:12.700Now, that means different things to different people.
00:42:12.700 -->
00:42:16.000But in general, it means keeping a language that's easy to understand and small enough to
00:42:16.000 -->
00:42:21.000have in your head, but also leads to you being more productive, which also means readability,
00:42:21.000 -->
00:42:21.220right?
00:42:21.220 -->
00:42:26.820There's a lot of side effects that we all appreciate that come with productivity, but that's
00:42:26.820 -->
00:42:27.760really the ultimate goal to me.
00:42:27.760 -->
00:42:29.360It's not that the language is readable.
00:42:29.360 -->
00:42:30.760Readable makes you productive.
00:42:31.240 -->
00:42:34.340And for pattern matching, there are certain algorithms that are just really difficult
00:42:34.340 -->
00:42:36.640to do without pattern matching, right?
00:42:36.640 -->
00:42:38.660Like the classic examples are parsers and compilers.
00:42:38.660 -->
00:42:42.620And they're not easy to do without having pattern matching.
00:42:42.620 -->
00:42:45.500There's a reason why functional programming languages that have had pattern matching for
00:42:45.500 -->
00:42:51.420a very long time are the best places right now to typically write a parser or compiler because
00:42:51.420 -->
00:42:54.060it just, the algorithm just works so much better that way.
00:42:54.340 -->
00:42:56.300So there were reasons why we brought this in.
00:42:56.300 -->
00:42:58.740There will be increases in productivity for some people.
00:42:58.740 -->
00:43:02.740We do realize that it is a big lift, but we also realize not everyone's going to see this
00:43:02.740 -->
00:43:03.740day one, right?
00:43:03.740 -->
00:43:08.420This is not, it is way more than a switch statement, which I know a lot of people typically look at
00:43:08.420 -->
00:43:09.000it as, right?
00:43:09.000 -->
00:43:11.680But the key point is it matches on structure.
00:43:11.680 -->
00:43:12.560It's not a mat.
00:43:12.660 -->
00:43:14.780It's not matching necessarily just on value, right?
00:43:14.780 -->
00:43:17.400This is the big difference between an if statement versus not.
00:43:17.400 -->
00:43:19.700And so there was a lot of work behind this.
00:43:19.700 -->
00:43:21.700So there are reasons.
00:43:21.700 -->
00:43:22.980Like this was not major.
00:43:22.980 -->
00:43:26.660The other thing I keep seeing about this is people going, oh, this is not Pythonic.
00:43:26.660 -->
00:43:27.960Well, I hate to break it to people.
00:43:27.960 -->
00:43:28.720Well, it is now.
00:43:29.000 -->
00:43:33.180Yeah, I hate to break it to people, but Guido Van Rossum, the creator of Python, and that's
00:43:33.180 -->
00:43:37.760probably the harbinger of what is Pythonic, is a co-author and a big pusher of this pep,
00:43:37.760 -->
00:43:38.000right?
00:43:38.000 -->
00:43:39.500Like Guido helped make this happen.
00:43:39.500 -->
00:43:44.100So unless you want to go up to him at PyCon and tell Guido that he doesn't know what's Pythonic
00:43:44.100 -->
00:43:47.540or what's not, I think we kind of just have to go with it that this is now what is considered
00:43:47.540 -->
00:43:47.960Pythonic.
00:43:47.960 -->
00:43:52.340And I will say, I have seen people say, oh my God, this is what happens when we lose the
00:43:52.340 -->
00:43:52.900BDFL.
00:43:52.900 -->
00:43:56.680Like the person who was the BDFL made this happen, right?
00:43:56.680 -->
00:43:57.720Yeah, it's not that.
00:43:57.880 -->
00:43:59.680It's not a really funny disconnect with people.
00:43:59.680 -->
00:44:02.340Like Guido drove this.
00:44:02.340 -->
00:44:04.600Like Guido talked to the steering council about this.
00:44:04.600 -->
00:44:06.180Like he was the point person for this.
00:44:06.180 -->
00:44:07.620Like he really helped make this happen.
00:44:07.620 -->
00:44:13.340So it's as Pythonic as it can be if you consider Guido the creator and head person in terms of
00:44:13.340 -->
00:44:15.820the design of the language, which I will fully admit I still do.
00:44:15.820 -->
00:44:18.220I kind of view Guido no longer as being BDFL.
00:44:18.220 -->
00:44:23.100It's kind of, he relinquished bureaucratic overhead costs in his life of the language.
00:44:23.100 -->
00:44:24.880And the steering council has more or less taken that on.
00:44:24.880 -->
00:44:27.300But I still trust Guido's gut more or less.
00:44:27.440 -->
00:44:29.440Like if he really went off the rails, we'd stop him.
00:44:29.440 -->
00:44:30.980But I don't think this is him going off the rails.
00:44:30.980 -->
00:44:34.140I think this is us going like, he's that one step ahead of us.
00:44:34.140 -->
00:44:35.400Yeah.
00:44:35.400 -->
00:44:40.680And Echelion says, I just wrote a horrible if LF statement and he's looking forward to pattern
00:44:40.680 -->
00:44:41.000matching.
00:44:41.000 -->
00:44:41.620Yeah.
00:44:41.620 -->
00:44:46.580I mean, there are some real places where I think there's going to be benefits to ways to structure
00:44:46.580 -->
00:44:48.820things that will just make things look better.
00:44:49.380 -->
00:44:49.500Yeah.
00:44:49.500 -->
00:44:54.200And Magnus says, agrees with me, that Python's full spectrum language and it just extends
00:44:54.200 -->
00:44:54.880that spectrum.
00:44:54.880 -->
00:44:55.500Yeah.
00:44:55.500 -->
00:44:56.080Right.
00:44:56.080 -->
00:44:56.200Yeah.
00:44:56.200 -->
00:44:56.400Yeah.
00:44:56.400 -->
00:44:57.720Thanks for that, Magnus.
00:44:57.720 -->
00:45:02.600It's one of these things I think some people lose track of that being beginner friendly does
00:45:02.600 -->
00:45:04.540not mean only for beginners.
00:45:04.540 -->
00:45:07.040And that's where this productivity thing comes in.
00:45:07.080 -->
00:45:10.340I think that's actually a huge part of Python's success, right?
00:45:10.340 -->
00:45:13.120Visual Basic 6 was awesome for beginners, for example.
00:45:13.120 -->
00:45:14.660But it just stopped.
00:45:14.660 -->
00:45:16.260Like, well, you can't do that here.
00:45:16.260 -->
00:45:17.900You're at the limit.
00:45:17.900 -->
00:45:18.380I'm sorry.
00:45:18.380 -->
00:45:19.500No, I don't want to be at the limit.
00:45:19.500 -->
00:45:20.500I want to learn C++.
00:45:20.500 -->
00:45:21.200Don't make me.
00:45:21.440 -->
00:45:23.800Hey, if you want to be beginner friendly, go code and scratch.
00:45:23.800 -->
00:45:24.300Right?
00:45:24.300 -->
00:45:24.460Yeah.
00:45:24.460 -->
00:45:26.740No one wants the right production code and scratch.
00:45:26.740 -->
00:45:28.980It's great to get going, but there's a limit.
00:45:28.980 -->
00:45:29.560Yeah.
00:45:29.560 -->
00:45:34.200One of the, one of the great quotes that I've heard that I think applies to Python is that
00:45:34.200 -->
00:45:39.000you can, you can do easy things simply, but you can do difficult, difficult things are
00:45:39.000 -->
00:45:39.520possible.
00:45:39.520 -->
00:45:43.800And I know I got that quote wrong, but it's definitely close enough that I'll just go with
00:45:43.800 -->
00:45:43.960it.
00:45:43.960 -->
00:45:46.180Like that is very true.
00:45:46.180 -->
00:45:51.360Like that is the goal here is to make the common things easy and simple.
00:45:51.760 -->
00:45:55.340And make, and definitely approachable and make the hard things at least possible.
00:45:55.340 -->
00:45:56.220And this is part of it.
00:45:56.220 -->
00:45:59.980This opens up the possibility for things that were really difficult to do in Python before
00:45:59.980 -->
00:46:00.280it.
00:46:00.280 -->
00:46:00.480Yeah.
00:46:00.480 -->
00:46:00.860Fantastic.
00:46:00.860 -->
00:46:01.660So, yeah.
00:46:01.660 -->
00:46:05.160So I'm thinking of doing a blog post about this whole rant called the social contract of
00:46:05.160 -->
00:46:07.980open source to try to harp on this whole shoot versus need.
00:46:07.980 -->
00:46:09.260And just, it's okay.
00:46:09.260 -->
00:46:12.900It's, it's, it, I start to criticism is totally acceptable.
00:46:12.900 -->
00:46:16.800It's just be understanding about how you're delivering it because we're all on the internet.
00:46:16.800 -->
00:46:20.440We do here and they indirectly you will suffer because guess what?
00:46:20.520 -->
00:46:23.580That project you're using is going to then suffer based on what you say.
00:46:23.580 -->
00:46:24.220So it does matter.
00:46:24.220 -->
00:46:24.580Yeah.
00:46:24.580 -->
00:46:31.920And just one aside, I think last podcast, Michael said this was influenced from Haskell is actually
00:46:31.920 -->
00:46:35.060the design comes a lot from Scala specifically for this.
00:46:35.060 -->
00:46:38.740But we got this comprehensions from Scala.
00:46:38.740 -->
00:46:41.100So we have actually gotten some nice things out of Scala.
00:46:41.100 -->
00:46:41.580Interesting.
00:46:41.580 -->
00:46:41.860Yeah.
00:46:41.860 -->
00:46:42.160Okay.
00:46:42.160 -->
00:46:43.040Very interesting.
00:46:43.040 -->
00:46:43.380Yeah.
00:46:43.380 -->
00:46:44.140Yeah.
00:46:44.140 -->
00:46:46.840I mean, my feeling is it's, it's a big step.
00:46:46.840 -->
00:46:51.400I think it's going to take some, take a while to really see the value of it.
00:46:51.400 -->
00:46:56.080If you're not working directly in a place where it's one of these algorithms that applies
00:46:56.080 -->
00:46:58.100a lot, but I think it'll be good.
00:46:58.100 -->
00:46:58.520Yeah.
00:46:58.520 -->
00:47:01.660It's definitely one of those things that when you see it for the first time, if you, if you're
00:47:01.660 -->
00:47:05.920not used to using like a language, like most functional languages that have pattern matching,
00:47:05.920 -->
00:47:07.040it just goes like, what?
00:47:07.180 -->
00:47:07.420Why?
00:47:07.420 -->
00:47:07.740Yeah.
00:47:07.740 -->
00:47:11.660And then when, when you get exposed to it, when you start to use it more, it starts much
00:47:11.660 -->
00:47:12.900like learning another programming language.
00:47:12.900 -->
00:47:15.200It starts to tweak your approach to certain algorithms and stuff.
00:47:15.200 -->
00:47:17.600And it's just, it's another tool in your toolbox.
00:47:17.600 -->
00:47:17.960Really?
00:47:17.960 -->
00:47:18.380Nice.
00:47:18.380 -->
00:47:20.880Well, Brian, you've got the follow-up, huh?
00:47:20.880 -->
00:47:21.960Yeah.
00:47:21.960 -->
00:47:26.280So I'm actually, that's why I thought this would be good as a, as a follow-up.
00:47:26.420 -->
00:47:34.340So Guido announced that he wrote the introduction to pattern matching and, and that it's, it's
00:47:34.340 -->
00:47:38.940now part of, it's part of an appendix A of PEP 636.
00:47:38.940 -->
00:47:42.980So I went off and looked at it and it actually really helped me a lot.
00:47:42.980 -->
00:47:49.500So this, this introduction kind of, I actually, I've been trying to follow this PEP and honestly
00:47:49.500 -->
00:47:53.040been confused for a while as to like exactly how it's working.
00:47:53.220 -->
00:47:57.960A lot of people have been focusing on the weird parts, but the easy parts actually are
00:47:57.960 -->
00:47:58.760really nice.
00:47:58.760 -->
00:48:04.660So I really, the, the, there's an example that it starts off with that kind of looks like
00:48:04.660 -->
00:48:06.260a switch statement, right?
00:48:06.260 -->
00:48:10.820So it's a, I want to match a status and like an HTTP status.
00:48:10.820 -->
00:48:15.340And then I do something different based on 400 or 404 or 418.
00:48:15.340 -->
00:48:18.480And then, and then of course we're like, well, what, what about default?
00:48:18.480 -->
00:48:18.820Right?
00:48:18.820 -->
00:48:22.380So there's going to be some sort of fall through that I handle all the other cases.
00:48:22.380 -->
00:48:23.840And there's an example of that.
00:48:23.840 -->
00:48:28.860And I was actually curious, the example here shows using the, just the single underscore
00:48:28.860 -->
00:48:33.580variable, magic variable as a, as, as a catch all.
00:48:33.580 -->
00:48:38.380And so Brett, I was just curious, can I use any variable here or does it need to be the
00:48:38.380 -->
00:48:39.060single underscore?
00:48:39.060 -->
00:48:39.500Do you know?
00:48:40.220 -->
00:48:43.460So I was actually going to come on at this when you were done.
00:48:43.460 -->
00:48:50.000so the underscore actually has some special semantics here because, in most, most
00:48:50.000 -->
00:48:52.720languages that have pattern matching, the underscore represents the wild card.
00:48:52.720 -->
00:48:57.980this has actually been one of the most controversial parts of peps 634 was the selection of this to
00:48:57.980 -->
00:48:59.280stay consistent with other languages.
00:48:59.700 -->
00:49:05.460while I will not suggest to people that there's an opportunity to remove pattern matching
00:49:05.460 -->
00:49:07.920or to necessarily have massive changes to it.
00:49:07.920 -->
00:49:13.400One of the things that if people try this out in real world code and can get feedback to
00:49:13.400 -->
00:49:16.600us well before beta one locks in and gets released.
00:49:16.600 -->
00:49:21.200Cause that's our cutoff, for feature changes, for Python 3.10, which will be in
00:49:21.200 -->
00:49:21.780May.
00:49:21.780 -->
00:49:26.800this is one of those areas where we could, we could actually consider changing, right?
00:49:26.800 -->
00:49:32.720Like fixing up code to change this case, wild card syntax of an underscore to something
00:49:32.720 -->
00:49:34.260else is totally possible.
00:49:34.260 -->
00:49:38.080If we got feedback from the community that, yeah, this really was a nasty sticking point and
00:49:38.080 -->
00:49:39.000really didn't work out well.
00:49:39.000 -->
00:49:44.380So I do want to say that there is still a chance to potentially influence the final outcome
00:49:44.380 -->
00:49:47.140of how the exact exact thing is.
00:49:47.140 -->
00:49:50.580Although I don't want to suggest that because it's not shipped in 3.10 yet, right?
00:49:50.580 -->
00:49:51.380It's exactly.
00:49:51.380 -->
00:49:52.620It's not shipped in 3.10 yet.
00:49:52.620 -->
00:49:56.480so we can tweak if necessary, but don't come out.
00:49:56.480 -->
00:50:00.180I wouldn't suggest people come out and try to completely rewrite the entire syntax.
00:50:00.180 -->
00:50:03.160But in this specific case, yes, it is special.
00:50:03.160 -->
00:50:05.520yes, some people don't like it.
00:50:05.520 -->
00:50:10.560And if enough people really came forward and really said, this is the one thing I'd want to
00:50:10.560 -->
00:50:10.860tweak.
00:50:10.860 -->
00:50:12.780We, I think we'd be open to considering.
00:50:12.940 -->
00:50:16.160Well, the underscore gets used so much for so many interesting things.
00:50:16.160 -->
00:50:17.180Like why not one more?
00:50:17.180 -->
00:50:17.760Make it.
00:50:17.760 -->
00:50:18.560I'm okay.
00:50:18.560 -->
00:50:20.900I personally, I don't care.
00:50:20.900 -->
00:50:22.280I just want to know what it is.
00:50:22.280 -->
00:50:28.700I mean, I didn't like, I didn't like spaces instead of braces when I first hit it.
00:50:28.700 -->
00:50:34.460So, anyway, but what happens if I put it like X there instead of a underscore?
00:50:34.980 -->
00:50:40.260If you put X, so the rules here basically are, if you put a single name that has no dot in
00:50:40.260 -->
00:50:41.480it, it's a binding.
00:50:41.480 -->
00:50:43.920If you put a name there with a dot, it will be a binding.
00:50:43.920 -->
00:50:47.320Now, this is one of the things that I learned from Guido in one of our meetings that really
00:50:47.320 -->
00:50:48.440helped clarify this for me.
00:50:48.440 -->
00:50:53.500And one of the reasons I ended up, voting to accept this was let's look at the, like,
00:50:53.500 -->
00:50:54.680consider these cases, right?
00:50:54.680 -->
00:50:55.340Return codes.
00:50:55.340 -->
00:50:58.020You're probably not going to hard code 400 and 404 and 14.
00:50:58.020 -->
00:51:02.260You're going to import the HTTP dot status module and you're going to specify the constants
00:51:02.260 -->
00:51:03.080from there, right?
00:51:03.080 -->
00:51:03.520Yeah.
00:51:03.520 -->
00:51:06.900Do you really want to rebind those constants by accident in your code?
00:51:06.900 -->
00:51:08.120Oh no.
00:51:08.120 -->
00:51:13.480No, but because it's been imported from a module or off a class, for instance, you're not going
00:51:13.480 -->
00:51:14.480to be wanting to do assignment.
00:51:14.480 -->
00:51:15.800You're just going to want to reference it.
00:51:15.800 -->
00:51:18.420So if there's a dot in the name, it automatically is just a reference.
00:51:18.420 -->
00:51:23.360Now, some people get really hung up on that when they think about the single binding of
00:51:23.360 -->
00:51:24.600a name, understandably.
00:51:24.600 -->
00:51:29.860But here's the thing is, well, this is a case right now where if you had just a bare
00:51:29.860 -->
00:51:33.820name, that's a bind where if there's a dot in it, it's actually going to be a reference
00:51:33.820 -->
00:51:36.460and a load to do a value check.
00:51:36.460 -->
00:51:39.000There is a potential in the future.
00:51:39.000 -->
00:51:43.580If people come back after trying out the PEP and having experience with pattern matching
00:51:43.580 -->
00:51:50.460to add to the language, a leading dot, which is actually used in Swift, by the way, in the
00:51:50.460 -->
00:51:51.960Swift community for something else.
00:51:51.960 -->
00:51:57.860But the key point is we can make it like a dot X to act as a load for comparison for
00:51:57.860 -->
00:51:58.560a local name.
00:51:58.560 -->
00:52:00.480That's an interesting syntactical use.
00:52:00.480 -->
00:52:03.400Like it's not actually coming from anywhere, but treat it as if it were.
00:52:03.400 -->
00:52:04.140Exactly.
00:52:04.140 -->
00:52:09.040Now, this was originally in the PEP and there was massive pushback from people thinking
00:52:09.040 -->
00:52:10.320that they would totally miss the dot.
00:52:11.220 -->
00:52:18.220But Corey Benfield, who used to run requests and all that and has multiple talks from PyCon,
00:52:18.220 -->
00:52:23.280a person who helped me start pushing sans IO development of libraries in the community.
00:52:23.280 -->
00:52:27.320He works at Apple now on Swift stuff and he posted something on Twitter and I asked him
00:52:27.320 -->
00:52:30.180like, hey, does that leading dot have any problems with Swift?
00:52:30.180 -->
00:52:32.600And they said, actually, the whole community is totally fine with it.
00:52:32.600 -->
00:52:33.800There's no readability problems.
00:52:33.800 -->
00:52:34.700It just totally works.
00:52:34.820 -->
00:52:39.940So we could potentially in the next version of Python actually make it so that that that
00:52:39.940 -->
00:52:42.900have it a dot in the name, whether it's just leading or not.
00:52:42.900 -->
00:52:44.220We could actually generalize that.
00:52:44.220 -->
00:52:48.540But because it's a forward compatible thing and backwards compatible, we decided not to
00:52:48.540 -->
00:52:53.700do that in this path and just try to just keep it simple, simple, keep it simpler than
00:52:53.700 -->
00:52:56.700it had to be necessary to go out and then add an opportunity.
00:52:56.780 -->
00:53:02.940So if I just put a bare X, it's going, will it hit it and will it bind to it and assign
00:53:02.940 -->
00:53:04.040the value to X?
00:53:04.040 -->
00:53:05.000Yes.
00:53:05.000 -->
00:53:05.600Okay.
00:53:05.600 -->
00:53:10.240Actually, that's what I expected because as I go down this little tutorial, it talks about
00:53:10.240 -->
00:53:15.600like, un pattern, like unpacking, which is totally cool.
00:53:15.600 -->
00:53:21.100So let's say you have a, like a, the example is a point object, which is like just an XY tuple.
00:53:21.700 -->
00:53:27.720now I want to be able to, if I, in the case statements are, you know, specific points
00:53:27.720 -->
00:53:33.100that you're going to match to, or like, let's say you don't care what X is, but you, you want
00:53:33.100 -->
00:53:39.900to fix Y at zero in, in the case, in the case block, you want to know what the value of X
00:53:39.900 -->
00:53:40.260was.
00:53:40.260 -->
00:53:41.700So you do want that binding.
00:53:41.700 -->
00:53:43.760And that's, that's really just cool.
00:53:43.760 -->
00:53:45.640I just, I can't wait to play with this.
00:53:45.640 -->
00:53:50.060So my, my follow-up question, I'm glad you showed up here is when can I play with this?
00:53:50.060 -->
00:53:52.560Is this in one of the alphas now or betas?
00:53:52.560 -->
00:53:53.120Or do you know?
00:53:53.120 -->
00:53:58.140I don't, there is, I don't know if it's, I don't think it's landed yet.
00:53:58.140 -->
00:54:03.660Bram Butcher, who's one of the coauthors of the PEP has a working implementation already,
00:54:03.660 -->
00:54:07.940which was, which is actually available in a Jupyter was available in a Jupyter notebook
00:54:07.940 -->
00:54:08.540somewhere.
00:54:08.540 -->
00:54:12.100so there's definitely a fork somewhere where you can try this out.
00:54:12.100 -->
00:54:12.580Okay.
00:54:12.580 -->
00:54:17.120but I don't, this is not landed in mainline, so it's not out in an alpha quite yet.
00:54:17.120 -->
00:54:17.480Okay.
00:54:17.480 -->
00:54:20.960one thing I did want to point out about this, that's really kind of cool.
00:54:20.960 -->
00:54:26.280with the example that Brian's showing here, right, is the match against a point argument,
00:54:26.280 -->
00:54:29.020as you said, that takes a two item tuple, right?
00:54:29.020 -->
00:54:33.240You could actually change this to also accept a single item tuple that represented X and Y
00:54:33.240 -->
00:54:34.040with the same value.
00:54:34.040 -->
00:54:35.820And that would totally match separately as well.
00:54:35.820 -->
00:54:36.280Right?
00:54:36.280 -->
00:54:38.620So once again, this is matching against structure.
00:54:38.620 -->
00:54:43.240So you could actually pass in tuples of different sizes and have it automatically just kind of
00:54:43.240 -->
00:54:45.720maybe do something different with 2d or 3d.
00:54:45.720 -->
00:54:46.540Yeah, exactly.
00:54:46.540 -->
00:54:48.020Yeah, exactly.
00:54:48.020 -->
00:54:53.100So because it's a structural thing and not a value thing, it opens those very interesting
00:54:53.100 -->
00:54:53.480doors.
00:54:53.480 -->
00:54:53.880Cool.
00:54:53.880 -->
00:54:54.160Interesting.
00:54:54.160 -->
00:54:54.520Yeah.
00:54:54.520 -->
00:54:54.720Cool.
00:54:54.720 -->
00:54:56.560It's really great to have you here to talk about all this stuff.
00:54:56.560 -->
00:54:58.960final comment, close this one out.
00:54:58.960 -->
00:55:04.280I guess, Zdoc says, I think, once good syntax highlighting lands, this will be as
00:55:04.280 -->
00:55:05.260natural as less comprehension.
00:55:05.780 -->
00:55:06.180Yeah.
00:55:06.180 -->
00:55:07.240And that's actually a good point.
00:55:07.240 -->
00:55:13.040One of the things, we had discussed was like the leading dot would, how hard would
00:55:13.040 -->
00:55:15.240that be to see with or without syntax highlighting?
00:55:15.240 -->
00:55:17.800And we realized that honestly, syntax highlighting will probably do it.
00:55:17.800 -->
00:55:22.380One thing some people were a little worried about was the reason this is even possible was
00:55:22.380 -->
00:55:26.840because of the new parser that landed in Python 3.9, the, new PGM parser.
00:55:26.840 -->
00:55:29.220it can do more contextualized parsing.
00:55:29.220 -->
00:55:33.880So that match, for instance, isn't going to suddenly make all your match keywords or the match
00:55:33.880 -->
00:55:38.380method on from the re module on match objects suddenly not work.
00:55:38.380 -->
00:55:42.220it contextually can tell that that match keyword is for a match statement.
00:55:42.220 -->
00:55:46.200So there might be a little funky coloring for some people based on how your syntax highlighting
00:55:46.200 -->
00:55:46.460works.
00:55:46.460 -->
00:55:49.860Like you might suddenly have all your match methods highlighted like it was the match keyword,
00:55:49.860 -->
00:55:54.540but honestly it'll be from, from, from what you're looking at in terms of the code,
00:55:54.540 -->
00:55:55.500it's going to be fairly obvious.
00:55:55.500 -->
00:55:56.700That is not a match statement.
00:55:56.700 -->
00:56:00.560So we weren't too worried about that kind of, haziness as it were, when it comes to
00:56:00.560 -->
00:56:00.840syntax.
00:56:00.840 -->
00:56:01.280Yeah.
00:56:01.280 -->
00:56:02.040No, this is cool.
00:56:02.040 -->
00:56:04.000I know a guy on the VS Code team.
00:56:04.000 -->
00:56:06.000So yeah, so do I.
00:56:06.000 -->
00:56:09.440You see him every morning in the mirror.
00:56:09.440 -->
00:56:16.720A quick plug and thank you to magic Python, which comes from, the magic Python team,
00:56:16.720 -->
00:56:18.720uh, magic stack, the people who do edge DB.
00:56:19.340 -->
00:56:25.200They actually maintain, the syntax highlighting, that we use in VS Code, as well as
00:56:25.200 -->
00:56:29.140I think is using sublime text and Adam, like they have a generic grammar that they use that
00:56:29.140 -->
00:56:35.660they just auto gen out to, various editors for their syntax, mostly text mate, format,
00:56:35.660 -->
00:56:38.940but, kudos to them for always maintaining that, syntax highlighting.
00:56:38.940 -->
00:56:41.220Cause that's actually what VS Code itself ships in the box.
00:56:41.220 -->
00:56:41.900That's awesome.
00:56:41.900 -->
00:56:42.420Yeah.
00:56:42.420 -->
00:56:42.660Nice.
00:56:42.660 -->
00:56:43.840Brian, I don't have any extras.
00:56:43.840 -->
00:56:44.160Do you?
00:56:44.160 -->
00:56:45.680I don't know.
00:56:46.500 -->
00:56:46.820Right.
00:56:46.820 -->
00:56:50.000Anything else you want to throw out there before we, make a bad joke?
00:56:50.000 -->
00:56:51.860No, just thanks for having me on.
00:56:51.860 -->
00:56:56.620Thank you for everyone listening to me rant on about, how to please try to, talk
00:56:56.620 -->
00:56:58.760to maintainers that help them keep their sanity.
00:56:58.760 -->
00:57:00.220And, that's it.
00:57:00.220 -->
00:57:03.420I hope, I hope people give the Python launcher a shot and it works for them.
00:57:03.420 -->
00:57:03.700Yeah.
00:57:03.700 -->
00:57:04.520That's very exciting.
00:57:04.520 -->
00:57:05.220Let me know.
00:57:05.220 -->
00:57:09.420I can't make any promises about it shipping specifically with Python, but at least it's a
00:57:09.420 -->
00:57:10.440tool there that I find useful.
00:57:10.440 -->
00:57:11.480I hope others do as well.
00:57:11.480 -->
00:57:11.880Cool.
00:57:11.880 -->
00:57:13.060I'll definitely check that one out.
00:57:13.060 -->
00:57:14.060All right.
00:57:14.060 -->
00:57:15.040You guys ready for the joke?
00:57:15.040 -->
00:57:16.280you know, we're.
00:57:16.640 -->
00:57:17.900We're all stuck at home.
00:57:17.900 -->
00:57:22.840And especially if you're single, it's, it's really tricky to, to get out and meet people
00:57:22.840 -->
00:57:24.220and you know, whatnot.
00:57:24.220 -->
00:57:25.980See, see what's going to make you happy.
00:57:25.980 -->
00:57:29.080So I got a joke along those lines to kind of help people out there.
00:57:29.080 -->
00:57:29.460Ready?
00:57:29.460 -->
00:57:30.580All right.
00:57:30.580 -->
00:57:35.800So there's this tweet by Christian, zoo says, if you're not happy, single, you won't
00:57:35.800 -->
00:57:36.860be happy in a relationship.
00:57:36.860 -->
00:57:39.840I mean, we've all heard this, how important it is to be just like content with yourself.
00:57:39.840 -->
00:57:44.620She says, no, true happiness comes from closing 100 Chrome tabs after solving an obscure
00:57:44.620 -->
00:57:46.780programming bug, not from other people.
00:57:46.780 -->
00:57:47.240Come on.
00:57:47.240 -->
00:57:49.660Yeah.
00:57:49.660 -->
00:57:51.180Anyway, I thought that was good.
00:57:51.180 -->
00:57:51.740And Kiki.
00:57:51.740 -->
00:57:56.620Are you, are you two the type of folk who have like a bazillion tabs open at any one time?
00:57:56.620 -->
00:57:59.320Or are you more like only keep open exactly what I'm working on.
00:57:59.320 -->
00:58:00.460And as soon as I'm done, I close them.
00:58:00.460 -->
00:58:07.040I am not a hundred tab person, but what I do sometimes I'll like leave the tabs open.
00:58:07.040 -->
00:58:08.300Like, oh, I'm not done with this.
00:58:08.300 -->
00:58:09.360And so I'll close it.
00:58:09.360 -->
00:58:13.160If I got to reboot the computer, the first thing I do is reopen the browser and say history
00:58:13.160 -->
00:58:14.220restore previous session.
00:58:14.220 -->
00:58:15.460Cause I'm like, there were things in there.
00:58:15.460 -->
00:58:17.460I don't know what I was doing, but I know they're important.
00:58:17.620 -->
00:58:19.720So I may abuse that a little bit.
00:58:19.720 -->
00:58:24.680I, my daughter came to me once and said, I need dad like finals.
00:58:24.680 -->
00:58:26.300And then my laptop is too slow.
00:58:26.300 -->
00:58:27.060I need a new laptop.
00:58:27.060 -->
00:58:28.960Like, okay, well, let's talk about what you're doing.
00:58:28.960 -->
00:58:33.140Well, she was doing like three research projects and had like a hundred tabs open.
00:58:33.600 -->
00:58:35.900I'm like, well, let's just try this first.
00:58:35.900 -->
00:58:39.660Can I, can I tell you about this cool thing called bookmarks?
00:58:39.660 -->
00:58:43.960And anyway, totally fixed it.
00:58:43.960 -->
00:58:45.240So yeah, that's awesome.
00:58:45.240 -->
00:58:47.580Hipster dad showing bookmarks to the youngsters.
00:58:47.580 -->
00:58:49.620Yeah.
00:58:49.620 -->
00:58:53.740Magnus says the number of tabs is a measure of how hard the problem is.
00:58:53.740 -->
00:58:56.880And Niels says a great rant.
00:58:56.880 -->
00:58:57.640Love your work, Brett.
00:58:57.640 -->
00:59:00.180Great to have you on the show, Brett.
00:59:00.180 -->
00:59:01.560Always happy to be on.
00:59:01.560 -->
00:59:02.320Thanks for being here.
00:59:02.320 -->
00:59:02.880Thanks to everyone.
00:59:02.880 -->
00:59:03.280Brian.
00:59:03.280 -->
00:59:03.620Thank you.
00:59:03.620 -->
00:59:04.340Thanks as always.