WEBVTT

00:00:00.001 --> 00:00:04.900
Flask is one of the most popular Python web frameworks, and they have huge news to share

00:00:04.900 --> 00:00:10.880
with us. Flask 2.0 just released after a ton of work, and it's as big a deal as the version

00:00:10.880 --> 00:00:17.600
number suggests. Async changes are coming, Python 3.5 and below, including Python 2 support has been

00:00:17.600 --> 00:00:23.120
dropped, and much, much more. Join me as I discuss Flask 2.0 with David Lord and Philip Jones.

00:00:23.120 --> 00:00:28.360
This is Talk Python To Me, episode 316, recorded May 10th, 2021.

00:00:28.360 --> 00:00:46.100
Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem,

00:00:46.100 --> 00:00:51.060
and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy,

00:00:51.060 --> 00:00:54.800
and keep up with the show and listen to past episodes at talkpython.fm,

00:00:54.800 --> 00:00:57.920
and follow the show on Twitter via at Talk Python.

00:00:58.540 --> 00:01:04.240
This episode is brought to you by us over at Talk Python Training. If you want to learn Flask,

00:01:04.240 --> 00:01:09.380
we built a fantastic course called Building Data-Driven Web Apps with Flask and SQLAlchemy.

00:01:09.380 --> 00:01:15.560
In this course, we built a PyPI.org clone from scratch using Flask and SQLAlchemy. You'll

00:01:15.560 --> 00:01:19.940
learn many of the major ingredients needed to build most web apps. If this sounds amazing,

00:01:19.940 --> 00:01:25.400
just visit talkpython.fm/Flask or email us at sales at talkpython.fm.

00:01:25.400 --> 00:01:29.540
David, Phil, welcome back both of you to Talk Python To Me.

00:01:29.540 --> 00:01:30.880
Hello. Hello. Thank you.

00:01:30.880 --> 00:01:35.320
Yeah, it's great to have you back. David, I've had you on to talk about Flask, and Phil,

00:01:35.400 --> 00:01:41.580
I've had you on to talk about derivatives of Flask, I suppose, about Quart, your project. And

00:01:41.580 --> 00:01:46.260
they're both kind of approaching the same type of thing and then sort of zeroing in. So now we have

00:01:46.260 --> 00:01:50.320
you here together, I suppose, working on Flask 2.0, right?

00:01:50.440 --> 00:01:56.380
It's all merging into one. Not really. Just our efforts. Still separate libraries.

00:01:56.380 --> 00:02:01.060
Yeah, but it's really cool to see you working closely together rather than just two disjoint

00:02:01.060 --> 00:02:04.580
things, right? I think that gives a lot of credibility, especially to Quart, right? Because

00:02:04.580 --> 00:02:08.400
Quart was kind of this experimental thing. And now it's, if not exact, is it a Palette's project

00:02:08.400 --> 00:02:10.680
officially or is it just working more closely?

00:02:10.680 --> 00:02:15.320
It's working more closely. And in addition, it uses VerkZeg now, which it never used before. So

00:02:15.320 --> 00:02:19.420
it's been quite a lot of work in that project to make that possible.

00:02:19.720 --> 00:02:23.300
Yeah, that's really cool. And VerkZeg is like one of these foundational bits of Flask.

00:02:23.300 --> 00:02:24.800
That's what we'll get into, I'm sure.

00:02:24.800 --> 00:02:31.880
Yeah. So the idea is because Quart was supposed to be API compatible with Flask, we want to get it

00:02:31.880 --> 00:02:37.580
using as much of what Flask is using as possible. A long-term plan is to get it using even more

00:02:37.580 --> 00:02:38.380
works in VerkZeg.

00:02:38.380 --> 00:02:42.180
Yeah, yeah. Super cool. Maybe some, it's dangerous as well. Get in there. Who knows?

00:02:42.180 --> 00:02:47.680
It's risky, but you guys can make it happen. All right. Now, before we jump into the main topic,

00:02:47.840 --> 00:02:52.460
Flask 2.0, you both have been on the show before. Often I ask people how they got in programming

00:02:52.460 --> 00:02:56.740
in Python or whatnot. You've both answered that question previously. People can go back and hear

00:02:56.740 --> 00:03:00.740
it if they want. So how much is it catch up? What have you been up to since you've been on the show

00:03:00.740 --> 00:03:02.080
last? Bill, you want to go first?

00:03:02.080 --> 00:03:09.100
Sure. I think in open source sense, it's been, yeah, working a lot on Quart and working more.

00:03:09.100 --> 00:03:12.820
At the time, I don't think I was really helping with the Palette's project. So I've been helping with

00:03:12.820 --> 00:03:19.680
them since. And yeah, just kind of developing those two and doing a lot of work trying to get,

00:03:19.680 --> 00:03:24.580
well, the async support that's now coming to Flask, which is quite exciting. On a kind of personal note.

00:03:24.580 --> 00:03:26.220
Yeah, very exciting. Yeah.

00:03:26.220 --> 00:03:31.380
Yeah, on a personal note, I work in London. So I've just been, I've actually worked for a few

00:03:31.380 --> 00:03:36.320
companies, tried my own startup. It didn't work, sadly. But yeah, working in London now. So that's good.

00:03:36.320 --> 00:03:40.260
Nice. I love London. That's a fantastic town. I haven't been there in a year and a half,

00:03:40.340 --> 00:03:44.920
oddly. I don't know why. And David, how about yourself? Where have you been up to?

00:03:44.920 --> 00:03:49.160
So I'm trying to remember when we did our podcast last, but it must have been like three years ago.

00:03:49.160 --> 00:03:50.020
That's been a while.

00:03:50.020 --> 00:03:57.340
So yeah, after that, I've just been working down the backlog of all the issues on Flask and

00:03:57.340 --> 00:04:01.380
palettes and all that. And now we're finally at the point where I'm confident about releasing

00:04:01.380 --> 00:04:08.160
all this stuff. So yeah, it's just been more and more open source work. And then still working for

00:04:08.160 --> 00:04:12.240
the same company I've been working for for 10 years now. So that hasn't changed at all.

00:04:12.240 --> 00:04:15.360
Yeah, that's cool. And I suspect they're pretty supportive of Flask.

00:04:15.360 --> 00:04:20.000
Oh, yeah, we get to use it internally. I actually introduced Python and Flask to the whole company

00:04:20.000 --> 00:04:21.140
way back in the day now.

00:04:21.140 --> 00:04:24.220
Yeah. I mean, how much of an advantage is that to have somebody like you?

00:04:24.360 --> 00:04:24.800
Yeah.

00:04:24.800 --> 00:04:26.900
We're so familiar with everything, right?

00:04:26.900 --> 00:04:31.640
Yeah. When we're bidding for contracts and stuff, they definitely get to use that as like,

00:04:31.640 --> 00:04:35.780
hey, we've got one of the maintainers of the libraries we want to use. What do you bring to

00:04:35.780 --> 00:04:35.960
this table?

00:04:35.960 --> 00:04:43.120
Yeah, exactly. What's the advantage you have? Well, have you met David? No, that's fantastic.

00:04:43.120 --> 00:04:48.040
That's fantastic. And check this out. You were back on episode 177 and the title was Flask

00:04:48.040 --> 00:04:49.040
goes 1.0.

00:04:49.040 --> 00:04:49.680
Oh my gosh.

00:04:49.680 --> 00:04:55.280
I feel like. Yeah, yeah. This is September 15th, 2018. So it's been a while. But also,

00:04:55.280 --> 00:05:00.320
it's time to have you back because now you guys have incremented the big number in the version.

00:05:00.320 --> 00:05:01.480
Well, not quite. Almost.

00:05:01.480 --> 00:05:02.160
One more day.

00:05:02.160 --> 00:05:03.860
Is it one more day?

00:05:03.860 --> 00:05:04.800
Yeah, it's tomorrow.

00:05:04.800 --> 00:05:09.440
Okay. So for people listening on your podcast player, that's like a week ago.

00:05:09.440 --> 00:05:10.480
Oh, wow.

00:05:10.480 --> 00:05:14.640
People on the live stream, one more day. Fantastic. Super cool. So I see some really interesting

00:05:14.640 --> 00:05:18.960
questions from people who are watching the live stream, but let's dive into a little bit of

00:05:18.960 --> 00:05:23.660
background stuff. And then I think we'll go from there. So I kind of wanted to start with the

00:05:23.660 --> 00:05:29.660
larger landscape of the web. And maybe also you could tell us about, I just threw that out there

00:05:29.660 --> 00:05:33.980
as if people would know the Pallets project. We talked about it a little bit with both of you.

00:05:33.980 --> 00:05:39.020
David, give us an overview of what the Pallets project is because we have Flask and we have

00:05:39.020 --> 00:05:43.240
Quart and then we have these other libraries as well. What's the relationship of all these things?

00:05:43.240 --> 00:05:46.140
I know Quart is its own thing, but it uses like Brickzoic, for example.

00:05:46.140 --> 00:05:51.920
Yeah. Well, Pallets is the organization, like just an open source organization, not an actual

00:05:51.920 --> 00:05:58.500
company or anything that maintains Flask and the libraries that Flask uses. And so that's Flask,

00:05:58.500 --> 00:06:04.980
Ferkzoic, Jinja, Click, It's Dangerous and Markup Safe. And it was started, all these libraries used

00:06:04.980 --> 00:06:11.740
to be maintained by the original author, Armin, and his other group, Poku. And eventually they kind of

00:06:11.740 --> 00:06:18.120
grew larger than that. And the original team kind of grew to do other things. And so he formed Pallets.

00:06:18.120 --> 00:06:23.020
And that's about when I joined and started maintaining everything. Although recently I've come to the

00:06:23.020 --> 00:06:29.300
understanding that as much as I push the name Pallets, I will never have as much name recognition

00:06:29.300 --> 00:06:33.680
as Flask. And so you can also refer to things as Flask and I will know what you're talking about.

00:06:33.680 --> 00:06:38.420
Yeah, no doubt. Like the general Flask obviously is made up of the foundational bits as well.

00:06:38.420 --> 00:06:45.300
Yeah. Yeah. And so Pallets for a very long time was just the GitHub organization that these projects

00:06:45.300 --> 00:06:52.060
repos were under. And I've been working over time to expand that into an actual open source organization,

00:06:52.060 --> 00:06:58.000
kind of not nowhere near this yet, but inspired by like how Django software foundation works and those

00:06:58.000 --> 00:07:03.420
sorts of things where they do things besides just develop. So we've been working on growing the

00:07:03.420 --> 00:07:09.880
community, getting more maintainers involved, running FlaskCon last July, I think. And another

00:07:09.880 --> 00:07:13.220
one is coming up, I think, in November is this tentative schedule.

00:07:13.220 --> 00:07:16.420
Nice. And this is obviously, I would guess, online at this point?

00:07:16.420 --> 00:07:20.820
Yeah, it'll be online still. It was online last time also, and it worked out pretty well. You can go

00:07:20.820 --> 00:07:23.440
find all the videos on PyVideo. They're up there.

00:07:23.440 --> 00:07:27.580
Yeah. Fantastic. Do you have sprints or anything like that around it, or is it just presentations?

00:07:27.580 --> 00:07:32.420
We didn't do sprints last time because it was just our first time running a conference. We'll see what

00:07:32.420 --> 00:07:34.520
happens this year. No concrete plans yet.

00:07:34.520 --> 00:07:40.500
Yeah. Fantastic. All right. I kind of wanted to start off this conversation with a wider view,

00:07:40.500 --> 00:07:47.840
looking at the Python web space. So I put up here for us to look at the Python developer survey from

00:07:47.840 --> 00:07:53.660
the PSF and JetBrains for 2020. Obviously, it's 2021. But the results for that was the last survey

00:07:53.660 --> 00:07:59.280
that have come out. And over there, we've got the web frameworks being used. And these things are never

00:07:59.280 --> 00:08:06.800
comprehensive. There's 6% of other, whatever that means. But we have Flask now clearly being the most

00:08:06.800 --> 00:08:11.720
popular one. So first of all, congratulations on that. That's awesome. I wonder if Quart was folded

00:08:11.720 --> 00:08:16.120
into Flask or if it went into the other, you know, in a person's mind when they clicked the button,

00:08:16.120 --> 00:08:17.280
which did they click, you know?

00:08:17.280 --> 00:08:20.740
I imagine it's probably in the other and a small percentage. Very small.

00:08:20.740 --> 00:08:26.760
Yeah. Nice. Okay. Well, so this is really neat. I guess the big interesting thing here as well,

00:08:26.760 --> 00:08:33.300
beyond, I think it was you and Django, at least in this previous survey in 2019, were just tied,

00:08:33.300 --> 00:08:37.120
basically. So now it's, you had talked about how there's a lot of growth and a lot of momentum.

00:08:37.680 --> 00:08:42.100
And I think it's even more than what you see here on the screen. Like I think a lot of the APIs that

00:08:42.100 --> 00:08:48.640
Flask embraces in the way of doing web programming has been adopted by many of the other new frameworks

00:08:48.640 --> 00:08:54.720
as well. So for example, we have FastAPI making a jump up to 12% here, which is probably the biggest

00:08:54.720 --> 00:08:59.280
difference from the year before as well. What do you think about this picture here? And then like,

00:08:59.280 --> 00:09:04.100
you know, what do you think about just the Python web space in 2021, both of you?

00:09:04.320 --> 00:09:09.200
FastAPI is definitely gaining ground. Flask, I'm continually surprised that so many people use

00:09:09.200 --> 00:09:13.180
Flask. Never. It's hard to wrap your head around like that many people. I was just looking at the

00:09:13.180 --> 00:09:16.980
downloads this morning and it was 14 million in the last 30 days.

00:09:16.980 --> 00:09:19.260
In the last 30 days. That's so insane.

00:09:19.260 --> 00:09:22.520
That's just Flask. Like if you look at like Jinja, because Jinja is used by

00:09:22.520 --> 00:09:27.080
things besides Flask, like Ansible, we're like the 20 somethings.

00:09:27.080 --> 00:09:31.140
Very cool. And you can use Jinja just on its own for super interesting things as well. Like

00:09:31.140 --> 00:09:35.760
I recently did a project where I needed to generate a PDF that was like out of, you know,

00:09:35.760 --> 00:09:40.320
here's data in a dictionary and I need to make a PDF that looks formatted. And I just use Jinja

00:09:40.320 --> 00:09:45.060
and a Jinja template to generate the HTML, then feed it off to a PDF library that made it into

00:09:45.060 --> 00:09:48.060
PDF, right? There's all sorts of little edge cases like that.

00:09:48.060 --> 00:09:51.900
And same with Click. I mean, people use Click to make actual command line applications,

00:09:51.900 --> 00:09:56.320
not just to provide a little CLI for Flask. So yeah, when you look at this, like you,

00:09:56.320 --> 00:09:59.320
like you realize that like, oh, they're also using like all these other libraries,

00:09:59.520 --> 00:10:04.320
but I never really like think about the numbers. I guess every now and then I remember Flask having

00:10:04.320 --> 00:10:08.520
more stars than Django on GitHub, but that was because Django joined GitHub late and they've

00:10:08.520 --> 00:10:14.740
surpassed us now, but that's about the only joke metric I follow really. But yeah, I've seen a lot

00:10:14.740 --> 00:10:20.300
of interest in FastAPI and I think it's a, it's nice to just see that like none of nothing's

00:10:20.300 --> 00:10:24.380
stagnating, you know, like everything, like there's, there's new ideas out there. People are developed,

00:10:24.380 --> 00:10:28.520
like there's stable libraries that continue to develop like us and we were still adding new features.

00:10:28.520 --> 00:10:33.040
And then there's like completely new ideas or new formulations of libraries.

00:10:33.040 --> 00:10:38.400
Yeah. I feel like we're in a bit of a Cambrian sort of thousand flowers blooming type of time. And

00:10:38.400 --> 00:10:42.900
many of them won't survive that, but there's a lot of fresh ideas out there and it's pretty exciting.

00:10:42.900 --> 00:10:49.520
Yeah. Like having a healthy ecosystem, having choice that you can choose whether a certain

00:10:49.520 --> 00:10:53.080
framework is more appropriate for, you know, the project you're starting or working on,

00:10:53.080 --> 00:10:56.400
I think is really powerful for like users and for maintainers.

00:10:56.400 --> 00:10:59.960
Yeah. And you can borrow ideas too. Like, Oh, I see the way FastAPI is doing types,

00:10:59.960 --> 00:11:04.080
like mean this, maybe that makes sense to like allow that as an option somewhere else,

00:11:04.080 --> 00:11:04.760
you know, who knows, right?

00:11:04.760 --> 00:11:10.320
Well, one thing I quite like to take from this list is Falcon has a really quite exciting router.

00:11:10.880 --> 00:11:17.020
And I think it might be a little too, too much for Verksug perhaps, but I've been playing around with

00:11:17.020 --> 00:11:21.720
taking the ideas from Falcon and bringing it to Verksug. So what makes it exciting is it's a very fast

00:11:21.720 --> 00:11:29.140
matching system and yeah, should outperform the Verksug router if we can get it in by a good fraction.

00:11:29.400 --> 00:11:30.280
So that'd be exciting.

00:11:30.280 --> 00:11:33.900
Yeah. There's a lot of interplay here that I think is pretty neat. And while we're on this sort of broad

00:11:33.900 --> 00:11:39.720
topic, Rohit asks out in the live stream, you know, what are the advantages of using Flask over Django?

00:11:39.720 --> 00:11:43.360
Maybe that pairs them up a little bit too tight, but you know, looking at this list,

00:11:43.360 --> 00:11:46.200
these are the ones that probably the trade-offs people are thinking about.

00:11:46.200 --> 00:11:50.180
Yeah. This gets harder for me to answer over time because I haven't used Django in a long time,

00:11:50.180 --> 00:11:53.200
but it's hard to compare them one to one. It's like apples and oranges, right?

00:11:53.200 --> 00:11:58.120
Like I said a couple of minutes ago, like you're choosing the project that's most appropriate or the

00:11:58.120 --> 00:12:02.540
framework that's more appropriate for your project and the way you want to work. So it's not necessarily

00:12:02.540 --> 00:12:08.000
that you're going to be losing out or getting any given feature by choosing one or the other. It's

00:12:08.000 --> 00:12:14.040
about how they feel when you're working on them. You know, like sometimes Django makes more sense to

00:12:14.040 --> 00:12:19.580
people or FastAPI makes more sense or, and then like they also have different goals, right? Like Flask is

00:12:19.580 --> 00:12:27.720
deliberately just the web framework and wrapping some other libraries around it. But its goal is that

00:12:27.720 --> 00:12:34.200
if you want other features, somebody develops an extension that is specific to that and you add

00:12:34.200 --> 00:12:38.920
that on. And I mean, Django and I don't know about FastAPI yet, but like Django has the same idea. It's

00:12:38.920 --> 00:12:43.460
just how many batteries they decide to include is different. Yeah. Yeah. Phil, you want to take a

00:12:43.460 --> 00:12:48.360
shot at this before I give my thoughts as well, maybe? Yeah. I think specifically Flask and Django,

00:12:48.360 --> 00:12:53.480
I always thought it came down to a kind of a choice about how to do things like Flask doesn't really

00:12:53.480 --> 00:12:58.400
give you an answer and you can go and choose from the extensions, whereas Django does. And yeah, I think

00:12:58.400 --> 00:13:03.280
it's like David said, a bit of what your preference is really, what you prefer. Yeah. I mean, Django is

00:13:03.280 --> 00:13:09.100
making huge strides in like async also, and we're adapting to that too, but they all have different

00:13:09.100 --> 00:13:13.280
solutions to the same thing and approaching it from different directions. Yeah, definitely. There's a lot of

00:13:13.280 --> 00:13:18.000
interesting stuff happening in Django around this as well. So the way I see it is, you know, Flask,

00:13:18.000 --> 00:13:23.220
it's like an empty canvas and it's got just a few really nice little building blocks and then you can

00:13:23.220 --> 00:13:27.740
build what you want, right? You want to use Postgres and SQLAlchemy? Great. That's totally easy. You

00:13:27.740 --> 00:13:33.360
want to use MongoDB and MongoEngine? Equally easy. Go have fun, right? Like you, you can pick just the

00:13:33.360 --> 00:13:37.580
little bits that you really like. You don't have any other bits to worry about and then you're good to go,

00:13:37.640 --> 00:13:42.900
right? Django, it's like, well, if you want to break from the Django ORM, probably you can do it,

00:13:42.900 --> 00:13:48.220
but it's, there's a little bit of a mismatch there. You kind of got to work around it. Its advantages

00:13:48.220 --> 00:13:52.400
kind of become less good, right? Like it's admin tools might not work as well if you try to say

00:13:52.400 --> 00:13:58.060
switch to Mongo or something along those lines. And if what you want is like, I'm not really sure what

00:13:58.060 --> 00:14:03.540
I'm doing to build this website. And I just want some guidance, like just show me the main way and I'll

00:14:03.540 --> 00:14:08.120
just do that. I don't, I just would like to go along for the flow. I think Django is fantastic for that.

00:14:08.120 --> 00:14:13.480
It gives you like really good prebuilt tools, like the admin stuff and whatnot. But if you really care

00:14:13.480 --> 00:14:17.660
very much about which little piece you pick and you want to put them together just so, I feel like you're

00:14:17.660 --> 00:14:22.600
better off with a micro framework of some sort like Flask. That's my, my view. And I know some people

00:14:22.600 --> 00:14:27.440
love one side and hate the other and vice versa. So it's, you know, it's also a personal challenge or a

00:14:27.440 --> 00:14:31.180
personal thing you got to work out for. Where, where do you fit on that spectrum?

00:14:31.180 --> 00:14:36.480
Yeah. I mean, I personally started with Django. Flask was just being started when I was starting

00:14:36.480 --> 00:14:42.320
to learn Python and web frameworks. And then I eventually ran into something where I wanted to

00:14:42.320 --> 00:14:49.180
do things that Django wasn't designed to do, obviously. And I started running into a bunch

00:14:49.180 --> 00:14:50.340
of stuff. And so I switched to Flask.

00:14:50.340 --> 00:14:56.440
Yeah, that's cool. I know if you come from a, an ecosystem where there's like clearly one choice

00:14:56.440 --> 00:15:01.660
for a lot of things, you know, if you come from Ruby, you got, you got rails and the Ruby ORM.

00:15:01.660 --> 00:15:07.540
I'm from Microsoft, you got ASP.NET in a framework, like you don't have decisions. You just do the

00:15:07.540 --> 00:15:12.000
thing. And then eventually you build your app, right? You come to Python, there's like, you know,

00:15:12.000 --> 00:15:15.620
20 different choices at each level. And you're like, this is like the paradox of choice. This,

00:15:15.620 --> 00:15:19.200
even though it's in some ways, it's great. In other ways, you're like, I have no idea what to do.

00:15:19.580 --> 00:15:23.220
And so I think that can be a challenge for people as well. Yeah. But also an advantage

00:15:23.220 --> 00:15:27.460
once you get into it. I think your best bet, if you're asking the question, should I use Django

00:15:27.460 --> 00:15:34.740
or Flask is to just pick one and learn enough, you know, about that framework. And I think you will

00:15:34.740 --> 00:15:38.520
be better equipped to answer that question for your project next time you have to ask it.

00:15:38.520 --> 00:15:39.520
Yeah. Yeah.

00:15:39.520 --> 00:15:40.900
It doesn't really matter what you start with.

00:15:40.900 --> 00:15:46.100
All right. Before we get into a more specific, so sort of a general Flask question as well.

00:15:46.880 --> 00:15:50.600
Ivan says, since Flask started as an April Fool's joke, does the core team,

00:15:50.600 --> 00:15:55.620
David and crew, have any traditions around April Fool's? I haven't thought about that.

00:15:55.620 --> 00:15:58.960
You know, every time somebody brings up that it was made on April Fool's,

00:15:58.960 --> 00:16:01.520
I remember that it was made on April Fool's. I always forget that.

00:16:01.520 --> 00:16:06.120
So I'm guessing not too many ones. Okay.

00:16:06.120 --> 00:16:10.360
We don't have like a birthday party or anything or celebration. Maybe we should.

00:16:10.360 --> 00:16:12.080
We'll bring it up to the community team.

00:16:12.080 --> 00:16:13.060
There you go. There you go.

00:16:13.140 --> 00:16:18.680
I think you put out a blog for last year, 10 years, didn't you? That was quite a good celebration,

00:16:18.680 --> 00:16:19.500
but I think that was about it.

00:16:19.500 --> 00:16:22.520
Oh, maybe it. Yeah. It's been 10 years for a lot of libraries at this point.

00:16:22.520 --> 00:16:28.440
Yeah. Very cool. So let's talk Flask 2.0. You know, it's been a couple of years. It went to 1.0.

00:16:28.440 --> 00:16:33.840
It was on the zero-ver train like so many projects were before then, right? That doesn't really mean

00:16:33.840 --> 00:16:38.440
that it was such a huge transition, but there's a lot of stuff changing, not necessarily in a breaking

00:16:38.440 --> 00:16:43.100
way, but a lot of new things in Flask 2.0. Give us the exciting news.

00:16:43.100 --> 00:16:46.580
Well, the biggest one is probably async. I'll let Phil talk about that.

00:16:46.580 --> 00:16:53.100
Yeah. There's like a async for Flask directly and then like maybe tighter integration with

00:16:53.100 --> 00:16:55.560
Quart type of next level async, right?

00:16:55.560 --> 00:17:01.180
Yeah, exactly. So with Flask 2, you'll be able to write async root handlers, depending on what you like

00:17:01.180 --> 00:17:07.400
to call them, before and after request handlers and teardown functions. So it won't require any

00:17:07.400 --> 00:17:12.460
special effort other than installing Flask with the extra support, but then you can just write async

00:17:12.460 --> 00:17:16.320
and await and carry on with your current setup. You don't have to change anything else.

00:17:16.320 --> 00:17:21.500
Yeah. That's super neat. And you actually gave a talk May 1st or something, 10 days ago.

00:17:21.500 --> 00:17:24.900
What was it called? It was, why isn't Flask async?

00:17:25.500 --> 00:17:30.340
And obviously that's like leading into where things are going. You want to tell people a little

00:17:30.340 --> 00:17:34.900
bit about some of the ideas there? You talked about the history, obviously Flask being a

00:17:34.900 --> 00:17:42.420
WSGI or WSGI application. Those are all naturally having a hard time moving to async because

00:17:42.420 --> 00:17:47.680
the server itself needs to know. But then you also talked about some of the things that are

00:17:47.680 --> 00:17:55.720
happening to allow some async stuff to run directly without any server changes. And then also moving

00:17:55.720 --> 00:17:58.780
to an ASGI server. Yeah. So what's the story there?

00:17:58.780 --> 00:18:04.440
So, yeah. So obviously Flask started as a Whisky framework. I think it was probably Whisky from

00:18:04.440 --> 00:18:09.400
the start, right? So yeah, I know. Yeah. So I couldn't quite remember when Whisky was introduced.

00:18:09.400 --> 00:18:12.540
So yeah. And obviously before Async await is introduced.

00:18:12.540 --> 00:18:16.540
Yeah. We have all these different servers and I don't want to have just this framework run on

00:18:16.540 --> 00:18:20.920
that server. So Whisky is born, right? But born in a world where async was less common.

00:18:20.920 --> 00:18:26.040
Yes. But what it has supported the whole time, and I think what's good to point out is Flask has

00:18:26.040 --> 00:18:32.060
been async the entire time just using greenlets. And a lot of people use that very effectively. I think

00:18:32.060 --> 00:18:37.260
it's absolutely fine. And that for us, I think was one of the key things to bear in mind that

00:18:37.260 --> 00:18:41.920
Flask works async. And if we introduce async await, we can't be breaking that at the same time.

00:18:41.920 --> 00:18:48.200
So that was one of the big constraints really. And then, so for the one side, it's keeping support

00:18:48.200 --> 00:18:52.320
with those existing async solutions. And the other is introducing the async await keywords,

00:18:52.320 --> 00:18:57.480
which I think everyone has heard of the color problem and the virality associated with that,

00:18:57.480 --> 00:19:02.320
which makes it actually really hard to get a little bit deep into the call stack, if you will,

00:19:02.320 --> 00:19:06.640
async without really having to change the whole call stack to async in one sweep.

00:19:06.720 --> 00:19:10.400
Yeah. The challenge, maybe I'll try to give a little bit of background just for people listening

00:19:10.400 --> 00:19:17.080
is if I've got some low level data access library or service access library for like using HTTPX

00:19:17.080 --> 00:19:21.100
or something, in order to await the thing at the bottom, that has to be an async method.

00:19:21.100 --> 00:19:25.580
The next level up in order to call that method, it's got to be async. Then you got to await it.

00:19:25.580 --> 00:19:30.960
So it's method's got to be async. And it just, it goes up the entire call stack in a lot of cases,

00:19:31.040 --> 00:19:35.920
right? Yeah. So what it came down to and what we, what we did was follow Django,

00:19:35.920 --> 00:19:40.980
what Django have already done really. And what they, they figured out is that you can run the

00:19:40.980 --> 00:19:46.220
async event loop in one thread and the greenlet based one or whatever you were doing previously

00:19:46.220 --> 00:19:51.360
in the main thread. And then everything coexists nicely. You just need these wrappers to,

00:19:51.360 --> 00:19:56.020
to move things from one thread to another. And that library, if you're interested, is called

00:19:56.020 --> 00:20:01.860
ASCII ref, but using that allows us to have this async code in the, in the view handler,

00:20:01.860 --> 00:20:06.860
but keep flash synchronous in the rest and keep support with, with greenlet, which is really

00:20:06.860 --> 00:20:12.180
nice. Yeah, that's really nice. And in production in a lot of the servers, it has threaded modes

00:20:12.180 --> 00:20:16.800
already that if like you're awaiting something and then that something talks to a network, like a

00:20:16.800 --> 00:20:22.440
database call or a web service call or something, it's going to release the GIL anyway. And the other

00:20:22.440 --> 00:20:26.500
threads can run. So that can probably push out pretty far just on its own, right?

00:20:26.500 --> 00:20:31.000
Yeah. It's, I think it's been very effective to a lot of companies. I know companies that use it.

00:20:31.000 --> 00:20:35.780
I think it's been really nice. So that's what we've, we've got to, and I think you were talking about

00:20:35.780 --> 00:20:42.060
where can we go? Can we go fully async and ASCII with Flask? And, this is possibly more of my

00:20:42.060 --> 00:20:46.700
personal opinion, right? I'm not sure it is possible to go there with Flask. Cause I think if you do so,

00:20:46.700 --> 00:20:52.720
you end up breaking extension support because it's quite common for extensions to extend the Flask

00:20:52.720 --> 00:20:57.420
Clask and change the methods, but of course they won't be async. So how are they going to deal with

00:20:57.420 --> 00:21:02.500
that? Yeah. There's the compatibility problem. And then there's also just the problem of having

00:21:02.500 --> 00:21:08.120
mark everything as async await, if you mark one thing and we might discover, I'm a little more

00:21:08.120 --> 00:21:13.740
optimistic than Phil, but I'm also not as experienced with it, but I would like it to be possible. Like

00:21:13.740 --> 00:21:19.740
at some point for us, you know, we're focusing on like making a Verixoy sans IO. So it doesn't

00:21:19.740 --> 00:21:25.740
require blocking IO operations when you make requests and stuff so that you can use it in ASGI

00:21:25.740 --> 00:21:30.860
situations. And that's going to be a slow process. We're not like a hundred percent done with it or

00:21:30.860 --> 00:21:38.120
anything like that. But my hope is that as we make Verixoy completely like IO agnostic, we might

00:21:38.120 --> 00:21:44.120
discover some ways to adopt Flask. Yeah. But it's also not a hundred percent necessary because

00:21:44.120 --> 00:21:51.020
cord exists also. That's an interesting point. Maybe there's a way to implement some of those

00:21:51.020 --> 00:21:56.500
extension. So the problem is the extensions override certain functions that are part of the life cycle

00:21:56.500 --> 00:22:01.940
of requests. And those are expected to be synchronous functions because they had been for all of time.

00:22:02.120 --> 00:22:06.980
You can't just make those async and have those extensions still work. You know, at best,

00:22:06.980 --> 00:22:11.920
they're going to be kicking out unstarted co-routines. You know, maybe it's probably worse

00:22:11.920 --> 00:22:16.680
than that, but maybe, maybe that's what they do. I don't know. Something is not going to go super well,

00:22:16.680 --> 00:22:23.420
but maybe you can create synchronous wrappers around the async stuff that can grab a, an event loop and run

00:22:23.420 --> 00:22:27.580
it or something. I don't know. Like some, there could be some sort of an adaptation thing where just the

00:22:27.580 --> 00:22:32.480
sync version maybe it's not quite as fast or something. I'm not sure as much experience you

00:22:32.480 --> 00:22:38.840
guys have. I have a way less than that. So as a caveat, I was going to say, I think with Flask

00:22:38.840 --> 00:22:44.660
too, I think this is, in my opinion, where you want to be because the motivation in my mind is you want

00:22:44.660 --> 00:22:49.380
to use some async based library and there's, there's some exciting ones out there. So I can fully understand

00:22:49.380 --> 00:22:54.980
that. And you can now in Flask and it will work, will work with your existing setups. I think the only

00:22:54.980 --> 00:23:00.640
reason you could want to go fully async is, because you're only using async libraries perhaps,

00:23:00.640 --> 00:23:05.500
or perhaps you might see a bit of performance improvement there, which isn't necessarily

00:23:05.500 --> 00:23:10.300
guaranteed by the way for that though. I think there's court. So I kind of think all the users

00:23:10.300 --> 00:23:15.040
motivations might be covered now, which I think is really exciting. That is very exciting. Yeah. And

00:23:15.040 --> 00:23:20.420
our goal is just to get court and Flask as API compatible as possible. And they're already very,

00:23:20.420 --> 00:23:25.000
very close, but you know, moving, very exciting that. And so like, ideally it should just be a

00:23:25.000 --> 00:23:29.860
drop in like name replace for everything to keep working. Yeah. And you could probably pull it off

00:23:29.860 --> 00:23:35.120
with just the right import statement, import court as Flask or something potentially almost.

00:23:35.120 --> 00:23:37.660
Possibly. I don't know how Phil feels about that.

00:23:37.660 --> 00:23:43.980
No, well, there's a, there's some monkey patching in court where you can tell everything else that

00:23:43.980 --> 00:23:48.940
court is Flask. So you can use some of Flask extensions with court by allowing court to be there.

00:23:48.940 --> 00:23:50.600
And it is Flask. It's just kind of, kind of fun.

00:23:50.600 --> 00:23:53.060
Yeah. Yeah. That is quite, quite wild.

00:23:53.060 --> 00:23:59.760
I did see a question. Will Flask break current extensions? No. Our goal was still compatibility

00:23:59.760 --> 00:24:05.060
and stability. We are, we are making major releases and we are adding new features, but it shouldn't break,

00:24:05.060 --> 00:24:09.740
shouldn't permanently break anything. You know, there might be some unforeseen incompatibility that

00:24:09.740 --> 00:24:13.900
a library needs to update for, but it's not like they will suddenly have to rewrite their whole

00:24:13.900 --> 00:24:15.040
thing async or something like that.

00:24:15.040 --> 00:24:16.740
It's not, if it breaks it, it's not on purpose.

00:24:17.460 --> 00:24:20.060
Yeah. That makes it sound bad too, but.

00:24:20.060 --> 00:24:23.780
No, no. I mean, like your intention is to have it be compatible, right?

00:24:23.780 --> 00:24:28.020
Yeah. Yeah. That's always the intention of these libraries. They're meant to be very stable.

00:24:28.020 --> 00:24:34.220
And it's actually one of the things I've been working on as a maintainer, as I've been maintaining

00:24:34.220 --> 00:24:40.040
these over the years, is when I do make releases or when I make changes, I try to make everything

00:24:40.040 --> 00:24:45.580
show a deprecation warning first and then only remove it in the version after that. So I do

00:24:45.580 --> 00:24:51.580
want to evolve things and refactor things or, you know, identify patterns that weren't great

00:24:51.580 --> 00:24:56.980
or that don't, aren't needed anymore since we're dropping Python 2. I do want to evolve the libraries,

00:24:56.980 --> 00:25:02.160
but I don't want to break anybody without warning them first. And so there's a ton of deprecation

00:25:02.160 --> 00:25:05.920
warnings in all the libraries this time that you'll see if you're running tests.

00:25:05.920 --> 00:25:11.400
That's cool. So speaking of that, yeah, I saw this really nice Flask 2.0 is coming. Please help us test

00:25:11.400 --> 00:25:15.520
by Stetio. I don't know who this is. If you know, maybe you can give him a shout out.

00:25:15.520 --> 00:25:16.480
Oh, that's me. Yeah.

00:25:16.480 --> 00:25:17.580
Oh, is that you?

00:25:17.580 --> 00:25:17.800
Okay.

00:25:17.800 --> 00:25:23.680
Perfect. All right. Yeah. So from you, Phil, and he said from the changelog, one of the things coming,

00:25:23.680 --> 00:25:30.360
well, first of all, one of the things coming is Python 3 plus, sorry, 3.6 plus only dropping 2 for

00:25:30.360 --> 00:25:32.500
sure. And even 3.5. That's pretty interesting.

00:25:32.500 --> 00:25:39.140
Well, 3.5 is end of life now. Yeah. Yeah. It seems so new in my mind, but it's clearly,

00:25:39.140 --> 00:25:40.800
clearly not that new anymore.

00:25:40.800 --> 00:25:45.400
When I first made the announcement of dropping Python 2, 3.5 wasn't going to go end of life

00:25:45.400 --> 00:25:50.940
until like nine months later, but I decided to, I was going to drop 3.5 anyway. We won't usually,

00:25:50.940 --> 00:25:57.080
usually we're going to, our plan is to try to wait for the actual official end of lives for Pythons

00:25:57.080 --> 00:26:02.100
from now on, but 3.5 just, it was so much more convenient to drop it at the same time. And 3.6

00:26:02.100 --> 00:26:07.600
is still supported, but the next versions after these will be 3.7 only because 3.6 will have gone

00:26:07.600 --> 00:26:12.720
end of life probably by the time we make new releases. Right. Right. Okay. Very cool. And how

00:26:12.720 --> 00:26:18.700
much the five versus six, was it just that 3.5 is going out or versus f-strings? We do use f-strings all

00:26:18.700 --> 00:26:23.280
over the place now, but that wasn't the reason. I mean, since we were doing 3.6 plus, I decided to

00:26:23.280 --> 00:26:30.060
like use f-strings in a lot of places. I don't remember what was inconvenient about 3.5, but there,

00:26:30.060 --> 00:26:34.760
I mean, I do remember there was something, this was a year and a half ago now when I made this decision.

00:26:34.760 --> 00:26:40.280
I think async was slightly different. I mean, look, if you're switching to two, it's a chance for a nice

00:26:40.280 --> 00:26:44.600
break from some of these things, even if they've got a few months left. Exactly. Yeah. I was originally like,

00:26:44.800 --> 00:26:52.280
originally 2.0 was just going to be like dropping Python 2 and making maybe a few minor changes. And

00:26:52.280 --> 00:26:58.340
then I got anxiety about making releases and breaking everybody's stuff. And so I just kept

00:26:58.340 --> 00:27:05.240
working on more and more stuff into 2.0 instead of releasing it. But because it's 2.0, that also kind

00:27:05.240 --> 00:27:10.160
of gave me the opportunity to like identify more stuff that I wanted to deprecate than normal maybe,

00:27:10.160 --> 00:27:14.660
or make more bigger features to add. Yeah. But it's a perfect time to do it with

00:27:14.660 --> 00:27:19.280
such a big version number change. I want to pull out a few more things from now that I know it's

00:27:19.280 --> 00:27:26.640
Phil's Reddit post here, which got 1.3, 1,300 upvotes. That's pretty awesome. Short form of decorators.

00:27:26.640 --> 00:27:33.120
So instead of for routes or routes for you in London, instead of app.route, you know,

00:27:33.120 --> 00:27:37.560
specifying get or post, you can just do app.get, app.post. That's easy, but nice.

00:27:37.560 --> 00:27:43.200
Yeah. It's just a bit of a synthetic sugar really. It's a, yeah, should make it a little nicer.

00:27:43.520 --> 00:27:48.140
Going back to the ecosystem, it's something the other frameworks will seem to adopt

00:27:48.140 --> 00:27:52.900
Yeah. Yeah. Yeah. That's one of the big differences I've been seeing from the other

00:27:52.900 --> 00:27:57.580
frameworks that they're very much like Flask, but they kind of put the verbs on the decorators a

00:27:57.580 --> 00:28:01.600
little bit more. So why not take it back? Have you inspired them in the first place? Also,

00:28:01.600 --> 00:28:09.480
you know, blueprints, man, blueprints are something I think do not get enough attention and love because

00:28:09.480 --> 00:28:15.140
they're so nice for organizing your code into little bits and little categories of functionality

00:28:15.140 --> 00:28:20.100
instead of, you know, trying to associate them all with the main app, the at app.

00:28:20.100 --> 00:28:22.340
So there's some news around that for updates as well, right?

00:28:22.340 --> 00:28:22.640
Yeah.

00:28:22.640 --> 00:28:27.580
One of the oldest standing open issues, Phil decided to just like, oh, I can solve this. And he like

00:28:27.580 --> 00:28:29.240
wrote something over a weekend, I think.

00:28:29.240 --> 00:28:30.380
It felt like that.

00:28:30.380 --> 00:28:33.200
Way to go, Phil. Now it's blueprints all the way down.

00:28:33.200 --> 00:28:34.820
Well, I'll let Phil describe it.

00:28:35.920 --> 00:28:42.060
Yeah. It's exactly like you can nest blueprints in blueprints. So I think the kind of code structure

00:28:42.060 --> 00:28:46.300
is really helpful because now it doesn't have to be all in that one blueprint, right? You can split

00:28:46.300 --> 00:28:50.660
over a few files and bring them in, which helps a lot. And there's other structures where maybe you

00:28:50.660 --> 00:28:55.660
want to reuse some part of something in another blueprint. So you just bring in parts, but yeah,

00:28:55.660 --> 00:29:00.660
you can just use that. And you can use the command register blueprint on a blueprint to register the

00:29:00.660 --> 00:29:02.260
blueprint and carry on.

00:29:02.260 --> 00:29:06.560
Yeah. You used to have to say app.registerblueprint and you would give it the blueprint and that would

00:29:06.560 --> 00:29:11.900
help you build up the various pieces. But now you can nest them and they can be more hierarchical,

00:29:11.900 --> 00:29:12.380
which is great.

00:29:12.380 --> 00:29:17.820
Right. Before it was just one layer. You had the Flask app and then the blueprints. And so like each

00:29:17.820 --> 00:29:22.880
blueprint could have a prefix, but people haven't actually asked for it for a while, but it's still

00:29:22.880 --> 00:29:28.300
been an open issue and it doesn't seem unreasonable. People have wanted to like have prefixes for

00:29:28.300 --> 00:29:31.020
prefixes. And so then you get nested blueprints and now it's possible.

00:29:31.020 --> 00:29:33.400
Yeah. Awesome. Let me take a couple of the questions out of life.

00:29:33.400 --> 00:29:33.580
Sure.

00:29:33.580 --> 00:29:38.200
First, Doug Farrell out there. Hey, Doug says, Hey, I'm working on a book that uses Python

00:29:38.200 --> 00:29:44.060
Flask as a primary example application. When might Flask 2.0 be released? And should I plan on updating

00:29:44.060 --> 00:29:49.500
the book to use it? I'm guessing Doug didn't catch the very first opening bit because you said tomorrow.

00:29:49.500 --> 00:29:55.080
Tomorrow. If you're interested in following Pallets news in general, there's at Pallets team on

00:29:55.080 --> 00:30:00.660
Twitter and there's also palletsprojects.com slash blog, which has an RSS feed. And so we actually

00:30:00.660 --> 00:30:04.480
have announced this already, but yeah, it's May 11th tomorrow.

00:30:04.480 --> 00:30:09.140
Fantastic. And then John Sheehan says, you're right. We don't hear enough about blueprints.

00:30:09.140 --> 00:30:11.180
I love blueprints. Yes, absolutely.

00:30:11.180 --> 00:30:12.040
Right.

00:30:12.100 --> 00:30:17.720
So I says, in our Talk Python Training web training course, which is a Flask covers,

00:30:17.720 --> 00:30:23.760
it says Flask basically rebuild pypi.org with Flask. Is it used as a safe to use Flask 2.0? I think so.

00:30:23.760 --> 00:30:27.960
Like David said, there shouldn't be any breaking changes, maybe deprecations. If you see them,

00:30:27.960 --> 00:30:31.960
let me know. I can update that, but I think it should be fine. Right. Same reason that production

00:30:31.960 --> 00:30:34.260
apps work. The, the like example apps should work.

00:30:34.260 --> 00:30:37.500
This is the first time we've tried to do release candidates before we've made releases.

00:30:38.100 --> 00:30:42.160
And so we actually have had release candidates up for about a month now for all the libraries

00:30:42.160 --> 00:30:48.180
where you could test your existing code with the new versions. But I think in the future,

00:30:48.180 --> 00:30:52.280
when we do this, we need to do a better job at advertising that. So something we'll get better

00:30:52.280 --> 00:30:58.560
at over time, but yeah, cool. Wow. People listening now know. Then also I think interestingly related to

00:30:58.560 --> 00:31:04.600
both the micro framework side of the story, but also the new features like, especially the async stuff,

00:31:04.600 --> 00:31:10.480
Rohit asks, which will be the most compatible database to supporting framework for Flask.io on

00:31:10.480 --> 00:31:14.800
one hand, like just do whatever you want. Right. But on the other, you've got Flask SQL

00:31:14.800 --> 00:31:21.460
Alchemy as an extension. You've got the ability to use like tortoise ORM because of the async support.

00:31:21.460 --> 00:31:25.820
Like there are new options, right? What do you think? Yeah. I mean, Flask makes no requirement.

00:31:25.820 --> 00:31:31.240
It doesn't affect what database you use. Flask SQLAlchemy that will have a 3.0 release

00:31:31.240 --> 00:31:37.220
similar to these soon-ish. I think I'm going to take a little break after this release first,

00:31:37.220 --> 00:31:42.560
but it should continue to work. What's the, you know, SQLAlchemy 1.4

00:31:42.560 --> 00:31:47.540
just released with the first async API and they're moving towards 2.0 as well

00:31:47.540 --> 00:31:51.240
with a new API. What's the story around their new

00:31:51.240 --> 00:31:55.180
API and the SQLAlchemy async support with Flask SQLAlchemy?

00:31:55.340 --> 00:32:01.440
Is there anything overlapping there? So Flask SQLAlchemy is compatible with 1.4 right now. I did make a

00:32:01.440 --> 00:32:08.420
little bug fix release recently for that. 2.0 is just deprecating things. So, and nothing that Flask SQL

00:32:08.420 --> 00:32:15.240
Alchemy uses is going away. So it'll work with SQLAlchemy 2.0 when that happens. In terms of the async

00:32:15.240 --> 00:32:21.720
stuff, we might, Flask SQLAlchemy, like the extension might have to do something if we want to enable using

00:32:21.720 --> 00:32:29.280
that pattern. But we might also not because it's using a pretty clever use of greenlets to enable

00:32:29.280 --> 00:32:36.720
compatibility between sync and async code. And Flask's async support should support that out of the box,

00:32:36.720 --> 00:32:40.140
or not out of the box, but it's possible to extend it to do that.

00:32:40.140 --> 00:32:45.180
Yeah, super cool. All right. Another thing I saw in the release notes was that around Werkzeug,

00:32:45.180 --> 00:32:51.060
there's performance improvements coming in Flask and Werkzeug. Want to just give people a little

00:32:51.060 --> 00:32:52.100
insight into what's coming there?

00:32:52.100 --> 00:32:57.460
Yeah. One of the things I think the one that got the most attention, got some interest on the Python

00:32:57.460 --> 00:33:03.240
subreddit, was an improvement we did to the form parsing. So I think there's this issue that's about

00:33:03.240 --> 00:33:08.740
five years old saying it was a bit slow, especially for large files. And as David mentioned earlier,

00:33:08.740 --> 00:33:14.520
we were looking at moving that to be Sans.io. And in the work to do that, the original author of that

00:33:14.520 --> 00:33:18.860
issue actually came back and said, Oh, if you do this, you'll make it a lot quicker as well. And when

00:33:18.860 --> 00:33:24.940
we did that, he pointed out, we've made it about 10 to 15 times quicker than the previous form parser.

00:33:24.940 --> 00:33:29.580
So yeah, so if you're being sent files to your Flask server, it should be a lot quicker.

00:33:29.580 --> 00:33:35.820
Yeah. Form data in general is faster. And then if you're uploading large files, that's way,

00:33:35.980 --> 00:33:40.700
faster than what it used to be. Oh, wow. Like multi-part form upload type of files.

00:33:40.700 --> 00:33:45.840
Yeah. So if you were uploading even like hundreds of megabytes, it could be really slow in some cases.

00:33:45.840 --> 00:33:51.760
And so now you can just upload gigabytes of ISOs if you want. It should work fine.

00:33:51.760 --> 00:33:53.380
Nice. Just like streams in or something.

00:33:53.380 --> 00:33:55.160
I mean, it'll still take as long as it takes to upload.

00:33:55.840 --> 00:34:00.740
Yeah. It doesn't make it worse. I see. Cool.

00:34:00.740 --> 00:34:04.700
But I don't know. I think I'm trying to think if there were any other performance improvements in

00:34:04.700 --> 00:34:10.300
Varick Swag. I know a couple of releases ago, we made a pretty big one where to our URL building,

00:34:10.300 --> 00:34:14.880
which made it like 10 times faster or something that's already released. So, but it has been

00:34:14.880 --> 00:34:15.820
getting faster. Yeah. Okay.

00:34:15.820 --> 00:34:24.160
We haven't measured it. I think the work taking out all the compatibility shims and just going pure Python 3 should be noticeable.

00:34:24.160 --> 00:34:32.340
Yeah. Since we removed all the compatibility code for Python 2 stuff, like literally the .compat.py files are gone

00:34:32.340 --> 00:34:37.280
and all the code that was calling that. There's still some more work to be done on that in terms of like

00:34:37.280 --> 00:34:40.660
accepting both bytes and strings in a lot of places where it doesn't really make sense anymore.

00:34:40.820 --> 00:34:45.240
So there's still some overhead, but there's a lot less compatibility overhead than there was before.

00:34:45.240 --> 00:34:53.900
But yeah, it hasn't been measured, but I expect that to be noticeable because when Virk Swag and Flask first added support for Python 3,

00:34:53.900 --> 00:34:58.040
you know, going the other direction. So it was Python 2 only, and then it became Python 3.

00:34:58.040 --> 00:35:06.840
Some people stuck with like really old versions of Virk Swag and Flask because there was a noticeable performance degradation by adding all that compatibility code.

00:35:06.840 --> 00:35:08.820
So now that it's gone, it should be better.

00:35:09.020 --> 00:35:21.440
Yeah, fantastic. I know the NumPy people, they actually got a lot better. They shrunk their code a bunch by dropping 2.0 or Python 2, 2.7. And similar for you all?

00:35:21.440 --> 00:35:26.540
Yeah, it's just, I mean, besides the performance improvements, it's just more maintainable now.

00:35:26.820 --> 00:35:36.540
I pushed really hard to drop Python 2.0 even before it went end of life. I started thinking about how to do it because I never used Python 2.0 back then, and I still don't know.

00:35:36.540 --> 00:35:46.860
So every time I had to fix something, I had to like, oh gosh, now I got to run the Python 2.0 version of the tests and figure out how to like make some weird compatibility shim, you know, between the two.

00:35:47.280 --> 00:35:50.780
So it was a nightmare maintenance for like maintainers and contributors.

00:35:50.780 --> 00:35:58.280
Yeah, I was going to say it's probably easier for contributors as well now to come in because they don't have to, you know, a lot of people these days, they don't know Python 2, right?

00:35:58.280 --> 00:35:59.020
Right, exactly.

00:35:59.180 --> 00:36:05.240
They don't want to come in and like learn, you know, something from 10 years ago so they can keep it compatible. They just want to add the new feature.

00:36:05.240 --> 00:36:18.160
Yeah. If you somehow have like a Python 3.5 application still, you can stick with Flask 1.1. You'll still get your application working just fine. I mean, we're not going to be supporting it because we just don't have that capacity.

00:36:18.160 --> 00:36:26.040
But the libraries are fairly stable, you know, like we almost never get bug reports asking us to backport something, for example.

00:36:26.040 --> 00:36:31.760
You know, I use Dependabot like pretty much anybody who uses GitHub does, at least for security.

00:36:31.760 --> 00:36:39.960
Right. I think people have become a lot more aware overall of that they should be pinning dependencies and how to do that and how to upgrade intentionally.

00:36:39.960 --> 00:36:47.960
And so hopefully over time that, you know, less people will be surprised by updates and their applications will continue working with the versions they work with.

00:36:47.960 --> 00:36:54.920
Right, exactly. And if you're worried about these changes, just pin it to 1.11 or whatever it is and just let it be until you're really ready.

00:36:54.920 --> 00:36:59.520
But also you'll get notified of any security issues that you might need to jump in and fix, right?

00:36:59.520 --> 00:37:05.220
So I know what I was going to say is I don't remember seeing any around Flask and Rixzoig almost ever.

00:37:05.220 --> 00:37:07.260
So they're pretty stable, it seems.

00:37:07.260 --> 00:37:12.540
It's pretty rare for there to be like critical bugs or security related bugs reported.

00:37:12.540 --> 00:37:14.980
We get stuff every now and then, but we just make a point release.

00:37:15.240 --> 00:37:20.700
Yeah. And Rohit asked previously about like, why would I use something like Flask over say something like Django?

00:37:20.700 --> 00:37:26.880
I noticed security releases for Django more often. And I think it's because they just have so much more going on.

00:37:26.880 --> 00:37:33.600
Like they have a whole admin section with forms and input and you guys just, if it's not there, it can't have a vulnerability in it.

00:37:33.660 --> 00:37:35.520
There's a much larger attack surface. Yeah.

00:37:35.520 --> 00:37:36.540
Yes, exactly.

00:37:36.540 --> 00:37:42.820
But it's not that Django is less secure overall though. I mean, first of all, they're releasing all these security updates.

00:37:42.820 --> 00:37:51.600
So they're staying secure, but I think they have a much larger team. And so they have the capacity to do these sorts of analysis that maybe we don't.

00:37:51.600 --> 00:37:58.820
I'm not saying like, I think Flask is insecure, but it could be that, you know, they're just, they've just got more eyeballs on these things.

00:37:58.820 --> 00:38:05.560
Fuck like noticing like, oh yeah, we shouldn't do this. We can make it safer or something like that.

00:38:05.560 --> 00:38:08.020
Yeah. Yeah. And I just think the surface area is so much larger.

00:38:08.020 --> 00:38:08.480
Yeah.

00:38:08.480 --> 00:38:10.180
It's bound to happen.

00:38:10.180 --> 00:38:12.800
Maybe someday we'll be in that position for Flask too.

00:38:12.800 --> 00:38:19.840
Doug says, oh man, trying to get in Django, my new job, so much magic, too much magic happening there for me.

00:38:19.840 --> 00:38:25.860
But he also has a question that I think maybe, you know, Phil, you spoke about in your presentation.

00:38:25.860 --> 00:38:29.180
Like does this release change how you run in production?

00:38:29.180 --> 00:38:34.780
Like Unicorn versus Micro Whiskey versus who knows what? Hypercorn.

00:38:34.780 --> 00:38:40.360
The good thing to say is that, no, it doesn't change it at all. It still works the same and you can still use Unicorn

00:38:40.360 --> 00:38:49.020
and use the async capabilities now in Flask. If you wish to use an ASGI server, you can as well. You need some middleware and adapter to do it.

00:38:49.020 --> 00:38:53.460
And there's some examples in the Flask docs if you want to see which one we recommend.

00:38:53.720 --> 00:38:55.300
So you can choose any server.

00:38:55.300 --> 00:39:00.300
But yeah, very important for me to point out that you don't have to change anything. You can just carry on as before.

00:39:00.300 --> 00:39:06.920
Yeah. So if you want, how would you categorize? You actually in your talk spoke about a spectrum of async capability.

00:39:06.920 --> 00:39:14.580
On one hand, you have Flask with its decent async support, but not full AGSI server capabilities.

00:39:15.100 --> 00:39:20.860
And then you've got Court, which can be 100% ASGI. And so you kind of thought of it as a spectrum, right?

00:39:20.860 --> 00:39:27.660
Yeah. So my idea is that if your code base is mostly sync, as it may have started, then Flask is a great choice.

00:39:27.660 --> 00:39:30.800
If you want to add a bit of async here and there, it's still a great choice.

00:39:30.800 --> 00:39:39.880
It's only when perhaps you want to go fully async or you've mostly async with maybe a few sync pieces of code that you actually would choose Court.

00:39:39.880 --> 00:39:46.560
But I think the really nice thing for the user is you can hopefully just go across that spectrum, eventually change the name, but then just continue.

00:39:46.560 --> 00:39:49.400
And it's a pleasant experience is my hope.

00:39:49.400 --> 00:39:50.100
Yeah. Awesome.

00:39:50.100 --> 00:39:53.740
You should still be able to use the same WSGI servers, basically.

00:39:53.740 --> 00:39:56.940
Like we've said a couple of times, like we're not breaking anything.

00:39:56.940 --> 00:39:59.560
We're not changing how Flask works or anything like that.

00:39:59.660 --> 00:40:01.440
So you still deploy it the same way.

00:40:01.440 --> 00:40:09.080
And if you do want to use an ASGI framework or server for some reason, you can always use an adapter to serve a WSGI app over ASGI too.

00:40:09.080 --> 00:40:11.400
You just don't get any of the benefits, really.

00:40:11.400 --> 00:40:11.620
Yeah.

00:40:11.620 --> 00:40:15.920
And Doug makes a good point out there that Flask for the Wind is still making GUnicorn a good solution.

00:40:15.920 --> 00:40:20.800
With GUnicorn, you can change the worker type, right?

00:40:20.800 --> 00:40:24.560
You can let it be the regular one, or you can say, I think it's dash K for the option.

00:40:24.760 --> 00:40:31.240
Change the worker type to uvicorn workers, which would switch it to be an ASGI version.

00:40:31.240 --> 00:40:37.360
So you don't even necessarily have to change anything, but like part of your command line for your startup of your GUnicorn.

00:40:37.360 --> 00:40:39.880
And that could be the total change you have to do.

00:40:40.000 --> 00:40:55.740
And going back to a point that Phil made earlier, in the same way, you could change the worker to use like G-Event or something and already have an ASYNC Flask, just, you know, with an older version of ASYNC code or an older implementation.

00:40:55.940 --> 00:41:06.400
Yeah. And Joe out there says, I had to look at the new ASYNC I-O features, but it seems from the docs that it's early days and maybe later versions will get more ASYNC I-O adoptions.

00:41:06.400 --> 00:41:09.440
I guess that's a good direction to have a quick chat about.

00:41:09.440 --> 00:41:11.260
So what's the, so this is 2.0.

00:41:11.260 --> 00:41:15.580
Is this where you see it sort of landing or do you see this as a progression?

00:41:15.580 --> 00:41:17.920
I think it's fair to say it's a, it's a progression.

00:41:17.920 --> 00:41:18.360
Definitely.

00:41:18.360 --> 00:41:29.200
I mean, the ideal outcome in the end would be to somehow merge Flask and Quart users, be able to use any amount of ASYNC and, or Biaski or Whiskey and everything just, just works nicely for them.

00:41:29.200 --> 00:41:29.480
Really.

00:41:29.480 --> 00:41:36.640
Again, as I said earlier, I'm a bit skeptical about whether that could be the one namespace I just call Flask or whether you need to split it up as it is now.

00:41:36.640 --> 00:41:38.420
But yeah, I think it's the start.

00:41:38.420 --> 00:41:39.960
Hopefully we can, we can keep going.

00:41:39.960 --> 00:41:40.280
Yeah.

00:41:40.280 --> 00:41:56.140
Like the ASYNC stuff we've gotten there so far is for supporting the most important thing that we thought people were needing ASYNC for, which is I have some ASYNC code or like I'm using discord.py, for example, to write a discord bot or something.

00:41:56.140 --> 00:41:57.460
That's all ASYNC, right?

00:41:57.460 --> 00:42:02.220
So if you want to write that code, you need to type ASYNC def and put your code in there.

00:42:02.220 --> 00:42:02.900
Right.

00:42:02.900 --> 00:42:04.000
So we're enabling that.

00:42:04.340 --> 00:42:12.240
We've got extension points to change, you know, what ASYNC IO loop you're using, like ASYNC IO versus Trio versus Greenback.

00:42:12.240 --> 00:42:13.580
Or uvloop or something maybe.

00:42:13.580 --> 00:42:16.160
Or you, I'm not sure if that would tie in.

00:42:16.160 --> 00:42:17.300
Phil might be able to answer that.

00:42:17.300 --> 00:42:21.520
And then like, you know, addressing things like being able to do web sockets and that sort of thing.

00:42:21.520 --> 00:42:26.600
We might be able to do that in Flask eventually, or that might be the place where you switch over to the Quart namespace.

00:42:26.600 --> 00:42:28.820
And, but you're using the same API.

00:42:28.820 --> 00:42:29.880
It's just a different name.

00:42:29.880 --> 00:42:31.560
Yeah, Phil, that's something I wanted to ask you about it.

00:42:31.600 --> 00:42:36.760
Just to let you give a quick shout out about is the web socket support that you all have in Quart.

00:42:36.760 --> 00:42:37.260
Oh, yeah.

00:42:37.260 --> 00:42:39.760
I mean, I don't know if there's much more to say than it.

00:42:39.760 --> 00:42:40.900
It's definitely supported.

00:42:40.900 --> 00:42:42.960
And you just go ahead and use it.

00:42:42.960 --> 00:42:44.540
It supports web sockets.

00:42:44.540 --> 00:42:47.280
You did bring some of that stuff back to Verksoig, though.

00:42:47.280 --> 00:42:54.360
Because you're using Verksoig in Quart, you needed to be able to route to web socket URLs as opposed to HTTP URLs.

00:42:54.360 --> 00:43:01.220
And so we now have a way to identify in our Verksoig router whether something is intended to be a web socket or not.

00:43:01.220 --> 00:43:04.060
So it'll change based on the scheme you're using.

00:43:04.060 --> 00:43:12.300
I think it's good to point out that Miguel has a kind of experimental support, I think, in Flask as well for web sockets, which is good to keep an eye on.

00:43:12.300 --> 00:43:13.260
We'll have to see how that goes.

00:43:13.360 --> 00:43:14.620
Oh, yeah, that was really cool.

00:43:14.620 --> 00:43:24.440
I don't remember what it was called or anything, but there's a way that GUnicorn will let you take control of the HTTP socket from an endpoint.

00:43:24.440 --> 00:43:31.020
And so within your Flask view, you could take over controlling the socket and start treating it like a web socket instead.

00:43:31.020 --> 00:43:32.220
Like an upgrade type thing?

00:43:32.220 --> 00:43:32.660
Yeah.

00:43:32.660 --> 00:43:35.100
So you still are in Flask and WSGI mode.

00:43:35.100 --> 00:43:38.980
So you're still like sync in terms of one worker is blocked handling that one thing.

00:43:38.980 --> 00:43:40.580
But it's pretty clever.

00:43:40.820 --> 00:43:40.900
Yeah.

00:43:40.900 --> 00:43:43.940
And Joe out there throws out that it's Miguel Grinberg.

00:43:43.940 --> 00:43:45.680
Justin is the Miguel you're talking about.

00:43:45.680 --> 00:43:46.660
Yeah.

00:43:46.660 --> 00:43:52.600
There's also Flask socket IO, but this is like a more native thing where you can just do this directly in Flask instead of needing an extension.

00:43:52.600 --> 00:43:54.160
So cool stuff.

00:43:54.160 --> 00:43:54.360
Yeah.

00:43:54.360 --> 00:43:55.140
Super cool.

00:43:55.140 --> 00:43:55.640
All right.

00:43:55.640 --> 00:43:58.220
We're getting sort of short on time.

00:43:58.220 --> 00:44:00.620
So I want to ask a couple of questions.

00:44:00.620 --> 00:44:02.920
Hit on some high notes as well here.

00:44:02.920 --> 00:44:09.680
One of the things that I think is pretty exciting that GitHub has done, you know, GitHub, I think, continues to be pretty neat.

00:44:09.820 --> 00:44:13.820
And one of the things they've done is they've added sponsor support for projects.

00:44:13.820 --> 00:44:15.480
Has that been helpful to you all?

00:44:15.480 --> 00:44:15.940
Yeah.

00:44:15.940 --> 00:44:18.340
We've gotten quite a lot of support.

00:44:18.340 --> 00:44:19.880
We're part of the PSF.

00:44:19.880 --> 00:44:22.420
And so we take donations through them.

00:44:22.420 --> 00:44:26.500
If you go to palletsprojects.com slash donate, you get the PSF donation page.

00:44:26.500 --> 00:44:31.380
We've got lots of people, you know, making one-time donations or scheduled, you know, monthly donations.

00:44:31.900 --> 00:44:40.160
And we're also part of Tidelift, which is a commercial sort of open source support service that we're getting funding through.

00:44:40.160 --> 00:44:52.260
And we're also, I mean, this isn't really a sponsor link, but since we host all our docs on Read the Docs, we're partnered with Ethical Ads, which is their advertising platform to share the advertising revenue on all our docs.

00:44:52.540 --> 00:44:54.140
So we're getting quite a bit of funding.

00:44:54.140 --> 00:44:56.200
We're going to put it towards Flask conferences.

00:44:56.200 --> 00:44:57.220
Yeah, that's fantastic.

00:44:57.220 --> 00:44:57.820
That's good to hear.

00:44:57.820 --> 00:45:05.640
I do feel like there's probably a handful of billion-dollar companies that are using Flask at the core that maybe could click that link and do a little more.

00:45:05.640 --> 00:45:06.820
But, you know, shout out to them.

00:45:07.040 --> 00:45:11.620
If you're using Flask at your company, take a look at the sponsor links.

00:45:11.620 --> 00:45:12.040
Yeah.

00:45:12.040 --> 00:45:13.740
We have lots of plans for what to do with it.

00:45:13.740 --> 00:45:13.920
Yeah.

00:45:13.920 --> 00:45:22.520
I was really happy to see GitHub put this in here because, like, just having, like, a little, you know, buy me a coffee link on the side of a homepage, that didn't seem like it worked.

00:45:22.520 --> 00:45:28.500
But I think this sort of central way, and what's interesting is I didn't realize that you could link to external sponsors.

00:45:28.500 --> 00:45:35.840
Like, my thought was that that sponsor button really was going through the GitHub sponsor channel or framework or whatever.

00:45:36.020 --> 00:45:46.740
People recommend that we use GitHub sponsors as well because a lot of companies who are already in GitHub's ecosystem have an easier time clicking that button than something external.

00:45:46.740 --> 00:45:49.520
So that's something I will be looking into.

00:45:49.520 --> 00:45:51.480
Kind of like App Store versus not App Store.

00:45:51.480 --> 00:45:55.000
Like, first go to our site to buy a type of integration, right?

00:45:55.000 --> 00:45:56.440
I feel like it's almost like that.

00:45:56.440 --> 00:45:57.900
I would definitely recommend it.

00:45:57.900 --> 00:46:02.600
I've sponsored some things through the sponsor button there, and it's super easy.

00:46:02.600 --> 00:46:03.440
Okay.

00:46:03.440 --> 00:46:04.140
Mars.

00:46:04.140 --> 00:46:05.000
How about that?

00:46:05.000 --> 00:46:05.340
Yeah.

00:46:05.840 --> 00:46:09.080
Flask is on Mars or help the lander get to Mars.

00:46:09.080 --> 00:46:13.160
And I bet if I pull this up, let me see if I can find your user profile here.

00:46:13.160 --> 00:46:14.860
I just have to hack the URL.

00:46:14.860 --> 00:46:15.980
It's going to have to be that way.

00:46:15.980 --> 00:46:17.680
And I go down here.

00:46:17.680 --> 00:46:18.600
Here you go.

00:46:18.600 --> 00:46:23.640
You have the official achievement, Mars 2020 helicopter contributor.

00:46:23.640 --> 00:46:25.600
How awesome is that?

00:46:25.600 --> 00:46:27.200
Phil, do you have one of these as well?

00:46:27.200 --> 00:46:28.100
Yeah, I think so.

00:46:28.100 --> 00:46:28.660
Yeah, yeah.

00:46:28.660 --> 00:46:29.580
I'm so jealous.

00:46:29.580 --> 00:46:30.220
I want one of these.

00:46:30.640 --> 00:46:37.320
Everybody who's gotten a code contribution to the repositories should have that badge.

00:46:37.320 --> 00:46:43.540
And there's been plenty more people who have contributed in other ways that should have that badge, but don't.

00:46:43.760 --> 00:46:43.940
Yeah.

00:46:43.940 --> 00:46:43.940
Yeah.

00:46:43.940 --> 00:46:43.940
Yeah.

00:46:43.940 --> 00:46:44.260
Yeah.

00:46:44.260 --> 00:46:47.040
You should also have the Arctic vault contributor.

00:46:47.040 --> 00:46:50.900
Oh, I have the Arctic one, but I turned it off a while ago because I thought it was kind of silly.

00:46:50.900 --> 00:46:51.760
Yeah.

00:46:51.760 --> 00:46:53.400
This one is way more.

00:46:53.780 --> 00:47:01.480
I don't know how that whole system works, but if they had archived Flask 2.0 after all my work was done, I'd be much happier.

00:47:01.480 --> 00:47:04.840
But they archived it like two years ago now.

00:47:04.840 --> 00:47:05.240
Yeah.

00:47:05.240 --> 00:47:09.600
So there's a lot of ways in which Python is being used on Mars.

00:47:10.320 --> 00:47:21.980
When the lander first landed there and, you know, people said, oh, look, there's the F prime library that was used to power the Ingenuity helicopter.

00:47:21.980 --> 00:47:23.920
That means Python's there.

00:47:23.920 --> 00:47:27.440
I'm like, ah, it looks like maybe Python just trained the model and C++ was there.

00:47:27.440 --> 00:47:32.960
But it turned out in the lander that went down, actually the cameras, all the different angles were controlled by Python.

00:47:32.960 --> 00:47:37.540
And then getting those images back to JPL was part of Python.

00:47:37.540 --> 00:47:41.020
And yeah, what's the story of the Flask and Mars?

00:47:41.020 --> 00:47:41.880
This is so cool.

00:47:41.880 --> 00:47:42.240
Yeah.

00:47:42.240 --> 00:47:44.480
So Flask is actually part of F prime.

00:47:44.480 --> 00:47:49.820
So F prime is like their, I'm not an expert on this, but it's like their flight control software, I think.

00:47:49.820 --> 00:47:51.800
So it's like a monitoring dashboard for everything.

00:47:51.800 --> 00:47:59.660
So they're using Flask to provide like all this information about the launches and flights and landings and get updates in real time.

00:47:59.660 --> 00:48:01.800
So I think that's where our stuff came in.

00:48:01.800 --> 00:48:07.820
But I'm sure other parts of their code are using Jinja or click in other ways, not necessarily through Flask.

00:48:07.820 --> 00:48:08.220
Yeah.

00:48:08.220 --> 00:48:09.740
Wow, that's so cool.

00:48:09.740 --> 00:48:11.400
What did you all think when you heard this?

00:48:11.400 --> 00:48:22.760
Every now and then I'll see like a, you know, some big thing like this F prime and I'll, they won't have mentioned Flask or anything, but I'll have to like, somehow I'll have like this intuition that it was used.

00:48:22.760 --> 00:48:28.960
And so like, I went and just looked at F prime and I like, I'm like, oh, it's Python requirements.txt.

00:48:28.960 --> 00:48:29.840
Flask.

00:48:30.100 --> 00:48:31.980
I went and announced it on GitHub.

00:48:31.980 --> 00:48:33.320
I'm like, wow, check this out.

00:48:33.320 --> 00:48:34.400
Yeah, that's super cool.

00:48:34.400 --> 00:48:35.920
Go to the dependency graph.

00:48:35.920 --> 00:48:36.680
I'm sure we'll see.

00:48:36.680 --> 00:48:36.880
Yeah.

00:48:36.880 --> 00:48:38.660
Look what number one dependency right there.

00:48:38.660 --> 00:48:39.220
There we are.

00:48:39.220 --> 00:48:40.180
In Flask or RESTful.

00:48:40.180 --> 00:48:40.380
Yeah.

00:48:40.380 --> 00:48:41.840
Something to do with APIs here, right?

00:48:41.840 --> 00:48:42.700
Yeah.

00:48:42.820 --> 00:48:42.940
Cool.

00:48:42.940 --> 00:48:43.680
All right.

00:48:43.680 --> 00:48:47.000
Let's, I guess, round this out with two things, actually.

00:48:47.000 --> 00:48:47.540
Real quick, though.

00:48:47.540 --> 00:48:51.580
I want to take a question, I think, or follow up comment from Ikivu.

00:48:51.580 --> 00:48:52.640
Might be off topic.

00:48:52.640 --> 00:49:00.200
They say they would love to know more about how to convince a large employer to spend money sponsoring an open source project.

00:49:00.200 --> 00:49:01.740
I wish I had a good answer for this.

00:49:01.740 --> 00:49:04.020
I know there has been thought on this.

00:49:04.020 --> 00:49:06.660
I'm just not the best person to talk about it.

00:49:06.660 --> 00:49:07.740
I'm not an expert yet.

00:49:07.740 --> 00:49:10.280
I would say, look at Tidelift.

00:49:10.740 --> 00:49:24.740
Their company and their whole job is to be that in-between between open source who doesn't know how to convince companies to do this and companies who are using a lot of open source but don't know how to analyze their dependencies and divide up their support.

00:49:24.740 --> 00:49:32.460
And so if you go look at Tidelift, their whole goal is to enable that sort of thing and discuss it with management and all that.

00:49:32.460 --> 00:49:32.920
That's not good.

00:49:32.920 --> 00:49:33.420
Tidelift.

00:49:33.420 --> 00:49:33.900
Is it?

00:49:33.900 --> 00:49:34.560
Maybe Tidelift.

00:49:34.560 --> 00:49:35.160
That's not good.

00:49:35.160 --> 00:49:37.080
They might be down temporarily.

00:49:37.080 --> 00:49:38.100
Never seen that before.

00:49:38.100 --> 00:49:40.000
Maybe HTTP versus HTTPS.

00:49:40.200 --> 00:49:41.800
Yeah, so that place.

00:49:41.800 --> 00:49:44.500
I do think this is a good option as well.

00:49:44.500 --> 00:49:46.460
You know, they sponsored TalkByThon for a little while.

00:49:46.460 --> 00:49:48.880
And I think they're definitely trying to be creative in this, right?

00:49:48.880 --> 00:49:55.980
They're trying to offer something to employers that's not just put it on your charity column in the balance sheet.

00:49:55.980 --> 00:49:57.840
They're like, we don't have a charity column in the balance sheet.

00:49:57.840 --> 00:49:58.920
What are you talking about, right?

00:49:58.920 --> 00:50:01.740
So doing something a little bit different there.

00:50:01.740 --> 00:50:04.860
You can look at it, I think, as a company as part of your recruiting spend.

00:50:05.320 --> 00:50:07.980
I think every company knows how competitive the market is.

00:50:07.980 --> 00:50:15.280
And I do think engineers do like what interests and what you do in the open source community and look at it in a positive light.

00:50:15.280 --> 00:50:17.000
So I think that might help.

00:50:17.120 --> 00:50:17.680
I totally agree.

00:50:17.680 --> 00:50:19.980
A couple other quick follow-up questions.

00:50:19.980 --> 00:50:24.700
Olga asks, can F Prime connect to APIs on Earth?

00:50:24.700 --> 00:50:26.460
Like, do you guys know anything about this?

00:50:26.460 --> 00:50:27.960
I think it is used on Earth as well.

00:50:27.960 --> 00:50:29.780
I mean, like I said, it's like a monitoring dashboard.

00:50:29.780 --> 00:50:35.680
So it's not something that's actively running on the rover, I think, from what I understand.

00:50:35.680 --> 00:50:43.320
I think it is accepting data from sources like the rover and other systems and then displaying that and coordinating it.

00:50:43.320 --> 00:50:43.800
Very, very cool.

00:50:43.800 --> 00:50:48.140
And then Joe asks if Armin Roeneker's still involved with the project, any?

00:50:48.140 --> 00:50:50.480
Armin is not.

00:50:51.120 --> 00:50:58.860
He's still part of the GitHub organization and he's like in our maintainer channel on Discord, but he's moved on to other things.

00:50:58.860 --> 00:51:01.880
You know, he's working in Rust a lot and other things.

00:51:01.880 --> 00:51:06.480
My impression is he's kind of moved on to Rust and is just enjoying his time there, which is totally fine.

00:51:06.480 --> 00:51:09.280
Like people don't have to stick with one technology their whole life, right?

00:51:09.280 --> 00:51:09.880
Right, right.

00:51:09.880 --> 00:51:10.580
They make big contributions.

00:51:10.800 --> 00:51:17.720
That's one of the things I've been trying to do, too, since I became a maintainer was get more maintainers, right?

00:51:17.720 --> 00:51:21.960
So it's not just Armin and then after Armin, it's not just me.

00:51:21.960 --> 00:51:26.660
You know, I'm trying to expand it so it doesn't matter if Armin or I are still involved.

00:51:26.660 --> 00:51:26.980
Yeah.

00:51:26.980 --> 00:51:29.840
And Box of Ninjas out there says, I need the Mars endpoint.

00:51:29.840 --> 00:51:33.020
Yeah, I don't think they just let that out to anybody.

00:51:33.020 --> 00:51:34.800
Yeah, there's probably...

00:51:34.800 --> 00:51:36.620
They don't put auth in there.

00:51:36.620 --> 00:51:37.920
It's hard to find the endpoint.

00:51:39.040 --> 00:51:41.020
Next to the right satellite at the right time.

00:51:41.020 --> 00:51:41.620
Exactly.

00:51:41.620 --> 00:51:43.520
You can just tunnel over there.

00:51:43.520 --> 00:51:44.620
All right.

00:51:44.620 --> 00:51:48.760
So I think that's probably all the stuff we got time for.

00:51:48.760 --> 00:51:50.580
But, you know, thank you guys for covering this.

00:51:50.580 --> 00:51:52.940
Let me ask you the last two questions before you get out of here.

00:51:52.940 --> 00:51:56.840
If you're going to work on Flask or Quark, what editor do you use these days?

00:51:56.840 --> 00:52:00.420
I've been using PyCharm for almost a decade now, I feel like.

00:52:00.420 --> 00:52:02.900
Pretty much since I started using Python.

00:52:02.900 --> 00:52:04.680
So PyCharm, all the way.

00:52:04.680 --> 00:52:05.060
Right on.

00:52:05.060 --> 00:52:05.400
Bill?

00:52:05.400 --> 00:52:08.500
I use Emacs, although I've used VS Code a few times.

00:52:08.640 --> 00:52:10.300
If I ever record something, I use VS Code.

00:52:10.300 --> 00:52:11.900
But yeah, Emacs is where I do the work.

00:52:11.900 --> 00:52:13.540
I do it right down the bare metal.

00:52:13.540 --> 00:52:15.220
Cool.

00:52:15.220 --> 00:52:20.100
And then recommend some library package you all have come across recently that you're like,

00:52:20.100 --> 00:52:20.840
oh, this is super cool.

00:52:20.840 --> 00:52:22.420
People should know about X.

00:52:22.420 --> 00:52:23.440
Any ideas?

00:52:23.440 --> 00:52:28.860
I'm really enjoying using Pydantic to validate the incoming requests, like just as a data

00:52:28.860 --> 00:52:29.500
class setup.

00:52:29.500 --> 00:52:33.920
I know you can do it with different ones as well, but the syntax seems so clean just to

00:52:33.920 --> 00:52:38.360
say this looks exactly like a data class and I just use it to validate my incoming.

00:52:38.360 --> 00:52:39.120
It's great.

00:52:39.220 --> 00:52:39.740
That's fantastic.

00:52:39.740 --> 00:52:39.960
Yeah.

00:52:39.960 --> 00:52:44.560
One of the things I've started to do as like the first line in my Flask API endpoints

00:52:44.560 --> 00:52:49.580
is to say Pydantic model equals, you know, class star star.

00:52:49.580 --> 00:52:50.180
What is it?

00:52:50.180 --> 00:52:51.600
Request dot JSON.

00:52:51.600 --> 00:52:52.460
Something like that.

00:52:52.460 --> 00:52:55.700
Like just immediately try to convert it to invalidate it with Pydantic.

00:52:56.060 --> 00:53:01.280
Something I learned recently, I had Samuel on the show who creates and maintains Pydantic

00:53:01.280 --> 00:53:04.840
is, although I didn't learn about it on the show, someone else pointed out to me, there's

00:53:04.840 --> 00:53:11.600
a, like a secrets capability built right into Pydantic that like works with like .env files

00:53:11.600 --> 00:53:12.540
and all sorts of stuff.

00:53:12.540 --> 00:53:13.860
It's got this whole mechanism.

00:53:13.860 --> 00:53:15.900
So yeah, that library does a bunch of cool stuff.

00:53:15.900 --> 00:53:21.240
I don't have a good answer for this because I've been just dealing with Flask itself for

00:53:21.240 --> 00:53:25.440
so long and getting those ready that I haven't really been exploring new stuff for myself.

00:53:25.440 --> 00:53:26.620
Does this mean I get another?

00:53:26.620 --> 00:53:28.420
You can have another, but yeah.

00:53:28.420 --> 00:53:33.460
So like hopefully I get to learn about some new libraries as soon after, you know, Flask

00:53:33.460 --> 00:53:34.420
2.0 goes stable.

00:53:34.420 --> 00:53:39.720
I will say at work, and this isn't official yet because we're going to, we need to write

00:53:39.720 --> 00:53:40.200
documentation.

00:53:40.200 --> 00:53:44.280
It's totally unusable right now because it's not documented, but we've been working on a

00:53:44.280 --> 00:53:50.300
open source library called AutoInvent, which takes a data model, like such as your SQL

00:53:50.300 --> 00:53:55.380
Alchemy models and produces an entire GraphQL API and React front end.

00:53:55.380 --> 00:53:58.960
From just the data model, plus like customizations to some metadata.

00:53:58.960 --> 00:53:59.640
Oh, that's cool.

00:53:59.640 --> 00:54:00.480
It's super handy.

00:54:00.480 --> 00:54:01.680
It's really cool.

00:54:01.680 --> 00:54:03.400
It's completely undocumented.

00:54:03.400 --> 00:54:08.900
So I will at some point, maybe half a year from now, announce the actual project.

00:54:08.900 --> 00:54:12.680
But if you go to an autoinvent.dev, you can see all our messy code right now.

00:54:12.680 --> 00:54:13.160
Nice.

00:54:13.160 --> 00:54:14.360
Bill, you got one more.

00:54:14.360 --> 00:54:14.740
Go for it.

00:54:14.740 --> 00:54:15.160
Oh, yeah.

00:54:15.160 --> 00:54:20.520
So Trio, if you've not heard of it, is a different Async Await-based event loop implementation.

00:54:21.200 --> 00:54:27.740
And I think I really like it because the structured concurrency it introduces is the way, I think,

00:54:27.740 --> 00:54:30.060
the most Pythonic way to do Async Await.

00:54:30.060 --> 00:54:30.280
Yeah.

00:54:30.280 --> 00:54:30.940
Trio is neat.

00:54:30.940 --> 00:54:34.560
I had the, I don't remember the maintainer's name, but I had him on the show.

00:54:34.560 --> 00:54:34.960
Nathan?

00:54:34.960 --> 00:54:35.960
Nathaniel, that's right.

00:54:35.960 --> 00:54:37.560
I had Nathaniel on the show.

00:54:38.400 --> 00:54:42.540
And yeah, it's super cool, like how you can have dependencies between, you know, this

00:54:42.540 --> 00:54:45.300
task, created those tasks, and you cancel one, you cancel them all.

00:54:45.300 --> 00:54:47.360
There's a lot of interesting patterns that come out of there.

00:54:47.360 --> 00:54:48.240
Very neat.

00:54:48.240 --> 00:54:49.140
All right.

00:54:49.140 --> 00:54:50.540
I think that's it.

00:54:50.540 --> 00:54:52.100
David, Phil, thank you.

00:54:52.100 --> 00:54:54.500
Quick shout out or a quick final call to action.

00:54:54.500 --> 00:54:56.980
People want to get into Flask 2.0.

00:54:56.980 --> 00:54:58.300
They want to upgrade their stuff.

00:54:58.300 --> 00:55:00.520
Maybe they want to take advantage of the Async stuff or whatever.

00:55:00.520 --> 00:55:01.580
What do you tell them?

00:55:01.580 --> 00:55:02.680
Where do they go from here?

00:55:02.680 --> 00:55:07.920
Well, look for that new version releasing tomorrow or a week ago, depending on where you listen

00:55:07.920 --> 00:55:08.340
to this.

00:55:08.920 --> 00:55:13.400
Follow Palette's team on Twitter if you want to see announcements for new things.

00:55:13.400 --> 00:55:19.060
And also, if you're interested in like contributing to these projects, I would encourage more people

00:55:19.060 --> 00:55:24.100
to go on GitHub, you know, at least star the projects you're using, but also watch them,

00:55:24.100 --> 00:55:26.380
you know, watch for new issues coming in.

00:55:26.380 --> 00:55:28.660
Anybody can pick up one of these things and help out.

00:55:28.660 --> 00:55:33.040
Yeah, you know, I think star and fork are the ones that get all the attention.

00:55:33.040 --> 00:55:37.680
You know, one thing that GitHub just recently added, I know I said that, but I just want to

00:55:37.680 --> 00:55:39.620
give a little quick awareness to people.

00:55:39.620 --> 00:55:40.540
I think it's super cool.

00:55:40.540 --> 00:55:47.580
If you forked a repo, it used to be you'd have to go to CLI and, you know, add an upstream

00:55:47.580 --> 00:55:48.120
origin.

00:55:48.120 --> 00:55:49.660
And then you have to kind of keep that in sync.

00:55:49.660 --> 00:55:52.980
Now they've added a button that if you go to a fork and it's yours, you can just click

00:55:52.980 --> 00:55:55.760
a button and go sync my fork with the original now.

00:55:56.220 --> 00:55:59.860
And I think that, you know, encourage people to fork it and just stay up to date a little

00:55:59.860 --> 00:56:00.260
bit easier.

00:56:00.260 --> 00:56:01.900
So that's pretty cool as well.

00:56:01.900 --> 00:56:04.100
Phil, final call to action.

00:56:04.100 --> 00:56:05.120
What do you say to folks?

00:56:05.120 --> 00:56:06.300
Maybe something core focused?

00:56:06.300 --> 00:56:11.280
I think it would be go out and use it and let us know if it solves your needs, if it does

00:56:11.280 --> 00:56:11.720
what you want.

00:56:11.720 --> 00:56:12.120
Yeah.

00:56:12.120 --> 00:56:12.420
Yeah.

00:56:12.420 --> 00:56:12.780
Awesome.

00:56:12.780 --> 00:56:13.580
All right.

00:56:13.580 --> 00:56:14.820
Thank you both for being here.

00:56:14.820 --> 00:56:15.920
Thanks, Michael.

00:56:15.920 --> 00:56:16.260
See you later.

00:56:16.260 --> 00:56:16.920
Yep.

00:56:16.920 --> 00:56:17.300
Bye.

00:56:17.300 --> 00:56:17.680
Bye.

00:56:17.680 --> 00:56:17.720
Bye.

00:56:17.720 --> 00:56:21.560
This has been another episode of Talk Python To Me.

00:56:21.560 --> 00:56:25.580
Our guests on this episode were David Lord and Philip Jones, and it's been brought to you

00:56:25.580 --> 00:56:27.440
by us over at Talk Python Training.

00:56:27.440 --> 00:56:29.320
Want to level up your Python?

00:56:29.320 --> 00:56:33.380
We have one of the largest catalogs of Python video courses over at Talk Python.

00:56:33.380 --> 00:56:38.540
Our content ranges from true beginners to deeply advanced topics like memory and async.

00:56:38.540 --> 00:56:41.220
And best of all, there's not a subscription in sight.

00:56:41.220 --> 00:56:44.120
Check it out for yourself at training.talkpython.fm.

00:56:44.120 --> 00:56:46.020
Be sure to subscribe to the show.

00:56:46.020 --> 00:56:48.880
Open your favorite podcast app and search for Python.

00:56:48.880 --> 00:56:50.120
We should be right at the top.

00:56:50.120 --> 00:56:55.260
You can also find the iTunes feed at /itunes, the Google Play feed at /play,

00:56:55.260 --> 00:56:59.480
and the direct RSS feed at /rss on talkpython.fm.

00:56:59.480 --> 00:57:02.900
We're live streaming most of our recordings these days.

00:57:02.900 --> 00:57:07.040
If you want to be part of the show and have your comments featured on the air, be sure to

00:57:07.040 --> 00:57:10.700
subscribe to our YouTube channel at talkpython.fm/youtube.

00:57:10.700 --> 00:57:12.580
This is your host, Michael Kennedy.

00:57:12.580 --> 00:57:13.880
Thanks so much for listening.

00:57:13.880 --> 00:57:15.040
I really appreciate it.

00:57:15.040 --> 00:57:16.960
Now get out there and write some Python code.

00:57:16.960 --> 00:57:17.820
Bye.

00:57:17.820 --> 00:57:17.820
Bye.

00:57:17.820 --> 00:57:17.860
Bye.

00:57:17.860 --> 00:57:38.300
We'll see you next time.