The Python Language Summit is a yearly gathering of about 40 to 50 developers from CPython and other
Python implementations and related projects. The summit is typically held on the first day of PyCon.
Many of the decisions driving Python forward are made at this summit. On this episode,
you'll meet Marietta Wijaya, Lucas Lenga, and Brett Cannon, three well-known core devs,
to walk us through the major topics covered in this year's summit. This is Talk Python to Me,
episode 179, recorded September 26, 2018.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,
and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm at
M. Kennedy. Keep up with the show and listen to past episodes at talkpython.fm,
and follow the show on Twitter via at Talk Python. This episode is sponsored by Linode and Rollbar.
Please check out what they're offering during their segments. It really helps support the show.
Marietta, Brett, Lucas, welcome to Talk Python.
Hello.
Hi.
Thanks for having us.
Yeah, it's great to have Brett and Lucas have you guys back. And Marietta,
welcome to the show for your first time. I'm excited to have you here.
Thank you. Yeah, I'm excited to be invited here. Thank you.
Absolutely. So we're going to talk about the Python Language Summit, which I think is
not that well known and really, really important. And so I'm really excited to talk about that show.
But I want to give you all a chance to just introduce yourself for folks who maybe didn't
listen to some of the other shows or don't know you. So Marietta, let's start with you. Just,
you know, who are you? And what do you do day to day real quick?
Yeah, my name is Marietta. I work at Zapier, building integrations for various apps. I work
in the partner engagement team. So basically, we're building more tools for our partners.
Nice.
For CPython, I build lots of bots, lots of automations as well. So, yeah.
And you're on the core developer team, right?
Yeah.
You're one of the core developers? Very nice.
Yeah.
Lucas?
Hello, I'm Lukasz. I work at Facebook on the Python theme there. So we make sure to
be using the latest and greatest that is available in a safe way and in a way that sort of enables
us to use Python in our increasing scale and whatnot. I am contributing to Python, but you
probably don't know this. But what you do know is that I am the creator of black. So this is what
sort of everybody, I don't know, for some reason always knows about me, but not the other things.
I do write peps from time to time. In fact, I'm working on one right now. But you'll probably also
not know about this because that PEP is very boring. It's just about how we're going to make decisions
in the future. We'll see if it gets selected.
I think that's actually a pretty big topic, actually.
Oh, yeah, it is. There's a few sort of, I don't want to say competing, but well, they are competing
in a sense. There are a few possible models of governance that we can end up with. And the one
that I'm working on is revolving around the community. It's assuming that there is not going to be another
benevolent dictator and there's not going to be a very small council or triumvirate or however you call
it. We're going to sort of look up to the best, like C++ standard comedy. Ah, no, kidding. Well,
there's other projects that actually use this model like Rust, like ECMAScript and whatnot.
And Python actually is enough. Well, it's mature enough that in my view, this model would actually
ensure that we are addressing the interests of the widest sort of number of our users that way.
Yeah, I think I read the PEP that you're working on and that's really great. I like the
sort of exploration of the other options that are out there. It's really cool.
Cool.
You're also the release manager for 3.8, right?
Yes, I am. So far, it's going to look at as the most interesting release because it has a very,
very controversial PEP implemented in it. And at the same time, a rather boring release because now we
cannot make any other decisions. So there's probably not going to be any more sort of fundamental
features in it.
It's quite ironic, isn't it? All right. Very, very cool. Brett, how about yourself?
Yeah. So my name is Brett Cannon. I work at Microsoft as the dev lead on the Python extension
for Visual Studio Code. In terms of my Python contributions, I've been a core developer
since April 2003. So I think that's over 15 years at this point. Unlike both Wukash and Marietta,
I am not writing a governance PEP.
Although your name has been thrown around and related to that I've heard.
Yes, that's true. But yeah, another reason why I'm not writing a governance PEP.
Perfect. So Brett, why don't you kick us off with our main topic and just tell people what
is this language summit that you guys have every year?
Yeah. So basically, we came to a realization at PyCon, what feels like eons ago, that we didn't
really ever have a chance to sit around as a development team and talk things out. And some
people would think the sprints were that option. And they were, honestly, early on. But what happened
was, is as Python's popularity grew and PyCon's own popularity grew, we had more and more people
coming to us during the sprint saying, hey, I want to get started and contribute. Can you help me out?
And basically, it's made it such that the sprints at various conferences are not a place for us to
actually get work done, per se, as a team. So in order to make sure that happened, we carved out a
day. It always happens at PyCon US during the first day of tutorials, where we get together in a room
all day long and basically discuss things. Originally, it was kind of a round table-y kind of thing. It's
slowly grown into a more structured. People come in with a presentation, typically with a question,
or some specific reason why they're coming to talk about it and present to the room of core developers.
And basically, it's just a good way for us to kind of hash out or have discussions about where we see
things going. If we need a decision made, it's easier to make a decision in the room versus trying to do it
over the mailing list, etc., etc. And I think it's been useful. Lukash and Marietta can answer that since
they've been doing it far, as long as I think they've been core devs, and they're going to be leading it
starting next year. So they can have more insight on how they see it going forward.
Yeah. Sounds good. Do you guys want to add a little bit to what Brett said about the language summit?
Sorry, you said you guys. You mean you all, right?
Yes.
Lukash, perhaps you can say more just because I've only been to two language summits.
Yeah. So there's several language summits. In fact, we don't always do the European one at
Europython. The one in the US at PyCon US is, as far as I can tell, an annual event, like as far as I remember.
So the first one that I actually witnessed was either in 2008 or in 2009 at Europython. So I had a totally different
sort of view of what that means because the European one was run by Michael Ford, who had a really sort of, you know, like, well, I don't want to use the word, but it was a really happy, hippie approach to like, you know, let's just come on in and, you know, discuss things as we go.
Oh, you know, everything sort of organically grew, like, you know, people overflew with sort of ranty comments, but it was a very lively conversation.
The language summits in the US on PyCon US have to be structured a little bit more because there's just way more of us in the room.
So there is an agenda, there are talks, as Brett said, and whatnot. What I found, like, really amazing about this is that people who are really some of the most active contributors and some of the most senior contributors to Python and related projects are there in the room. So it's, it's something that even if you want it, you just can't buy.
Yeah, it seems like such an amazing gathering of people. So do you have to be a core developer to attend? Or can anyone attend these?
So, so far, at PyCon US, like, the rule has been as follows, like, if you are a core developer of CPython or any other alternative runtime, you are automatically in.
If you are interested and you're in town that day, you can just sort of respond to the invitation and there's going to be a spot for you.
There's also a few other ways in which you are, you can be present at the summit.
If you are invited by a core developer to talk about a subject that is of interest to us, then obviously, you can get in.
Or if you are a member of a project that is written in Python of some, like, notability, right?
Like, historically, we've had people from the Twisted project, we've had people from the Mercurial project and whatnot.
Sometimes the scientific stack and whatnot.
So, definitely, there's some form of deliberate exclusivity to the event.
But the point of it is mostly that we really have very little time in which we can actually see each other face to face and discuss things that are just way easier to be discussed when you see that other person.
So, we don't want this to devolve into sort of bike shedding or, you know, like, story of my life sort of event for any random, you know, attendee of PyCon.
Yeah, that makes a lot of sense.
Because this is for you all to get together and really be productive and move the language and the runtimes forward, which I think is great.
I guess the way I'd like to do this is let's just go through some of the various sessions.
There were quite a few sessions.
And there's a really nice write-up, actually, on lwn.net, which I'll link to the main write-up and then all the sub-articles about the sessions.
And maybe we can just start there.
So, I'm not sure which one of you is most familiar with each session.
So, I'll let you all jump in.
So, the first one I want to talk about, there was something with regard to sub-interpreters in Python.
And I thought the whole concept of a sub-interpreter was pretty interesting.
And what was the story this time?
I can take that.
So, that was presented by Eric Snow, teammate of mine on the Python extension.
And basically, Eric was kind of giving a status update of what he's trying to do, which is basically CPython itself currently has the concept of sub-interpreters.
It's used in the Apache web server, actually, for, I believe, ModPython.
I don't think – I'm not sure if ModWiz uses it.
But basically, it's a basic way to run multiple interpreters in a single process.
But it's never really been built out.
And so, Eric viewed this as a potential opportunity to deal with a concurrency model by trying to make sub-interpreters a first-class citizen of CPython itself.
So, the idea is basically you will potentially eventually have a module in the Sard library that will allow you to actually create other sub-interpreters in the process, send data across to the sub-interpreters to then be worked on, send results back, and basically give you kind of a message passing style of concurrency.
Is it a little bit like multi-processing but not as heavyweight in the sense that you don't share the data structures as much?
Correct.
Yeah, exactly.
And a lot of Eric's work has been actually trying to tease out a lot of the global state that Sun's built over the Earth by accident and trying to compartmentalize them better so that it's very obvious what is connected to a specific interpreter.
So, regardless of where the sub-interpreter work goes, it's been nice to kind of clean up that code to help centralize all the data structures and such.
Yeah, that's really interesting.
One of my first thoughts when I saw this, I mean, you were talking about in terms of concurrency, which is really interesting.
My first thought went to compatibility, right?
Could we take something that runs in Python 2 and somehow get it to stay closer to other code?
Or is there any thought of that?
Or is it more of a concurrency thing?
It is very much a concurrency thing from our perspective.
You Dropbox just did a blog post yesterday about how they transitioned from Python 2 to Python 3.
And it sounds like they somewhat went down that road in their custom Python version of CPython.
So, it sounds like it'd be definitely a potential way of doing it.
But I think from Eric's perspective, with Python 2 hitting EOL January 1st, 2020, the amount of time he still has to put in it to make it work isn't going to be worth his while to look into that.
But I'm sure someone could potentially make that work with a lot of effort.
We don't want to encourage that behavior, do we?
No.
This portion of Talk Python to Me is brought to you by Linode.
Are you looking for bulletproof hosting that's fast, simple, and incredibly affordable?
Look past that bookstore and check out Linode at talkpython.fm/Linode.
That's L-I-N-O-D-E.
Plans start at just $5 a month for a dedicated server with a gig of RAM.
They have 10 data centers across the globe.
So, no matter where you are, there's a data center near you.
Whether you want to run your Python web app, host a private Git server, or file server, you'll get native SSDs on all the machines, a newly upgraded 200 gigabit network, 24-7 friendly support, even on holidays, and a seven-day money-back guarantee.
Do you need a little help with your infrastructure?
They even offer professional services to help you get started with architecture, migrations, and more.
Get a dedicated server for free for the next four months.
Just visit talkpython.fm/Linode.
How about the next session that you all covered was modifying the Python object model.
This one came from someone outside of the core developer team, right?
That is somebody that I actually invited to the Language Summit.
It's Carl Shapiro, who works currently with Instagram on making Python sort of handle the next billion users for the social network.
We've seen some tremendous growth over the years on Instagram.
We are extremely grateful to have this runtime and be able to run the social network on it.
In fact, in the year where we switched from Python 2 to Python 3, we've seen some crazy feature growth and user growth at the same time.
And we actually switched the runtime version, like, you know, just sort of all in parallel.
So that was pretty amazing.
Yeah, I think that whole transformation is really a case study in how large organizations should do it.
You guys did an awesome job there.
Yeah.
So this was a massive project.
There's a bike on 20, what is it?
17?
I think it was 17, yeah.
I think, yeah.
Like a keynote about this.
So I highly recommend it.
It was a fun journey.
However, like since then, like we've been seeing that like we are paying some of the price for things that we don't have to pay the price for.
But at Instagram scale, like, you know, we're running many, many servers with the Django processes that actually serve users.
So we observe that some of the things that the CPython interpreter is doing can be optimized the way.
Or rather, we can change the interpreter in a way where those things can be sometimes pre-computed before runtime.
Like they can be done like circa compile time, if you know what I mean, like for Python, right?
Like obviously we are running like out of BYC files, which are, you know, created by the interpreter.
So whatever we can do there, like, you know, instead of every time that we start up the process would be nice.
In particular, Carl has a lot of background on various implementations of virtual machines for dynamic run time, dynamic like languages.
Like for example, I don't know, like R2VM Dart and whatnot.
So he has plenty of experience to know like where we could actually find pieces that we can optimize.
And in particular, he presented ways in which, for example, we could use an observed fact that most objects in Python don't actually change their shape during runtime.
So what that means in regular language is that when you're creating an instance at runtime in Python, Python doesn't have any expectation currently whether this instance is going to grow or, you know, remove attributes later on in the lifecycle of the object.
It's very dynamically sort of built in the sense that you can just change those things as you go.
You can add things not only to the objects.
You can add things and remove things from the classes themselves, you know, like freely, like whenever you want.
But in practice, what is happening is that a large majority of objects have all their state created and they're done their init methods.
Right.
You could almost use something like slots and like lock them down and make them more efficient.
But people don't do that.
They're not even actually recommended to do that, right?
Yeah, so slots, in fact, is a very sort of implementation of what we would be after.
What we would be after is more akin to the concept of hidden classes in JavaScript that V8 and a bunch of other runtimes implement.
What that means is instead of storing your attributes on the object as a hash table, right, like in the sense that you can just add things and remove things,
but then the cost of retrieving every attribute is rather high, what you can do is you can understand what the shape of the object,
the shape meaning efficient data structure in memory so that it's no longer a hash table.
It's simply consecutive array that you can just index, which has, you know, very nice property of, you know, having way faster access at runtime.
And in fact, we experimented with stuff like this at Instagram.
That actually did win us some nice, you know, improvements in performance.
So that change was suggested as something that could be, in fact, implemented in a future version of Python.
That's super interesting.
Do you think some of these changes are going to make it into the Python, into the Python runtime, into CPython in the future?
So definitely we need to be careful about, like, keeping Python what it is, right?
So we don't want to become a bit more performant, but way less dynamic.
Like, Python's entire success is built around the fact that it's very hackable, right?
Like, you can change things as you go at runtime.
And a lot of our day-to-day work is actually built on top of that frame of mind.
Like, for example, like, if you're mocking things in Python, right?
Like, during your unit test and whatnot.
Like, this is a very dynamic feature.
So, like, taking stuff like this away could potentially hurt, you know, our users.
So we don't want to do that.
Right.
A 10% increase in performance is not worth the loss of unit testing capabilities or massive re-architectures.
Absolutely.
So what we want to do instead is for the kinds of things that don't sacrifice user-visible functionality,
we want to have optimizations that actually let us do things faster.
Do, like, do less work.
If you can do less work, everybody wins.
However, we also have another constraint in CPython that is maybe not always visible,
which is that the runtime that we maintain has to be maintainable for the team that is actually in it for the long haul, right?
So if you would drop a much more performant piece of runtime, you know, on our labs,
we would thank you, but we would be also rather concerned about,
what are we going to do with it now, you know?
If this is a very brittle and complex piece of code,
we need to take into account that we need to release the next version of Python
and then the next version of Python,
and there's going to be different platforms that we're going to have to run on.
In fact, just today, I fixed a bug in black where people noticed that,
oh, we cannot run on Android phones.
You're like, I didn't test it on Android phones.
I mean, seriously, like, are you formatting Python code on Android phones?
Like, that didn't occur to me as an important feature,
but people really have needs like this, and those needs change in time and whatnot.
So the point I'm trying to make is that we do put a lot of weight
to making sure that we understand the piece of software that we're maintaining, right?
So there's definitely some compromise that we need to do there.
We cannot bring in another million lines of code, you know,
like from some benevolent contributor and then be left with maintaining that thing.
So yes.
This goes all back to Brett's thing about open source expectations
and, you know, giving away puppies and things like that.
Absolutely.
But it sounds like there's some really interesting possible performance benefits.
Yeah, that's cool.
The next one up is the galectomy.
Larry Hastings' galectomy.
The attempt to remove the GIL.
Marietta, you want to take this one?
What I know is it doesn't seem like it's going to happen,
but Larry had some issues with it.
And I think he was looking to get inspiration from Carl's previous talk.
But last time I checked from Larry, it doesn't seem like it's making any progress.
Yeah, I think that's kind of the summary of this whole talk is like,
I've been working on it, but it's not really going anywhere, right?
I mean, the sub-interpreter thing that Brett mentioned,
part of that attempt is to break free the GIL.
We have multiprocessing.
We have asyncIO, which is not really subject to the gill
because of the way it works and things like that,
at least if it's IO-bound, what you're awaiting.
So I don't know, I'm not sure it's as necessary as it used to be,
but it sounds like it didn't really go anywhere, right?
No.
That's too bad, but it's good to, I think it's a cool project
and I really hope he makes progress, but it doesn't sound like it, right?
Right.
All right, so that was a pretty short update, but that's cool.
Why don't you take the next one as well?
Because did you actually do this presentation?
Yes, so I proposed that we started using GitHub issues instead of Roundup,
which is bugspython.org.
So BPO bugspython.org is an instance of Roundup that we've been maintaining
and it's been working for us,
but I think our workflow could be better if we started using GitHub issues.
Yeah, and Brett actually had helped drive the project to move CPython code.
So the code is on GitHub already,
but the issue tracking had been somewhere else,
and so you were like, well, why not just in GitHub where it is, right?
Exactly, and everything else on Python uses GitHub issue trackers except CPython,
like our peps in GitHub, our dev guide workflow issues,
everything is in GitHub already.
So I think it's good to start to explore why don't we start using GitHub for CPython as well.
I think it's a great idea.
I think it's absolutely good thing that CPython code is on GitHub.
I know it's just a source control system,
but I think it opens up people's willingness to participate and interact with the code way more for being there.
Yeah, and personally, I find it always odd that I have to jump from one interface to another,
like looking at the issues in Roundup that looks very different,
and then I have to go to GitHub to create my pull request.
Like for me, it's distracting.
Yeah.
So I think it's one benefit that we get this unified experience,
not having to jump from one place to another.
And in fact, I've started writing a PEP for it, PEP 581.
So that's our plan for starting using GitHub issues.
And we've got to discuss more about this during the sprint a couple weeks ago.
Yeah.
Ezio actually went around and asked all other core developers who attended whether they would like to start using GitHub issues.
And most people are okay, like plus zero, at least not totally opposing it.
So I think we might, there's no decision yet because we don't have PDF to pronounce on this.
Yeah, that's another session we're coming up on shortly.
Yeah.
Brett, since you were so involved in GitHub, what do you think about this?
The main reason when we moved over to the Git repo, we didn't move the issues, was twofold.
One was moving the repo over itself was a good amount of work just because we were moving from McEarrel to Git on top of hosting and all that.
But also there were some initial knee-jerk pushback, like don't change too much underneath me.
And so I basically just only had so much energy in the world because, I mean, the GitHub transition took two years.
Like people don't realize this.
It took about a year of discussion and a year of actually making it happen.
So I can only imagine how much more time I would have added to do it.
And how much potential pushback, right?
Well, exactly.
And I just only have so much time in the day to deal with pushback.
And I got buy-in on the Git stuff, so I decided to not press my luck.
I think there's definitely possibilities for having an improved workflow.
Like a lot of the work Marietta has shown the team is possible using bots through Ms. Islington and the stuff she and I have done with Bedivere.
Really show that a lot of workflows can get automated and made fairly cleanly.
I do know there are some core developers, especially ones that have been around for quite a while, who are kind of attached around up in terms of certain feature sets.
So my suspicion is if we can add the missing features that they have latched onto on Roundup and somehow mirror them as appropriate or find an alternative that gives them the same result that they're after.
I think it's definitely a good idea.
And in general, I'm for it because I live in GitHub already for work.
And as Marietta said, everything else is over there already.
So I'm definitely at least a plus zero to a plus one on this.
Perfect.
That sounds good.
So, Lucas, the next one was shortening the Python release cycle.
I suspect that might have had some input from you.
Yeah, cool.
Tell us about that one.
I still do have this idea to attempt to talk about this on the next Language Summit.
And maybe we're going to get somewhere there with it.
But for now, I postponed it at least for 3.8 because currently there is nobody to work with on actually making a decision about it or not.
Right.
So what are we trying to decide?
What was the idea about?
Well, Python has a release schedule that is currently 18 months.
Right.
So every 18 months, every year and a half, we're going to get a new major release of Python.
Like, you know, 3.7 was just out mid-year now.
So, yeah, like, you know, add 18 months and you're going to get a new release of Python late next year.
That'll be exactly when Python 2 goes out of support, right?
Pretty much.
Like, almost, yes.
Like, I'm pushing this, like, a few weeks here and there so that we can, you know, have some more interesting, like, you know, cadence in terms of, you know, doing sprints during Python US and maybe having, like, our annual course sprints somewhere else.
So we try to have those events productive.
So, like, we're not super tight, like, to actually have, like, the release exactly every 18 months.
Like, we always have some leeway.
You know, for example, when we released Python 3.6, we had a course print at Facebook, which was just coinciding with the beta 1 release.
So, like, we're not stabilizing the release.
So, originally, that beta was supposed to happen, like, the week before the sprint.
But that would make the sprint very, very boring and rather sad, you know?
So, I talked with Ned, who is the release manager for 3.6 and 3.7, about just pushing it just a week and a half into the future so that we can actually sort of rally up during the sprint and finish up all the fancy features that maybe are just almost ready but not quite.
And, in fact, as far as far as I can tell, that was the most productive week in the project's history, even up to today.
We're trying to do this every time pretty much now.
But why shorten the release cycle?
Well, the problem with having a release every 18 months is that it builds up this mode of work where most of the time spent on the release is just vague ideas, like having things implemented and left, you know, in a state of there are things that need still to be done.
And then the few weeks before the beta cut is sort of aggressive sprinting on making sure that we actually make it in time to, like, meet the deadline and have our feature shipped.
But this doesn't really create a very healthy rhythm of development in my experience.
And actually, working at Facebook, I learned that, you know, releasing early and releasing often, like, works very well.
It does have a lot of good features, like, it does decrease the size of our release, right?
Like, if we released, say, every six months, that would mean that Python 3.8 and 3.9 and 3.10 would have way fewer differences between them.
So migrating between those releases would also be easier for the user.
There is a price to pay, right?
Like, now your tox matrix on your open source project is way bigger because there's more versions of Python.
It pushes more work onto the release managers and so on and so on.
So definitely something that people need to agree with.
But I still believe that we would be better off having smaller releases that are released more frequently.
That sounds good to me, especially the year thing.
You could schedule the release to be in the fall or something.
So you always have at PyCon sort of a sprint before the beta period closes.
Things like that, right?
For example, yes.
Now it's kind of out of phase, basically.
Every other year or something weird like that, right?
So yeah, I think it makes a lot of sense.
It makes it pretty predictable.
The major tech conferences are in May and June.
We know that Python releases in the fall.
I don't know.
Something like this, right?
Like, that's just how it might go.
This portion of Talk Python to Me has been brought to you by Rollbar.
One of the frustrating things about being a developer is dealing with errors.
Relying on users to report errors, digging through log files, trying to debug issues,
or getting millions of alerts just flooding your inbox and ruining your day.
With Rollbar's full-stack error monitoring, you get the context, insight, and control you
need to find and fix bugs faster.
Adding Rollbar to your Python app is as easy as pip install Rollbar.
You can start tracking production errors and deployments in eight minutes or less.
Are you considering self-hosting tools for security or compliance reasons?
Then you should really check out Rollbar's Compliance SaaS option.
Get advanced security features and meet compliance without the hassle of self-hosting,
including HIPAA, ISO 27001, Privacy Shield, and more.
They'd love to give you a demo.
Give Rollbar a try today.
Go to talkpython.fm/Rollbar and check them out.
Next one is about unplugging old batteries, right?
Python is said to come with batteries included.
That means it has rich standard library and all sorts of stuff you can use.
But every now and then, those go out of fashion.
People stop using them.
Like, what do you do then, right?
Do you still have to maintain them?
So who wants to take this one?
I'll take it because it's been...
I've been rummating on this in the back of my head for...
It feels like a decade now.
So this was a presentation by Christian Hamies.
I'm going to butcher Christian's last name.
I'm so sorry.
Where he basically has a rough draft of a PEP where he has suggested some modules that we can potentially remove from the standard library.
And we've done this once before in a large movement when we went from two to three where I actually personally went through and got a bunch of modules deprecated and removed.
And the main reason we do this on occasion, some things just turn out to not be useful anymore.
For instance, a good example is moving from Python two to three, we got rid of the gopher lib module because who runs gopher anymore?
Heck, who even knows what gopher is, right?
Yeah, gopher, that was one of the originals.
They tell.
I know what that gopher is.
But the key thing here is there is a burden of cost of maintenance for every single module we have in the standard library.
Even if it's just sitting there, there's still the cost of updating it.
For instance, we just made async a proper keyword in 3.7.
That means any module that was using async as a variable name had to be updated.
There's potential bug reports.
There's feature requests.
Even if all those were ignored, they still take time because, for instance, when you go through and triage issues, you still have to see that it's an issue.
You still have to read it.
You still have to choose not to do it.
So there is a time sink regardless of how much maintenance you actually put into it.
So I personally have always wanted to kind of potentially scale back the amount of modules we have in the standard library because I don't think a lot of people realize we literally have hundreds.
I wrote a really quick script the other day to count the number of .RST files in the library directory that had either letters, numbers, or underscores.
And the count was 248.
So that's a rough count of how many top-level modules there are in the standard library.
I mean, that's not an insignificant number.
And you have to remember that there are only 93 core developers in total.
And over the past year, only 46 people across the globe have submitted a PR that got merged.
So there's definitely a maintenance burden here where the amount of code to be maintained is not in a good ratio to the amount of people who are able to help keep it going.
So Christian was basically saying, we got some modules we need to get rid of.
A good example from Christian's PEP is, how many modules do you think there are specifically for processing sound files in the standard library?
So there's three.
There should be one.
No, there's three.
Yeah, there's three.
There's AIFF for AIFC module.
There's the SunAU module.
And then there's the Wave module.
Wow.
Exactly.
So why do we have this?
Why do we even need this kind of thing in the standard library?
So that was Christian's point, was there are some things that literally just don't have a purpose anymore because they were put in back when basically Guido accepted anything.
Because there was no PyPI and there was no distribution model except CPython itself.
Right.
Now you can pip install the tools you need to work with MP3s or whatever it is.
And why does that need to be part of the standard library, right?
Exactly.
And we've never had a discussion as a group to really come down with a set of guidelines of what should or should not be in the standard library.
And unfortunately, as we keep alluding to, lack of governance means there's no one to have that discussion with at the moment.
But it is something we're probably going to have to decide.
Do we want to stay as heavily batteries included now that PyPI exists and is so solid?
Do we want to scale it back and be more targeted towards what a potential script writer needs to maintain their machine?
But as soon as they go past anything standard, they're just going to be expected to go and get it from PyPI.
Yeah, that's an interesting idea.
Like, I don't think, for instance, we would add argparsenecessarily today.
We could have stayed with getopt or something simple and say, if your command line interface is going to get that complex, you need like get level subcommands and stuff.
There's probably going to be something developed better on PyPI that you're going to want to grab versus something we should ship in the standard library that we have to maintain.
And this is also, by the way, why we don't have requests in the standard library because it develops faster.
But also pulling requests would also mean pulling Euralib 3.
And it's just one thing that goes back to maintenance.
How do we keep this sustainable and everyone happy with the code quality while not burning out from the fact that there are nearly 200 open issues against argparsealone?
Right, and the release cycle as well being 18 months means, you know, a new HTTP thing comes out, right?
It would take forever to get that actually into Python's main HTTP library, which would be weird.
Yeah, so basically Christian's just saying we need to evaluate what's in there right now and make a decision of what really should still be there and what maybe should go out.
And he's fairly conservative because, as I said, we've not had a conversation of general guidelines of what should qualify for something being in the standard library.
Yeah, it makes a lot of sense to me.
Like, I have no expectation that I can write a proper web app without going to PyPI and using PIP.
It just doesn't make sense.
But there's obviously the compatibility thing, right?
You don't want to rip out things that someone might be using and break them.
So, definitely worth considering.
Another thing that Christian did was talk about Linux distributions and Python 2 and with the end-of-life Python 2 coming.
How are distributions that ship Python 2 going to deal with that?
Let's keep moving because I think we have some more that are more relevant.
But I think, you know, people can read up on that.
That's pretty interesting.
Lucas, maybe you should take this one because I know you do so much with static typing.
The next session was an update on Python static typing.
Static typing is still very much in progress.
There's a bunch of things that is happening with it.
One of the things that was discussed was how should we package external typing information for projects which are themselves not typed yet?
Or if they want to be typed now, how do we expose this information to the type checker like mypy?
In fact, this is one of the reasons why TypeScript and its ecosystem is so successful because the equivalent there, the definitely typed website and the related integration with NPM that the types provide has proven very successful.
So Ethan has been working on PEP about this, PEP 561.
And as far as I can tell, it's already landed and PyPI already has the required support for it and whatnot.
So in the future, we are going to be able to slowly move away from the model where TypeShed, the repository and the library shipped with mypy and other type checkers, is the sort of library of the collection of types for the entire world.
That's obviously very hard to maintain.
That's obviously very hard to do well.
So we would like to decentralize where the stops are held.
Yeah, that makes a lot of sense.
Like shipping them with, say, when you pip install, if I say pip install SQLAlchemy, it would be great if the stub file that defined the types just came as part of that just landed on my file system.
I didn't have to think about it.
Yeah.
So there were a few other updates.
I want to be like short now.
So like I don't actually steal the entire episode.
But there's a number of other peps that were typing related, like PEP 560 moved some of the typing functionality into the core interpreter so that it's now way faster.
And PEP 563, very dear to my heart, was about making the typing module a bit more usable in terms of just, I don't know, aesthetics, right?
Like enabling things like forward references for classes, which means you can actually use a type of a class within that class or before that class is even defined and whatnot.
And the most interesting probably is 544, which is protocols.
So like duck typing for static type checkers.
This was a rather long presentation and whatnot.
Like I find this top interesting.
So, you know, we can do an entire episode on that alone.
Yeah, absolutely.
And the idea with protocols being that's kind of the way Python type system works.
Like as long as I can call this function and it has this field, like we're good.
And so this is like bringing that into the type annotations world saying, well, whatever you pass here, it has to have this attribute and this method, right?
Something to that effect.
Yeah, nice.
Yes, exactly.
There was a discussion on whether virtual environments are serving us well, especially around the teaching.
Brett, this one actually features Steve Dower, your colleague at Microsoft.
So tell us about it.
Yeah.
So I believe there's actually already a pip now up on the proposal.
Basically, if you follow certain people on Twitter, one of the common issues they have is trying to explain virtual environments to beginners.
And part of that's because pip automatically installs to your global environment and your user environment by default.
There's a long running issue on pip to change that default.
That would be nice.
Yeah.
Feel free to comment on that issue.
I'm sure they love it.
Basically, virtual environments are really what everyone wants, but it's an extra level of work to try to explain how that functions.
And Steve Dower and Kuchel Dauer and various other people got into a conversation over this, where the idea of more or less having something equivalent to node modules directory came up.
The current name is proposed as Dunderpy packages.
And basically, the idea is your dependencies should be installed in the local directory.
And Python would more or less add that to your system path by default.
And you would teach tools of pip to just install in there when appropriate.
And that's it.
It's a fairly simple concept.
Right now, once again, no governance means it really hasn't been discussed beyond getting the pepper written.
But probably the discussion is going to end up revolving around whether that is enough to warrant the added complexity of having this yet another way to specify where your dependencies can live.
And does it solve enough of the problem?
Right.
Are you just changing one hard way to explain things for another and then making it worse by having pip ENV, PIP, this other way, virtual environments?
It's like, ah, can't take it anymore.
Exactly.
So that's going to be the real question, I think, is does it solve the case for enough people to warrant the cost of introducing yet another way to do this?
Because virtual environments won't go away because they do serve a purpose.
It's whether or not this will simplify it for 90, 95% of the world and that last 5% are going to be advanced users who will know how to use virtual environments.
Or do we just have to push the tooling to just get better to make it easier to work with virtual environments as it's such as pipenv or something else?
Yeah, I don't know exactly what the right answer is.
It's a tough question.
But it's, I feel like no matter which of the options you choose, they're not quite there.
They're close.
I use just virtual environments straight up with pip and it's all good, a V&V module.
But still, I hear you.
Very interesting.
Okay, so I think we have time for just two more where we're getting close to the end of our time we have together.
So the next one, I'll let whoever wants this take it.
This is PEP 572.
That was the big in-line assignment PEP that caused a lot of grief and Keto stepped down over.
And now what are we going to do in terms of decision making?
And it sounds like almost everything we've talked about hinges upon this.
Who wants it?
Well, I see everyone's leaping up to take the lead on this discussion.
This one's a hot potato, man.
No one wants this.
All right.
So, yeah.
I can do it.
It's fine.
So, basically, it was a discussion.
This was – so, the language sub button happened in May.
Guido stepped down, I believe, in July.
So, this all predated Guido taking his indefinite vacation as BDFL.
And, basically, it was a discussion of what can we do going forward to manage our PEP process better?
Because PEP 572, which is assignment expressions, was a very, as Michael alluded to, a very hot topic where a lot of things were discussed on Python ideas.
And, clearly, it got resolved.
And it was actually a reasonable discussion.
And then it went to Python dev as part of the PEP process.
And it all got rehashed yet again.
And, actually, it got a little – I don't want to say pushy is quite the right word.
But it got a bit more vehement.
And some people were making rather grandiose statements.
Like, at one point, I think someone, a core dev, said, if this gets emerged, I will refuse to review any PR that uses this feature.
Like, it got really – I personally think overblown.
And, which is partially why Guido just said, I never want to have to fight this hard to defend my decisions ever again.
I'm taking vacation.
So, this was mainly a discussion of what can we do to try to get the PEP process to not be so burdensome while keeping it, obviously, for our needs of recording history.
Making sure we don't have to have discussions about every single solitary suggestion someone has.
And try to find a good balance of load versus, basically, proper gatekeeping to make sure we don't feel overloaded.
Yeah, that's definitely important.
I guess, just to add, I think it's also something we are all looking into improving in our governance PEPs.
We want to try to look into how the PEP process has been going in the past and whether there are things we can improve on how to make decisions.
And as well as where should discussions happen.
Those are also being discussed in the governance PEPs.
Yeah.
Okay.
That's an important one.
All right, Marietta, I'm going to give you the last one because we are out of time.
But we got about three minutes to talk about a pair of presentations, one of which you gave about mentoring and diversity in Python.
Want to give us the wrap on that?
Yes.
So, basically, the whole core team has been trying to improve our diversity.
If you remember a few years ago, there was no women at all in the language summit itself.
But this year, we're trying to improve our diversity among our own contributors team.
And I shared some ideas.
I got some ideas from Sage and shared that with the core developers.
So, we've been doing some things.
I know Guido himself mentored a few women who now are core developers.
I know Victor himself is looking.
He told me he's looking for women to mentor.
And we have set up office hours over in Zulip.
And I know Zach.
Zach, where he has a calendar where people can sign up to get one-on-one mentorship with him.
All of these are all ways we are trying to do in making it to lower barrier into contributing, welcoming more underrepresented people.
I would love to see more diversity in the core developer team.
But also, it's just good for the community overall, I think.
Absolutely, yeah.
Can we make sure we put those links in to the show notes?
Like, if you help me get those links.
So, people out there who may want to contact these folks to get mentorship or consider this process.
For sure, yes.
So, we do have the core mentorship mailing list.
I will share.
And if you look at the dev guide, there is a link for core developers office hours there.
But I will share the links.
Great.
Thank you.
All right.
I think we have to leave it there because we're on a schedule.
Can't just talk forever.
So, thank you all for being here.
Marietta, Lucas, Brett, thank you for sharing this whole experience.
And I'm looking forward to hearing about the 2019 Language Summit when it happens.
Thank you so much.
Thanks, Michael.
You bet.
Bye, everyone.
Bye.
This has been another episode of Talk Python to Me.
Our guests on this episode have been Marietta Wijaya, Lucas Lenga, and Brett Cannon.
And this episode has been brought to you by Linode and Rollbar.
Linode is bulletproof hosting for whatever you're building with Python.
Get four months free at talkpython.fm/linode.
That's L-I-N-O-D-E.
Rollbar takes the pain out of errors.
They give you the context and insight you need to quickly locate and fix errors that might have gone unnoticed until your users complain, of course.
As Talk Python to me.
As Talk Python to me listeners, track a ridiculous number of errors for free at rollbar.com slash talkpythontome.
Want to level up your Python?
If you're just getting started, try my Python jumpstart by building 10 apps or our brand new 100 days of code in Python.
And if you're interested in more than one course, be sure to check out the Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.