Latest / Talk Python To Me / #116: 10 top talks of PyCon 2017 reviewed
Transcript
- 0:00Even if you got to attend PyCon, there were just too many great talks to go and attend them all.
- 0:05Luckily, our friends at the PSF were on top of publishing the videos online for the whole world
- 0:11to watch for free. On this episode, we'll meet up with Brett Slacken and replay his path through
- 0:17PyCon. We talk about his top 10 favorite sessions from PyCon 2017. This is Talk Python To Me,
- 0:24episode 116, recorded May 31, 2017.
- 0:28Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:57ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter
- 1:02where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm
- 1:07and follow the show on Twitter via at Talk Python.
- 1:10This episode is brought to you by Rollbar and CodeChip. Be sure to check out what they're
- 1:15offering during their segments. It really helps support the show.
- 1:17Brett, welcome back to Talk Python.
- 1:21Thanks for having me.
- 1:21Yeah, it's always a pleasure. We had a really nice time last, almost two years ago on episode
- 1:2725. And now we're back to talk about PyCon.
- 1:30Yeah, it's been a long time. I can't believe it's been that long. A lot of good episodes
- 1:33between.
- 1:34Yeah, thanks. It really has been a long time. So we talked a little bit before PyCon about
- 1:40another show together. And you had this great idea of like, hey, we're both going to PyCon. Let's kind
- 1:44of do a like a PyCon roundup and go through the talks mostly that you went to because I was,
- 1:50you know, happily stuck in my booth talking to people. So I didn't get to that many talks. But
- 1:55nonetheless, they're all on YouTube. So everyone listening can watch it even if they didn't go
- 1:59to PyCon, right?
- 2:00Yeah, definitely. And that's, you know, PyCon is a great conference for that reason is that on the
- 2:04second day while you're there, they're already uploading talks from the first day.
- 2:07So you can even watch some of the talks you missed yesterday. So you can talk to other
- 2:11people about those talks while you're still at the conference, which is just really amazing that
- 2:15they yeah, yeah, it's really amazing how quickly they come up and the quality, because going there
- 2:21really is a bit of a paradox of choice.
- 2:22Oh, yeah. And they actually set it up to be that way. Like they'll put all of the best talks,
- 2:26quote unquote, best from the speakers that are, you know, most well known for the quality of their
- 2:30talks, they put them at the same time. So you can't possibly go to all of the best,
- 2:34quote unquote, best talks, you have to go and try different things out and see ones from new
- 2:40speakers with different kind of fields of discipline and stuff like that. So it's, that's a big part of
- 2:45the fun of being there. And they're able to do that because they know they're all recorded. So people
- 2:48don't feel like they're missing out.
- 2:49Yeah, they really do a nice job. So I definitely am looking forward to talking about these eight or
- 2:55nine talks that we've picked out to discuss. Yeah. But before we do, maybe you know, it's been almost
- 2:59two years, since you've been on the show, maybe tell people what you do day to day with Python and
- 3:05things like that. Yeah, sounds good. So I'm a software engineer, still working at Google, I work on a
- 3:09product called Google surveys. It's a research platform to answer questions, kind of market research and
- 3:14survey statistics, we can predict elections and that kind of stuff. And we use a lot of Python to do that.
- 3:19So it's hundreds of 1000s lines of Python, everything from Django looking code on the front
- 3:25end down to NumPy and statistical functions. And we also use a lot of JavaScript and go and other
- 3:31things for other pieces of the system. But overall, it's the majority of our code is in Python. And
- 3:35yeah, that sounds like a fun project to work on. Yeah, it's been great. It's I've been working on it for
- 3:39many years now. And it just keeps growing. And it's been amazing to see Python grow from you know,
- 3:44my first commit was, you know, 2000 lines of Python and to have that grow by 100 or 200
- 3:49times. It's been really remarkable that the language kept working.
- 3:52It really does grow and stretch pretty well. It's awesome. We'll even talk about some examples
- 3:57in some of these talks, like for example, with Instagram, right?
- 4:00Yes, exactly.
- 4:01So also maybe catch us up on your book. I originally got to know you through
- 4:05Effective Python, the book that you wrote a little bit before we had you on the show. And I really liked
- 4:10it. So it's still selling. Are you working on new books? Anything like this?
- 4:14Yeah, great question. So it's, it ended up getting translated into a bunch of languages. It's doing well.
- 4:19translated into Chinese, both traditional and simplified, German, Polish, Korean, Portuguese.
- 4:25So it's been crazy to see Japanese also, versions of the book all over the place in the translations
- 4:33of the word of, you know, the words Effective Python and all these other languages. So it's been doing
- 4:37really well. Weird tweets and other languages that I don't know and translate doesn't really capture
- 4:42programming jargon very well. So that's interesting trying to find friends of mine who know these
- 4:46languages to help me understand what people are saying. But do they like the book or what?
- 4:51Yeah, because it's like dry humor or like a joke about the cover not having a snake on it. You know,
- 4:57there's like stuff that it's really hard to get through trans automated translation, right?
- 5:01Yeah, absolutely.
- 5:01But yeah, so I think I'm looking forward to, you know, everyone's watching the Python death clock of
- 5:06Python, two, seven death clock of 2020. And so it'll be interesting to see. I think if you know,
- 5:11if there's another if it's good to have another edition of the book in time for that, because so
- 5:16much is changing. And I think we'll talk about that today. But no plans yet. I think it's still
- 5:20material still really good and is up to date.
- 5:22Yeah, excellent. So people want to check that out. That was episode 25 from a couple years ago.
- 5:26All right. So yeah, let's let's talk about the talks.
- 5:30Yeah, you went to PyCon. I went to PyCon. I didn't get a chance to go to that many talks. And honestly,
- 5:35I find the hallway track to be really quite, quite valuable. You make these connections,
- 5:41and you can talk to people there that, you know, those aren't recorded. And those won't be,
- 5:46you can't relive those, right?
- 5:48Yeah, definitely. And I think they're actually are recording the lightning talks now. But that was,
- 5:51you know, I think if you went to the conference and just did lightning talks and hallway track,
- 5:55you'd probably have a really good time.
- 5:56Yeah, the other place that I spent a lot of time was in the open sessions.
- 5:59Yeah, that's awesome. Yeah, I didn't get to go to any of those this time.
- 6:01Yeah, yeah. And those are still not recorded as far as I know.
- 6:04No, they're not.
- 6:04It wasn't obvious if they were.
- 6:06Yeah.
- 6:06All right, cool. But let's focus on the talks that you went to. And I did go to some of them,
- 6:12and then also went back and watched the others. All right. So the very, very first talk at PyCon,
- 6:18the opening keynote was by Jake VanderPlas.
- 6:22Yeah, and he's a longtime PyCon speaker. I mean, he's been there for many years. And I don't know if
- 6:27you've seen his other talks before, but he's, you know, he's done tons of them. And he's up at
- 6:32University of Washington. He's actually an astronomer. That's his job, which is just crazy
- 6:37that that's someone gets to do that professionally.
- 6:39So amazing, right?
- 6:40Yeah. So yeah, I feel very inadequate whenever I hear him like talking about what he does day to
- 6:45day and the science he does. It's like pretty awesome.
- 6:47Yeah. A lot of the stuff that they do with Python and astronomy is really fascinating. And what struck
- 6:54me about this talk, there were a couple of things. And maybe I'll set the stage before I touch on some
- 7:00of the astronomy stuff.
- 7:00Sure.
- 7:01was basically Jake's theme. I think it was a great way to kick off the conference. It was that
- 7:07the people that you are sitting among these 3000 people and everyone else in the community,
- 7:12we're all here for Python, but we don't all use Python the same way. And we don't all have the same,
- 7:20the same jobs, the same type of challenges and so on. So for example, if I sat down to write like a well
- 7:25structured 50 Python file web application that talks to a database, I'll have one way of thinking and
- 7:33working with Python. If I have astronomy data, and I want to just explore it dynamically, say in
- 7:40IPython notebooks or Jupyter or whatever, that's an entirely different way of working with it. And
- 7:45these different ways of working are an opportunity to learn more and catch Python from a different
- 7:50perspective.
- 7:51Yeah, exactly. And he called it, I think, the mosaic of Python, which I really,
- 7:55I really liked the analogy there. And that's a big part of what's great about going to Python,
- 7:59or even just watching the talks from it is, you have these people from just very different disciplines
- 8:04with very different backgrounds, talking about these subjects. So yeah, he really emphasized that
- 8:08very well.
- 8:09Yeah, I thought that was a great, great opening message. And it was like, okay, I see that the
- 8:14people I'm talking to, maybe they really do have not just a different way of working, but a really good
- 8:20reason to not work the same way that I do. And so I think it kind of opened my eyes a little bit to
- 8:24appreciating the differences.
- 8:26Yeah, definitely. And then he walked us through like all of the tools that he uses, or he knows
- 8:32of in the scientific community, kind of went, walked through like, you know, where they came from. And
- 8:37it was really interesting to me, because he, the way he actually showed it was in kind of these
- 8:42concentric circles of dependencies, you know, where at the core, you know, is Python itself, and then
- 8:47something like NumPy, which is really like a fundamental tool for numerical computation and Python.
- 8:52But I didn't even realize how many additional layers on top of that there are, you know, in terms
- 8:57of machine learning or data processing or things specific to astronomy. And, you know, he basically
- 9:02went off the page with how many concentric circles there are.
- 9:06Yeah. Yeah.
- 9:07Here's Python. Here's a bunch of scientific stuff that you may have heard of. Here's a bunch of,
- 9:12you know, higher level scientific stuff that builds on top of that. Here's all the amazing
- 9:16things that they're doing at in astronomy on top of that. Oh, and by the way, here's all all of these
- 9:23amazing satellites that are coming online, that you basically work with them through Python, which is
- 9:30really, really amazing.
- 9:31Yeah, that was crazy. Because yeah, like the a bunch of different telescopes he showed,
- 9:35and then he like went to the GitHub page where the code is actually completely open source,
- 9:39mostly written in Python, and you can actually go in and fix bugs. And that was another thing he was
- 9:44basically saying, you know, in there is that and so is I think Katie Huff and her keynote later,
- 9:49but, you know, you can go in there and you can you can contribute to these satellites, you know,
- 9:53which is crazy. So it's all done in the open, the kind of this open science approach to,
- 9:57you know, astronomy that hadn't really been there in the past.
- 10:00Yeah, that was another super interesting theme of this talk was how we've seen how successful open
- 10:06source has been. And the challenges as science becomes more technology of how do we make science
- 10:13reproducible. So let's try to follow a kind of a similar path with open science as we do with open
- 10:19source.
- 10:19Yeah, definitely. And I think that that's, there's this graph he had, I think he might have tweeted the
- 10:23graph last year at some point, but just the graph of like, number of astronomy,
- 10:27publications, you know, in academic journals that are using Python, how it's just taking off. And so
- 10:33it seems like this is really interesting effect that the open source approach of the Python community
- 10:38has had on astronomy in particular, and is starting to have more generally where people are publishing
- 10:44their code, their methods, their data, putting them out there so that all the results are reproducible,
- 10:50easy to verify, you can't p hack the results so that you're getting fake discoveries and stuff like
- 10:55that.
- 10:56Yeah, I thought it was really great. And the graph that you're talking about, I mean, it really looked
- 11:00like an example of an explosive growth startup out of some sort of growth hack story. But yeah,
- 11:08no, this is the number of things using Python now, right?
- 11:11Yeah, it makes you think that we just learned how to get into space, or we just invented the telescope,
- 11:15because it's just taken off. It's bizarre. So it's really great. And science is very computational
- 11:20now, where maybe in the past, it was more about labs or film processing or something like that. It
- 11:27seems like data processing is how science is done. And that came across really strongly as well.
- 11:31Yeah, it definitely did. One final thing that he covered that I thought was interesting that kind
- 11:36of is related to that was, people traditionally had learned in the sciences, some very focused language,
- 11:43like there's some language, I don't remember the name of it, that is like, here's how you do astronomy
- 11:47programming, you know, IDL or something like that. Yeah, yeah, I believe it was IDL. That's right.
- 11:51And he's like, that's really great. You can get astronomy job with that. But if all these people
- 11:55now are grad students learning Python, like if for some reason, they don't decide to pursue
- 12:00astronomy, they have a super marketable thing that they've learned as part of it, right?
- 12:05Yeah, definitely. Yeah, it's much better. And then also people can contribute back to astronomy in a
- 12:11way that so it goes both ways. It's two way street, you know, right, like maybe we're programmers,
- 12:15we can program really well, but we don't, we're not astronomers, but we might want to like hobbyist
- 12:19in it a little bit. And we can actually help out on structuring code or performance or something,
- 12:24even if we're not astronomers, right? So you're right, like, I would never go contribute to an
- 12:28IDL program. No, no way. Yeah, it's not gonna happen. Yeah. All right. So going from the sciences
- 12:33and the sort of mosaic, let's kind of go back to maybe more traditional computer science,
- 12:39like large software development house with Dropbox, right? Yeah. This is the talk on
- 12:44mypy and static typing with I think Yuka and David from Dropbox, which is also where Guido works.
- 12:51Yeah. And this project, mypy is something that's like Guido's main focus right now. He said when I
- 12:55interviewed him, what is that like a couple months ago? Oh, great. Yeah. And the things I mean,
- 13:00there's a bunch of things I didn't know here and a couple points that I thought were really
- 13:03interesting. But the first one is they just, you know, oh, okay, Dropbox has 5 million lines of
- 13:07Python. Wow, that's a lot. That's, that's cool. They just tell you that. And then 700,000 lines of that
- 13:13are typed now, which is a lot of code. And so they're actually running the type checker at build
- 13:19time. They do it as part, almost like part of their continuous integration process where
- 13:24you can't commit to upstream until you've run the type checker and verified that it's clean.
- 13:30So it's and then they, they actually said that it's helping engineers at Dropbox move faster,
- 13:36get more done, do larger scale refactorings. So I think the proof that typing was a good idea,
- 13:43Guido is basically helping realize that and kind of test it out and make sure that that this is
- 13:48worthwhile. So any naysayers will be like, well, okay, this is not just an academic exercise in
- 13:53typing. Like we actually have practical use cases, a very large practical code base. And we've shown it's
- 13:58valuable. Yeah, they had a pretty interesting example of just like a three lines of code or
- 14:03maybe four lines of code, like really, really simple function. It's like, you have no idea what
- 14:07this does. It's entirely simple. And but it's it's kind of similar versions, but not identical versions
- 14:13exist in a lot of places in 5 million lines of code, which one is this? And how do you know you're not
- 14:18breaking it? Right? Yeah, definitely. I thought that was pretty interesting. And they also went through a lot
- 14:24of the ways in which you might approach this problem, right? You might put some sort of like, comment in your
- 14:32code, to say, here's what the types are. But then they talked about all the various trade offs on that, right?
- 14:37Yeah, definitely. And I think it's also interesting, because right now, you know, in the landscape outside of Python,
- 14:42you have things like TypeScript, which is the language from Microsoft, and Google's working on it, related to Angular,
- 14:48the the web framework. And then on the Facebook side with react, which is a great framework for for JavaScript
- 14:54UIs, they have something called flow, which is also a type checker. So there's a parallel here where
- 15:00in flow, you know, you do all the type annotation, a lot of it with comments. And then with TypeScript,
- 15:06you do it in line with the special kind of syntax looks a lot like Python, actually. And then Google's
- 15:11old closure compiler for JavaScript also had type annotations and comments. And then in Python to seven,
- 15:16you can get all of the functionality of mypy and typing also do by doing it through comments. So
- 15:20it's kind of like this thing where it's like, well, we didn't plan to have this in the language. So we
- 15:24had to figure out a way to shoehorn it in using comments, that it's a common theme. But now Python
- 15:30three, six, and even since three, three has all the different parts of support that you really need in
- 15:35order to add types everywhere that you'd want. Yeah, and I don't see it being used that often. But I find it,
- 15:42I find it really a valuable thing on the boundaries of parts of my program, like, like,
- 15:48here's this whole data access layer. And I'm not going to go and like fill out the whole data access
- 15:51layer with type hints. But maybe on the external functions that are being used by the rest of the
- 15:57app, like just as you cross that boundary, I find it a really helpful thing some of the time.
- 16:02Yeah, definitely. And I think like with the code base, I've been working in, you know, this 350,
- 16:06400,000 line code base, you know, we've got a bunch of spaghetti in there that we really could,
- 16:10it'd be better if we could refactor it out. And I think finding, kind of discovering the common
- 16:15components in there and putting a boundary around them with a well defined interface that has typing
- 16:19information would make the whole system much more stable and easier to understand, easier to test.
- 16:24So I'm not against types. And I think that for core libraries or core functionality that a code base
- 16:30relies on, it's really valuable. And I liked that they had a really gradual way of adopting it. It's
- 16:35not some big bang thing where you need to go in and start writing types from day one, or you have to
- 16:41freeze your whole code base, switch everything to types and then unfreeze it, you can actually go from
- 16:46a leaf node up to a root node in terms of the file interdependencies, one file at a time,
- 16:51and it all works as expected. It's like a depth first conversion.
- 16:55Yeah, yeah, exactly. So, so I think that's really cool that they they've really thought
- 17:00through that. And they've actually done it. And they explain the strategies for how they would do
- 17:03it. And you're like, okay, run the script this way. Some best practices around checking in the script
- 17:08you use to run mypy to make sure that you actually are running it consistently across all
- 17:12developers workstations. But it was really cool how much progress they've made, even since the last
- 17:17time I saw a talk on this. Yeah, it does really look quite nice.
- 17:21There's two things I'm most excited about here. I mean, I think the first one is just structural
- 17:24typing in Python. I think if you've used Go or TypeScript recently, the structural typing of the
- 17:31interfaces, it's just so nice where you can say, oh, this is looks like a duck, quacks like a duck,
- 17:36it's duck. And we can strictly enforce that it's a duck at compile time. It just feels so great. And
- 17:42it's interesting because mypy doesn't do this. Like Python, you always think of it that way. You're
- 17:46like, oh, if I can call dot open on it, then I can pass it to this function, right?
- 17:49Right.
- 17:49But the type system so far that they're implementing really looks like the Java type system.
- 17:54So it's kind of odd because it's not really Pythonic yet, you know?
- 17:58Yeah, that is really interesting because it's not like you're expressing like the thing that comes
- 18:02here has to have these two functions in this field.
- 18:05Right.
- 18:05It's just, it has to literally be in this type hierarchy.
- 18:09Exactly.
- 18:09Yeah. Interesting.
- 18:10Yeah. And so I think that it's not ready for prime time until that's like, I think people will have
- 18:16trouble adopting it because they'll feel like it's a little clunky until that's done. But they said
- 18:21they plan to do that, which is awesome. Yeah. So that is awesome. Yeah. And there's a PEP.
- 18:25Oh, what's the pep?
- 18:26Oh, I haven't actually found it. They just mentioned there's a PEP for proto. They call it protocols.
- 18:29Okay.
- 18:30There's a PEP for mypy to support those. I couldn't, I haven't actually dug it up yet,
- 18:33but I need to find it.
- 18:34Right. Okay, cool. Yeah. If you're working in PyCharm, it will do that sometimes. Like you can
- 18:39hit a button when you're at the call side of a function and it'll say there's no type hence here,
- 18:45but you're going to need these three properties on whatever you pass. And it'll kind of like pop
- 18:49that up. But yeah, it would be really cool if this supported, I didn't really even think about like,
- 18:54okay, how, how sort of almost incongruent this way of specifying types is with the way that people
- 19:00think of dynamic typing in Python. That's interesting.
- 19:03Exactly. And there's one other repercussion of this that I think is extremely interesting,
- 19:07which is, you know, in Python right now, like you're writing, let's say you're accessing a
- 19:10dictionary and, you know, it's my dictionary, square bracket, the key, and then close square
- 19:15bracket. And maybe you'll do that in a try except, and you'll catch the key error because you're
- 19:19expecting that there might be a key error. Like the key may not be there. It's a common idiom.
- 19:23You see people, oh, I expected this exception to happen. So I'm going to catch it right there.
- 19:27Instead of checking if the key's there and then fetching it,
- 19:30I'm just going to go for it and then handle the exceptional case. In that way, like exceptions
- 19:34are part of the interface for a lot of methods and functions. And you see that all over the place
- 19:37in code. And it's not slower in Python. It's about the same speed as a function call. So this is like
- 19:41something that people do all the time. In the type system of mypy, you can't specify the types of the
- 19:47exceptions that come out of a function. And they have no plans to do it because typed exceptions in Java
- 19:52were really a big problem.
- 19:54Yeah. Yeah. They are challenging.
- 19:56Very challenging. And C# didn't make that mistake, like doesn't have checked exceptions.
- 19:59So I think what it means for Python programmers is that once three, six and mypy become more common,
- 20:05I think that that idiom of raising an exception and expecting it to be caught is going to go away.
- 20:12And I think people are going to do it more like go programming where you return like a tuple of
- 20:15it's okay and here's the result or it's not okay and here's the error.
- 20:19Yeah, sure, sure. Result comma error in some kind of tuple and you just look at one or the other. Yeah.
- 20:24Yeah. And they support optional types in mypy so they can actually enforce typing on the variations,
- 20:29which is really cool. Like they have kind of like what Swift can do. They can do that in mypy already.
- 20:34So this talk to me was like a sneak peek of what Python will be written like in three years,
- 20:39essentially.
- 20:40That's a cool analysis.
- 20:41Yeah.
- 20:41What I was sort of seeing when I was looking at this was part of the overall trend towards Python 3.
- 20:47Oh, yeah, definitely.
- 20:48Yeah. And, you know, when Guido was on the show, I think he mentioned even that
- 20:52this will provide some foundation for helping them move to Python 3 at Dropbox.
- 20:59Oh, yeah.
- 20:59They can reason more carefully about the code and decide if it's going to be a problem
- 21:03at some sort of conversion.
- 21:05Yeah, exactly. Yeah, I think that's definitely the case. And there are already 700,000 lines in.
- 21:09So I think it was probably the first 100,000 that was the hard part. I'm looking forward to an update
- 21:14once they, you know, say that they're totally done or whatever.
- 21:17Yeah, it'll be pretty awesome.
- 21:18Yeah.
- 21:19Hey, everyone. Michael here. Let me take just a moment and thank one of our sponsors who makes
- 21:23this show possible. This portion of Talk Python To Me has been brought to you by Rollbar.
- 21:27One of the frustrating things about being a developer is dealing with errors.
- 21:31Relying on users to report errors, digging through log files, trying to debug them,
- 21:36or a million alerts just flooding your inbox and ruining your day.
- 21:38With Rollbar's full stack error monitoring, you get the context, insight and control you need to
- 21:44find and fix bugs faster. Adding the Rollbar Python SDK is just as easy as pip install Rollbar.
- 21:50You can start tracking production errors and deployments in eight minutes or less.
- 21:54Rollbar works with all the major languages and frameworks, including the Python ones like Django,
- 21:59Flask, Pyramid, as well as Ruby, .NET, Node, iOS, and Android. You can integrate Rollbar into your
- 22:05existing workflow. Send error alerts to Slack or HipChat or automatically create new JIRA issues,
- 22:10pivotal tracker issues, and a lot more. They have a special offer for Talk Python To Me listeners.
- 22:15Visit talkpython.fm/Rollbar, sign up and get the bootstrap plan free for 90 days.
- 22:20That's 100,000 errors tracked for free. But you know, just between you and me,
- 22:24I hope you don't encounter that many errors. Give Rollbar a try today. Just go to talkpython.fm
- 22:30slash Rollbar. So let's talk about the gillectomy. Yeah. So this is Larry Hastings talk,
- 22:37and he's been at it for a couple of years. And first of all, let me just like take a step back
- 22:43and maybe tell us what the GIL is. And do you think the GIL is actually a problem for Python?
- 22:47Wow. Okay. Okay. So the gill, yeah, the global interpreter lock, which is the part of the
- 22:51CPython interpreter that locks the state machine state while your program is running so that
- 22:57different threads don't trash each other. It's a key part of how CPython works, how CPython's virtual
- 23:03machine works. And it has unintended consequences, which are that it prevents your Python program from
- 23:10using multiple cores at the same time. So it limits the actual execution speed of Python,
- 23:16vanilla Python.
- 23:17Right. Basically only for computational stuff.
- 23:19Only for computational stuff. Yeah.
- 23:21When you are waiting on the OS, like for network or file, it releases the gill, right?
- 23:26Yeah, it does. And so for IO bound applications, or memory bound applications, it's not a big deal. But for
- 23:33CP bound stuff, especially servers where they're trying to be really high, like highly responsive,
- 23:38that can be a problem. So yeah, to answer your question, is it a problem? Well, depends on who you ask.
- 23:42Like, in the JavaScript community, v8 is not multi threaded in the same way. It's completely single core for similar reasons.
- 23:50Which means node is in a similar situation, right?
- 23:53Yeah.
- 23:53But you don't really hear people complaining about that with node, because it's really all they can use.
- 23:58And then things like Go are, you know, are highly concurrent, super fast. And so I think Python's limiting itself by not being able to use all CPUs out of the box. There are tools like multiprocessing, the multiprocessing module for Python that do let you take advantage of all CPUs. It's just, it's just hard to use if you don't know what you're doing.
- 24:15I don't think it's that huge a problem. I think the thing that's sort of relieved the pressure is there, when you really are doing a lot of computation, often there's some library and some bit of it is in C, and it really does take advantage of it, like NumPy or something, right?
- 24:28So yeah, the really intense cases seem to have already worked around it, and you just pip install a thing and you're okay.
- 24:35Yeah, but even in those cases, like NumPy and other packages like this, it's like, you need to restructure your program to take advantage of it. And I think that's the burden. It's, this was working, why can't I just turn up the speed dial and have it go faster, or increase the concurrency, you know, where you can do that with some other languages or other constructs. So yeah, I think most people, it doesn't matter. But I think certain areas, it does. And so I'm happy that they're spending time on it. And Larry's been diving into it.
- 25:01Yeah. Okay, so that brings us to the Gilectomy.
- 25:03Yeah. So yeah, he's been talking about it for a couple years now. And he's, he's trying to remove the GIL or at least remove the overhead of the GIL. And it's been tried a few times. If you look back at his older talks, I think there's an attempt at it. The original attempt at it was by Greg Stein, who I actually used to work with at Google. And he had added multi course, multi threaded support to Python, I think version, maybe it's version one five or version two, way back when. And it was insanely slow. It was like, awful.
- 25:33And so yeah, anyway, so Larry's got a very particular style of presenting, which is, which is funny and very intense. But yeah, he just right off the bat, he's like, yeah, you know, Python without the gill, you can take the GIL out very quickly. It's actually not too hard. The problem is that it's really slow. It's 19 times, the one with the gills 19 times faster than the one without it, right?
- 25:51Exactly. So yeah, you can do this. But before you see any advantage, you're going to need like 32 cores and really highly concurrent algorithms.
- 25:58Yeah, exactly. You know, Larry is the guy who knows this stuff. So it's been interesting, because he is taking, you know, everything he knows, every trick in the book, essentially, and applying them to this GIL problem.
- 26:12Yeah, so he, you know, in this talk, he walked through a lot of those. And, you know, we can talk about a couple of those examples. It started off just seeming hopeless, like he has no chance. And the graphs he was showing was the amount of CPU time that it takes to run a bunch of benchmarks, or maybe the Fibonacci benchmark. And it just looked hopeless. And all of his work was hopeless.
- 26:28And so about halfway through the talk, I'm like, Oh, man, this is like, he's like, totally failed on this attempt, you know, but well, I won't give away the end. Okay, because we can talk about the end in just a second. But there's a bunch of techniques, though, that he used. I don't know if you remember any.
- 26:42Yeah, well, I think what was interesting about this was he did lay out a lot of the different techniques and things that he had tried over over time, and really pulled out a lot of the challenges and trade offs that you have to make. And so it's like, I want the Gilgon, I want to just like, take advantage of all the CPUs.
- 26:58Well, here are the trade offs. And here's where things actually get slower. And so there was stuff around garbage collection and managing reference counting and consistency there, the different types of locking that he had used, and just some of the allocation stuff. And yeah, it was, it was interesting.
- 27:14Yeah, and there's a lot of reference. That's exactly right. And there's a lot of references of things that I like need to look up after that, like, some two stage locking stuff, getting rid of like accelerating thread local variables. There's something about, there's a book called the garbage collection handbook that I like, I was like, Oh, wow, I've heard of that has an algorithm called buffered reference counting, which I guess was the was the way that they he was able to make it fast.
- 27:36So it's just really interesting to see how much it takes to do it correctly. But how it's actually all very well known algorithms in computer science research, and there's papers on basically everything that he's trying to do. So he's not actually treading new ground, which is really encouraging, because it's just about applying it to the Python space. He's not inventing some new technology that needs to be proven, and might be full of bugs. He's like, Oh, no, this is in the handbook.
- 28:02He also invented it independently. But he's like, Oh, no, this is this is actually a known technique that I'm using. So even when he did invent something, it just was like a reinvention of the thing that existed, right?
- 28:12Yeah, like from the 1977 or whatever it was. Yeah, that's always how it is.
- 28:16It's definitely how it is.
- 28:17Yeah. But ultimately, the last graph he showed was that it's really close now. I'm shocked because I did not think it was going to be possible. And you know, he's within, I think, maybe two x or less of slowness.
- 28:30Wow.
- 29:00You know, you can imagine that Python two seven goes away, because Python three, three has no gill, and it's super fast, or Python three has no GIL and super fast. And people like, wow, why would I use Python two, and I could use Python three, and run a lot faster.
- 29:12Yeah, so this is actually an interesting point. I don't believe the galectomy came from these origins. But, you know, the next thing that we're going to talk about, I think, more or less did. And Brett Cannon, and Dino Veland are working on you started working on this thing called pigeon pigeon pigeon pigeon pigeon pigeon pigeon pigeon pigeon.
- 29:30Basically, there's a couple of folks in the core developer saying, what can we do to improve adoption of Python three?
- 29:36Right.
- 29:37What if we made it 50% faster, right? That alone, if nothing else happened, that alone would make a huge difference.
- 29:44And I think actually, regardless of whether it's been faster or not, the last two years have made like a huge shift towards Python three.
- 29:52Yeah.
- 29:53But the next talk that we're going to talk about by Victor Stinner was really highlighting some of the performance improvements that he and some other folks have done on Python three.
- 30:03Yeah, definitely.
- 30:03I really like this talk.
- 30:05And I thought, you know, Victor's a really solid member of the Python core developer community.
- 30:10And I really like this talk because it was very scientific in its presentation.
- 30:14It was like, okay, here's, here's how we did the measurements.
- 30:17It started off just with that.
- 30:18You know, this is like, right.
- 30:20As you say, it like actually started out with the measurements we've been using are unreliable.
- 30:26First thing before we even start this process is we have to fix the measurements, right?
- 30:29Yeah.
- 30:30Yeah.
- 30:30You can't even trust the numbers we used in the past.
- 30:33So speed.python.com, which has all the benchmarks on it is like not something we should have been judging ourselves by in the past.
- 30:40Yeah.
- 30:40So that was, that was great.
- 30:41Right.
- 30:42And part of that isn't even just like, hey, we were bad at like running this code, but modern CPU architectures have things like turbo boosting and the speed at which your processor might run at could vary by like two or three X depending on how it's trying to save energy at the time and all sorts of stuff.
- 30:58Right.
- 30:58Yeah.
- 30:58And that came up, that actually came up in a few different talks, including the Gilectomy one, another one I went to where people are trying to benchmark things and there's no good way to like disable all of the magic features that are in modern Intel CPUs or even ARM CPUs.
- 31:13And so I think that there's actually a module that they're putting together.
- 31:17That's like the standard benchmarking module that turns off all of this stuff automatically.
- 31:22I actually don't remember what the, what it was called.
- 31:23It was like perf or performance or something.
- 31:25I think Victor Stenner had worked on it.
- 31:27Yeah.
- 31:27Yeah.
- 31:28So that's great.
- 31:28So I think if you're doing any benchmarking of any kind, you know, it's worth picking that module up and using it for your purposes.
- 31:34So you can make sure that you're actually comparing stable numbers over time.
- 31:37Yeah.
- 31:37So then he talked about, I didn't count him exactly, but just something like 10 major, major improvements on Python 3.5 and 3.6 where he focused.
- 31:47Yeah.
- 31:47And there's, I mean, there's so many of them.
- 31:49It's getting into the weeds with some of the stuff, but one of the ones was, one thing is like, it's no longer actually called Python bytecode.
- 31:56That was one I liked.
- 31:57So Python doesn't have bytecode anymore.
- 31:59It has something called word code because bytes only one byte where a word is like 16 bits or, you know, it's multiple bytes.
- 32:05Yeah.
- 32:06And so there's some inner loop in the CPython runtime that had an if statement, which is like, okay, is this bytecode, does it have any arguments?
- 32:13Because if it does, then it's more than one byte.
- 32:16And they just said, you know what, let's just get rid of that and just have it be two bytes always because memory performance on, you know, modern machines is good enough that we don't need to actually save space.
- 32:25Yeah.
- 32:25And they basically removed a conditional check in C eval.c, which is like the switch statement.
- 32:33Yeah.
- 32:33Yeah.
- 32:33The hot loop.
- 32:34Yeah.
- 32:34That's the super hot loop.
- 32:35And so simple things like that, like maybe we'll just throw in like a wasted byte when there's no arguments and that will actually make it a little bit less memory efficient, like tiny, but much faster.
- 32:47Yeah.
- 32:48Yeah.
- 32:48Yeah.
- 32:48Exactly.
- 32:49And so it ends up like netting, I don't remember what the performance boost, but there's a bunch of these that improve benchmarks by, you know, 5%, 10%, 20%.
- 32:57And that stuff really adds up.
- 32:58So it's really, they've done a lot.
- 33:01And so Python 3.6 is extremely fast compared to others.
- 33:04It's amazing to see that that progress.
- 33:06Yeah.
- 33:06So I would definitely say, especially if you're on Python 2 still and you're like, is it really worth switching?
- 33:11You know, I get this language feature.
- 33:13Sure.
- 33:13I can do double star to create dictionaries out of other dictionaries and whatever, but is that really worth it?
- 33:18Like check out this optimization talk because there's a lot of stuff where it's like, and this is 40% faster and this is two times faster and this is 12% faster.
- 33:26And it's just like, whoa.
- 33:27Yeah, definitely.
- 33:28And like the decimal module, for example, that one is actually just rewritten in C, but I think it was 40, 40 times faster.
- 33:33Yeah.
- 33:3340 times faster.
- 33:34Which is like, I've used decimal all the time.
- 33:36So that would be helpful for, you know, what I've done.
- 33:38He also alluded to something that will be in Python 3.7.
- 33:40He didn't really want to go into it yet because he says the results aren't perfect or fully proven.
- 33:45But he did say that in Python 3.7 that method calls are going to be faster across the board.
- 33:51And, you know, that's my biggest problem I would say with Python is that calling a function is really slow.
- 33:56Yeah.
- 33:57That's a really good point.
- 33:58Like you are at odds with performance with structuring your code well.
- 34:03Exactly.
- 34:03And so especially with the optimizing code, you're like, well, this is really hard to understand.
- 34:08So I'm going to split this into functions so I can like follow it.
- 34:10And as soon as you start doing that in Python, like you're slowing your program down every single time.
- 34:15And that's not a tradeoff you want to make.
- 34:17You know, that's terrible.
- 34:18And so anything you can do to make function calls faster, they already, he already talked about a few of those.
- 34:23And he said there's more coming in 3.7.
- 34:24So I just, I think it's maybe a, the beginning of this performance renaissance in Python.
- 34:28Yeah.
- 34:29That I'm really looking forward to the Gilectomy being part of that as well.
- 34:32But just, you know, meat and potatoes optimization, which is what Victor's doing.
- 34:36It's just really great to see.
- 34:37Yeah.
- 34:37Really, really amazing stuff.
- 34:39And some of the stuff that struck me was like how simple the changes were, but how careful you have to be in making them because of the edge cases.
- 34:47It's like, here's a simple optimization, but it took us two and a half years because it was incredibly difficult.
- 34:53To get every edge case just right.
- 34:54Yeah.
- 34:55Yeah.
- 34:55Totally.
- 34:55Yeah.
- 34:56And that's, that's why it's like a darker, you know, you really need to know what you're doing to optimize and you need really good tests.
- 35:01I think the case you're talking about is they rewrote LRU cache algorithm.
- 35:04And yeah, it took them like two.
- 35:05Yes.
- 35:05That was the one I think.
- 35:06Yeah.
- 35:06Two and a half years.
- 35:07Yeah.
- 35:08It's pretty, pretty crazy.
- 35:09Yeah.
- 35:11That's pretty amazing.
- 35:12All right.
- 35:12So one that I did not see, but you went to, maybe you can tell us about is the debugger one.
- 35:16Yeah.
- 35:17So this is by Elizaveta Shashkova from JetBrains, I think in St. Petersburg.
- 35:24And this one was really cool.
- 35:25So it's cool because there's this PEP called PEP 523 and it's a Python enhancement proposal.
- 35:32And it's a, the purpose of the PEP is to give a pigeon, which you were just talking about,
- 35:38which is a JIT compiler, a just in time compiler for Python to make Python faster.
- 35:43That's what the PEP was for.
- 35:44It added a bunch of hooks into the C, CPython runtime that lets you change the way that functions
- 35:51and code are evaled.
- 35:52Okay.
- 35:53So you can plug in new stuff.
- 35:54Yeah.
- 35:54The big idea is like, let's not keep rewriting new runtimes.
- 35:58Let's try to find a way that you can plug into the one that we all have without forcing everyone
- 36:03to go, should I do PyPy?
- 36:04Should I do JIT?
- 36:05Should I do IronPython?
- 36:06Like, forget this, right?
- 36:07Yeah, exactly.
- 36:08And so make it more extensible.
- 36:10So that's really cool that that PEP was created and has been plugged into Python.
- 36:15I think it might be 3.5 that it landed.
- 36:17But what they didn't realize when they developed this PEP is it would enable new use cases.
- 36:22And so Eliza, what she went through is how they actually leverage that same interface to
- 36:29enable a debugger for Python that is as fast or almost as fast as just vanilla Python.
- 36:36And so if you've ever run your Python code under a debugger, it's something like 30 times slower.
- 36:41Oh, interesting.
- 36:42And so it's really hard to actually simulate a lot of the problems you have.
- 36:45Or if you have timing issues, especially where there's races, you just can't even reproduce
- 36:49them because it's so slow.
- 36:50Everything runs in the right order under the debugger.
- 36:53And then once you run it normally, then it goes fast enough.
- 36:57And then you get these data races again.
- 36:58And then you can't.
- 36:59Then you get the bugs.
- 37:00Yeah.
- 37:00Yeah.
- 37:01Heisenbugs.
- 37:01Heisenbugs.
- 37:02Right.
- 37:02And so they created this thing into JetBrains.
- 37:05And I think it's I think the core of its open source, where it basically uses the PEP523
- 37:12hooks that are meant to be for speedy eval.
- 37:14And it'll actually rewrite the Python bytecode or wordcode in as it's coming through and insert
- 37:20breakpoints into the bytecode, which makes it, you know, orders of magnitude faster because
- 37:25the old Python debugger uses it's a set trace where you get a function call for every single
- 37:31line of Python.
- 37:32It's almost like a profiler.
- 37:33Yeah, exactly.
- 37:34And it's the slowest thing imaginable.
- 37:36You know, it's first of all, you're calling a function, which is slow.
- 37:39Right.
- 37:40And then you do it for every single line, whether or not you want you care about that line.
- 37:44So I love this talk because she walked through all the how the debuggers work, all the details
- 37:48about why they're slow benchmarks are on that.
- 37:51Then she explained her approach, how they do it, what it's good at, how it works.
- 37:55She even showed the disassembly of the Python bytecode and how they plug into it.
- 37:59So it was really awesome.
- 38:01Yeah, that's cool.
- 38:01I'm definitely going to have to check this one out.
- 38:02Yeah, I would.
- 38:03And my favorite part about it is just like that PEP defined an interface that is generally
- 38:09useful to people.
- 38:11So it wasn't intended to be used for this purpose, but it was general enough that it could be.
- 38:17And that's good design from my perspective.
- 38:20Yeah, it's really nice that, you know, that wasn't even part of the plan, right?
- 38:25But just this flexing and growing CPython actually made this other use case really good.
- 38:31Yeah, definitely.
- 38:32So I'm looking forward to using that debugger.
- 38:33And I keep hearing great things about PyCharm.
- 38:35And I've never actually used it for anything like day to day.
- 38:38I poked around with it, but never built a whole program with it.
- 38:42Yeah, I don't know if this is the same thing.
- 38:43But when you debug something in PyCharm, if you just do that on like a brand new machine,
- 38:49it'll say warning the debugger speedups are not built.
- 38:52You basically have to run this compiler statement to like build something into your system.
- 38:58Oh, yeah.
- 38:59That might be the same thing.
- 39:00Yeah.
- 39:00I think that might be it actually.
- 39:01Yeah.
- 39:02So there's like a little output that it says, hey, you can make this much faster if you run this line once.
- 39:06Gotcha.
- 39:06Yeah, no, I didn't know about that.
- 39:08This portion of Talk Python To Me is brought to you by CodeChip.
- 39:12Try CodeChip Basic, a free, simple, out-of-the-box, continuous integration service in the cloud.
- 39:18Thousands of customers use CodeChip Basic every day.
- 39:21Its pre-installed CI dependencies make testing your software and deploying it work out-of-the-box.
- 39:26The average setup time for CodeChip Basic is less than three minutes.
- 39:31CodeChip Basic comes with a free plan that grants 100 builds per month, unlimited projects, and unlimited users.
- 39:38Do you run an open source project?
- 39:40Those are always free on CodeChip.
- 39:42And they just improved their Python support.
- 39:44So give CodeChip a try and visit talkpython.fm/CodeChip to learn more and sign up for free.
- 39:51That's talkpython.fm/CodeChip.
- 39:54So one of the things that I thought was really neat, you know, I think there's a lot of things touching on this.
- 40:00It's like, hey, this Python 3 stuff is becoming really amazing.
- 40:03And maybe the pinnacle of that was the Instagram keynote.
- 40:08Yeah.
- 40:09And this is a great talk.
- 40:10It was kind of two parts.
- 40:11I think Lisa Guo was the one who talked mostly about the actual transition.
- 40:17But it was, yeah, how they moved from Python, you know, Python 2 to Python 3 while not having any downtime.
- 40:24Oh, yeah.
- 40:25I watched this talk and I thought, okay, there's almost no other company out there.
- 40:29I mean, maybe a handful, but almost anyone else that says, well, we can't switch to Python 3 because we have a large code base.
- 40:36We have a lot of users.
- 40:37We've got to keep shipping.
- 40:38Like what Instagram did was really quite incredible.
- 40:44The first thing that I sort of thought, okay, this is going to get really interesting is they just have one branch that they develop from, right?
- 40:52They don't just like, it's not like they said, well, let's just fork everything and go over there for six months and work on that.
- 40:58Yeah, and that's a recipe for disaster, I think.
- 41:00And I actually work in a monorepo with a single trunk as well.
- 41:04I've been doing that for years, which is kind of odd for many people.
- 41:08And it's a great way to develop, but it does make it challenging to do large refactorings like this where you're changing style all over the place.
- 41:16I want to do it all at the same time without breaking people or making sure that commits keep flowing through.
- 41:21So just in terms of process and collaboration with a large team of people, I don't remember how many engineers they have working there, but it's hard.
- 41:29Yeah, but there are many, yeah, quite a few.
- 41:30So their goals were, we're not going to branch.
- 41:33We're going to take our existing code, which is Python 2.7 running Django 1.3, which is five versions out of date.
- 41:39Yeah.
- 41:40And we're going to move that to Python 3 and the latest version of Django.
- 41:44I suspect that Django switching and Django 2 saying like, we're not going to support Python 2 anymore.
- 41:51So we're just done.
- 41:52They're like, we're kind of painting ourselves into permanently into a somewhat of an old version.
- 41:56Let's see if we can like, you know, get back on track.
- 41:59Yeah.
- 41:59And that was the incentive there.
- 42:01Yeah.
- 42:01I thought that was, you know, there's been this push to get all the libraries into Python 3, which has really made a lot of progress over the last, let's say, five years.
- 42:07And now it's, you know, it's almost there for all the major ones.
- 42:10And this is example, this is an example of the dividends that that's paid off because now Python Django 2 is like, yeah, we're not going to support these older versions.
- 42:18And then Instagram's like, well, we really like that open source project and we collaborate, you know, we work on that.
- 42:23And so they're incentivized to move.
- 42:25And she also mentioned that Python 3.6 is just faster, which is, so those are two proof points that this strategy that Python's had more recently, maybe they should have had earlier, that would have helped the transition to happen faster.
- 42:37But this more recent strategy of performance in libraries is starting to actually be enough of a carrot and a stick to get people to start converting at a large scale.
- 42:47Yeah, it's really, really interesting.
- 42:48I totally agree with you.
- 42:49So they said, we're going to try to continue to ship new features.
- 42:53We're going to check into this one branch.
- 42:55We're not going to branch it.
- 42:56We're going to have a very careful rollout of Python 3.
- 43:02I thought that was actually really interesting as well.
- 43:05Both the test, how they did the testing by saying, we're going to slowly say, these are the tests that pass and we'll like eat our way back into all the tests until they basically all pass again.
- 43:16And the way of staging the rollout as well was interesting.
- 43:20And they were basically maintaining a Python 2 and 3 code base, like one that could run under either runtime at the same time.
- 43:26So that's kind of how they started this and what gave them the ability to make those more tactical moves in production.
- 43:33They ran the tests, all the tests under 3 and 2 using a whitelist or an exclusion list, inclusion and exclusion lists.
- 43:41And then they basically just started moving test after test across and setting up some best practices and all that kind of stuff.
- 43:48And yeah.
- 43:49Yeah, I really like this, that it was very prescriptive.
- 43:51These are the steps you need to take.
- 43:53Do it this way, this way.
- 43:54And then like it was really a roadmap, not just a, hey, look, we did it.
- 43:58Yeah, definitely.
- 43:59Like if you work somewhere and you want to be able to explain to your boss, like, oh, this is, this is what we need to do and how we need to do it.
- 44:05Like this is just have them watch this video because it's really, definitely.
- 44:09It's really convincing.
- 44:10And it has a bunch of best practices for teams.
- 44:13And it even has some like nuggets that are really valuable.
- 44:16Like one I thought was really cool was they talked about they rely on memcache so heavily.
- 44:22And there's this issue between version two and version three of memcache where, oh, sorry, version two and version three of Python where the pickle module becomes, it can poison the other version.
- 44:33I don't know if you remember seeing this.
- 44:34Right.
- 44:34They're basically, yeah, they're basically incompatible with like their serialization format and various things.
- 44:39Yeah.
- 44:39Yeah.
- 44:39So it was really interesting because I've actually had this problem in production many times.
- 44:44Even if you don't change the version of Python, you can cause memcache poisoning where you have a pickle version of the object and you've somehow slightly changed the structure of the object.
- 44:52And now if you have two different versions of your app accessing memcache at the same time, but they both have different definitions of the object, they'll actually start poisoning each other and you'll cause just total runtime failures.
- 45:04And the only solution, even if you flush the cache, it doesn't work because the old version will start writing it stuff into the cache.
- 45:11The new version will start writing it stuff.
- 45:13So there's, once you get into this loop of death, it's like, there's nothing you can do.
- 45:17It's really scary.
- 45:18Yeah.
- 45:18So they started, they started partitioning their memcache keys to make sure that they wouldn't interact.
- 45:23I'm envisioning them putting like PY3 or PY2 in front of every key name or something.
- 45:29Exactly.
- 45:30And that's really an amazing best practice.
- 45:32It seems so obvious when you hear about it, but like, I think that that's something that, you know, even if you're just doing rollouts of deployments or, you know, you have new Docker images that are holding your app in them, that's actually a great strategy.
- 45:43Just to reduce the amount of incompatibilities between the runtime, the, you know, runtime versions you have going on.
- 45:48Right.
- 45:49Maybe even like your app version or something, right?
- 45:51It could even be, be that much, but it could be your code change, not Python's internal change.
- 45:56Yeah.
- 45:56That's, that's what I'm trying to say.
- 45:57Yeah.
- 45:58Between your own code versions, you know, your commit hash, you could use as a, as a prefix.
- 46:02I think that's a really cool best practice.
- 46:04Yeah.
- 46:04Cool.
- 46:04Yeah.
- 46:05So I really liked this.
- 46:06And in the end, they, I guess I could talk about the rollout really quick.
- 46:11That was interesting.
- 46:11They said, okay, first thing we're going to do is we're just going to run the tests on Python three as well.
- 46:17And we'll start to slowly work that up.
- 46:18And then we're going to switch all the dev environments to run Python three, but still ship to do continuous integration and ship to Python two.
- 46:27And then once we get all the dev environments working and we stop hitting bugs, we're going to switch to just the employees of Facebook.
- 46:34And then 0.1% of the users and then like 20%.
- 46:37And then, and so they, they had this really structured rollout and they said, but by the time we got done with the internal use cases, we were like, there's barely anything left to do.
- 46:45Yeah, definitely.
- 46:46So that's, that's just really conservative.
- 46:48Well done.
- 46:50And I'd say just, you know, you have to have everyone on board though, that it takes time.
- 46:53It's going to take a lot of resources.
- 46:55You need to dedicate a team is not doing anything else.
- 46:57And yeah, so I think it's a model that we should all follow.
- 47:01Yep.
- 47:02And in the end they said, look, there's these different parts of our code.
- 47:05We run Python and Django and uWSGI.
- 47:07We run our async stuff like notifications and celery.
- 47:11And we got a 40% performance improvement in, in celery, in the async area.
- 47:16And we got a 12% performance memory speed improvement in the web front end, which there's like something you could take to your, your company, to your executives and say, look how much we're paying for all of these servers we got to maintain.
- 47:31Right.
- 47:32Look how much better it'll be.
- 47:33Yeah.
- 47:33I mean, it just, it just translated straight to like a financial savings and number of machine capacity, you know, that you could get out of it.
- 47:39And that's, that's another just amazing kind of convincing argument.
- 47:43So it's just, you know, you have speed and you have efficiency and then you have the cost savings.
- 47:48So it's, it's great.
- 47:48Yep.
- 47:49It's great.
- 47:49So we started this whole discussion of, by thinking of satellites that look out into space.
- 47:54But the next one you went to is about satellites looking in towards the world.
- 47:58Yeah.
- 47:59So this is a, this is by Catherine Scott and she, she wrote the book on open CB for Python.
- 48:04She's been in Python community for a while doing a lot of stuff like robots and computer vision.
- 48:09And I think she recently joined a company called planet, which is a satellite imagery company that lets you buy satellite imagery and also let you get access to it for free under a bunch of circumstances.
- 48:21And that was a big part of the pitch of this talk was kind of showing you that, that API and for academic research and all these other purposes, how you get access to it.
- 48:30So it's more accessible than I've ever knew that you could, you know, you can say like, Hey, this lat lawn, like, can you give me every image of it, you know, for the last number of years?
- 48:40And they can actually, you can actually pull that up through an API now, which is just totally bonkers.
- 48:44You know, that's really cool.
- 48:45And you could actually see how it changes over time, maybe.
- 48:47Yeah. And, you know, and, and for her, you know, she mentioned it was, it was kind of like an aside, but for her, it was also like something that she thought was politically important or, you know, deforestation of the rainforest and like all these other kinds of things like that.
- 48:58She thought it was useful for, but also just like plain old science, understanding ecology and urban analysis, but urban environments from space and just all kinds of GIS kind of use cases.
- 49:09So it was really cool to see her work, work through a bunch of those, those examples.
- 49:13Oh yeah. That sounds, that sounds really interesting.
- 49:16Another one controlling things or even more so was the factory automation one, right?
- 49:21Who I think actually they used to work together, Catherine and Jonas, I don't actually know that, but he works at Tempo Automation, which is a pick and place robot company in San Francisco.
- 49:30And so they do a lot of crazy things, factories.
- 49:32I love this talk.
- 49:34It was really fun because he had a live demo for the entire thing.
- 49:37And I'm pretty sure that the video captures some of that.
- 49:41I don't know if you remember seeing that, but he had this conveyor belt contraption set up there and had a conveyor belt and had two pusher pads and he had some gum, like chewing gum.
- 49:50And he's like, we're going to build a robot that will sort this gum into bubble gum and, you know, and spearmint gum based on the color of the package and a barcode.
- 49:58Oh, that's cool.
- 49:59Yeah.
- 50:00And so then he walks you through.
- 50:02Okay.
- 50:02In Python, there's actually a PI serial library that will interface with a serial port and the serial port is a micro scanner for barcode.
- 50:08And, and so he just like walked you through just from the beginning, like, okay, here's how you can scan a barcode.
- 50:14Here's how you can actuate a little paddle, like in a pinball machine.
- 50:18Here's how you can turn on a conveyor belt.
- 50:20There's all this stuff I never, I know it's in there.
- 50:23I've seen stuff on TV or whatever about factories and conveyor belts and factories, but he just went through like how it all actually works together.
- 50:31And you can do it all from Python.
- 50:33There's great libraries for it.
- 50:35And it seemed really easy.
- 50:36So it's like, that's one of the best talks where you're like, oh, I could totally do this, you know?
- 50:40Yeah.
- 50:40Made it entirely accessible, right?
- 50:42Yeah.
- 50:42Totally accessible.
- 50:43Excellent.
- 50:43Yeah.
- 50:44That's great.
- 50:44Yeah.
- 50:45I really think the internet of things and these little devices, we're just at the beginning.
- 50:49There'll be really cool stuff we can do with it.
- 50:50Yeah, definitely.
- 50:51And I think it also makes you realize that the internet of things, you know, we talk about it mostly for consumers and the little devices in our houses.
- 50:59But in the factory, these devices are actually much more impactful.
- 51:03And so you have sensors on control, you know, on conveyor belts or factory floors or the actual, like, not the supply chain, but the Henry Ford thing that's escaping me right now.
- 51:13Assembly line?
- 51:13Assembly line.
- 51:14Thank you.
- 51:14Yeah.
- 51:15And so I think, you know, he just showed all of the things you need in order to do that.
- 51:19So it's awesome that it's available over the internet, but it's also really scary because you're like, wow, if someone got access to that thing over the internet, they could, you know, cause a conveyor belt.
- 51:27Like, yeah, I love Lucy style to be like running at a million miles an hour.
- 51:30Yeah.
- 51:31So I thought that was pretty funny just seeing into that as well.
- 51:35Yeah.
- 51:36That's neat.
- 51:36Yeah.
- 51:37All right.
- 51:37The last one I thought was really pretty inspiring by Marietta.
- 51:41Yeah.
- 51:42Called Dial M for Mentor.
- 51:43Right.
- 51:44She's the first female Python core developer who's landed a commit into Python, you know, 20 some odd years after Python started.
- 51:51So it's just really great that the Python community has been able to, we had a couple years ago, Hey, we need to really diversify the people who are committing to the core, sent out the call.
- 52:02They tried to mentor people.
- 52:03And he repeatedly said that we need to have more different types of people committing to Python.
- 52:07And so she is, she is the first committer, female committer to Python and to the core.
- 52:14To me, this talk was a lot about the kind of journey of mentorship of what it takes to, to, to, to make a contribution like that for someone where it might seem really scary.
- 52:22Yeah, absolutely.
- 52:23I mean, really the part where she talks about being a core developer, that's not until like the last five minutes.
- 52:28It's until then is like, here's all the ways that I was frustrated becoming a developer.
- 52:33Here's all the ways I got stuck.
- 52:35And I felt inadequate and I felt like this was not for me and how I either kept myself going or I got help from someone.
- 52:42And, you know, on the core developer side, I think Guido actually was her mentor to help her make her way through to actually, you know, getting stuff working.
- 52:52Yeah.
- 52:53At the code level in CPython, which is cool.
- 52:55Yeah.
- 52:55It's cool.
- 52:56And I think that she explained a lot of her fears and the common kind of issues that people have when they're like need mentorship, but are too afraid to ask for it or have a hard time finding it.
- 53:05And so it's a good wake up call for, I think people just in general, but in the Python community, especially to realize that we need to structure mentorship better and have a more active approach to how we do it.
- 53:16And I've heard, you know, DjangoCon actually has a mentorship program for talks there where they will pair people who have never given a talk, but have thought about it with people who have given many talks to try to help them, you know, work through their slides.
- 53:28Practice.
- 53:29Yeah.
- 53:30And I don't know if they're actually doing this for PyCon itself yet, but they do it for DjangoCon.
- 53:34And I think that's an awesome model.
- 53:35And I really hope that they, they should just do that for all of the regional PyCons and all of the, you know, all of those kind of meetup groups, just because that's, that's how you build confidence in young people or, or, or people who are approaching Python from different backgrounds.
- 53:49And I think that's really critical.
- 53:50So I think that her talk is a great way to kind of focus on what this meant, what these mentors should be doing and what, you know, how they need to make people feel comfortable seeking out mentorship.
- 54:01Yeah. I think if you're in your first five years of programming, this will be really helpful for you looking for mentorship and finding your way and feeling confident.
- 54:11And I think if you've been programmed for a really long time, this will help remind you what it's like for people coming into the modern environment and maybe how you can help.
- 54:20Yeah, definitely. And I've been on both sides of that, you know, I remember like needing mentorship way back when, and I also, and now I do mentor people, but I would mentor more if I had a better way of connecting to people who need it.
- 54:31You know, and there's a couple of ways she calls out that people can do that, which is great for people to volunteer.
- 54:36And I hope that more kind of come up in the Python community so that the mentor, the people doing the mentoring also more of them volunteer and really make a point of taking the time to do it.
- 54:46Yeah. It was a great talk. So let's leave it with that, huh?
- 54:49Yeah.
- 54:50For the ones that we went to, maybe I can ask you real quick, just, are there some other ones you're like, this is on my to watch list, but I didn't make it to it.
- 54:57Yeah. Raymond Hettinger always has a talk, not always, but usually, and it's always great. And so he had one on dictionaries that I didn't get to see, but I heard was awesome.
- 55:05Yeah. I don't know if it was this particular talk, but one of his talks was basically sold out. Like they closed the door and said, you can't come in. Like we're at the limit for fire code in this room.
- 55:14Yeah. That's usually what happens fire code. Yes. I was like, if people are new to Python, I'm like, well, you should probably go to this talk and get there like early. Yes. I, and I don't go to the, I'll watch that talk later, you know?
- 55:23And then Brandon Rhodes, who was the chair of the conference. He also had a talk on dictionaries as well. I think it was different enough from the other ones. I'm looking forward to watching that one. He's a great speaker.
- 55:33Yeah. That's, that's really good. And the last one was just Brett Cannon. He had a talk on what's new in Python three, six. It's just like an, a summary. And so you can read that online. If you just Google like what's new in Python three, six, you'll find it. But you know, hearing someone give the talk is a lot more interesting than reading through the notes. So I would definitely check that out.
- 55:49I agree with you on that. I've read what it was in there and when it all came out, then I watched his talk and really the, this is here is what you get from reading the peps, but it's like, this is here. And this is the implication of what this being here means and whatnot. I think you just get a lot more appreciation for it.
- 56:06Yeah. I agree.
- 56:07All right. Excellent. So that was really, you know, it was fun, fun pike on, right?
- 56:12Oh, it was great. Yeah. And next year it's in Cleveland. I think the next two years it's in Cleveland, Ohio. So that's going to be totally different. Change the scene.
- 56:18Yeah. And I'm looking, looking forward to that and some great talks. So yeah, I'm looking forward to next year. And, and in the meantime, there's a bunch of regional Pycons coming, you know, Python conferences coming up. So that's another thing to just check out. Like if you, if you can't travel to one of these other places, you'd be surprised how many local Pycons there are across the United States and really across the world. So it's, it's worth checking those out.
- 56:37Yeah, absolutely. I think they just announced PyCon Canada. And then there's also PyCascades, which is going to be in February. I think these are the PyCascades is brand new. And actually Marietta, the last person we spoke about,
- 56:48was part of the organizer for that. Right. Yeah. Yeah. I think, I think it's for all the Pacific Northwest kind of area. Yeah. So definitely get out to one of these Pycons or multiple ones. If you're, if this sounds interesting to you, it's really a great time. Even if you don't go to the talks. Yeah, I agree. All right. Final two questions, Brett. Okay. If you're going to write the Python code, what editor do you use?
- 57:07I'm still using Sublime Text. I'm on version three now. Yep. That's, it's still, still my, still my thing. And if I'm in a terminal, I still use Emacs. So that's my, I'm on that side of the debate.
- 57:17All right. Very cool. And a notable PyPI package.
- 57:20Wow. Recently, it's going to be what I can't live without. Right. I think it's been my go-to still. Yeah. If I'm doing web development, I'm going to install Flask every time, basically. So without a doubt. But I think if I'm actually just trying to do processing, it's, it's NumPy, which it's still the best thing that happened to Python.
- 57:40All right. Yeah, for sure. It's very cool. I'll throw one more in there with mypy, just from the static typing talk.
- 57:47I haven't used it enough to install it every time, but I think that's a great, that's actually something I should shoot for is that being my go-to.
- 57:53Yeah. Yeah. That's very cool. Yeah. All right. So you actually have a playlist of this, right?
- 57:57Oh, wow. I do. Yeah. I could share that. That's a good idea.
- 58:00Yeah. If it's already, I'll just put it in the show notes. Sounds good.
- 58:02And just subscribe to it and just go through. They can basically replay PyCon through your attendance.
- 58:08Sounds good. Yeah. I think I'll add a couple more in there too. I think the lightning talks are worth checking out and, but that's great. Yeah, we should do that.
- 58:14All right. Awesome. Brett, thanks for being on the show. It was excellent to talk with you.
- 58:17Yeah. Thanks so much for having me. I had a really good time.
- 58:20You bet. Bye.
- 58:20This has been another episode of Talk Python To Me.
- 58:25Today's guest has been Brett Slatkin, and this episode has been brought to you by Rollbar and Codeship.
- 58:31Rollbar takes the pain out of errors.
- 58:34They 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.
- 58:42As Talk Python To Me listeners, track a ridiculous number of errors for free at rollbar.com slash Talk Python To Me.
- 58:49Do you have software? Would you like to know if it has bugs before you deploy it?
- 58:54Then jump over to talkpython.fm/Codeship and set up a free Codeship Basic account, Ship Tested Software.
- 59:01Are you or your colleagues trying to learn Python?
- 59:04Well, be sure to visit training.talkpython.fm.
- 59:07We now have year-long course bundles and a couple of new classes released just this week.
- 59:13Have a look around. I'm sure you'll find a class you'll enjoy.
- 59:16Be sure to subscribe to the show.
- 59:18Open your favorite podcatcher and search for Python.
- 59:20We should be right at the top.
- 59:21You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
- 59:31Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 59:36Corey just recently started selling his tracks on iTunes, so I recommend you check it out at talkpython.fm/music.
- 59:43You can browse his tracks he has for sale on iTunes and listen to the full-length version of the theme song.
- 59:48This is your host, Michael Kennedy.
- 59:50Thanks so much for listening. I really appreciate it.
- 59:52Smix, let's get out of here.
- 59:55Stay tuned. I'll see you next time.
- 1:00:16Don't believe
- 1:00:17Thank you.