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