Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #104: API Evolution the Right Way

Return to episode page view on github
Recorded on Thursday, Nov 15, 2018.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 104, recorded November 15th, 2018.

00:09 I'm Michael Kennedy.

00:10 And I'm Brian Okken.

00:11 Hey, Brian. How you doing?

00:12 I am great.

00:13 Yeah, it's a wonderful day, isn't it?

00:14 Yeah, it is.

00:15 And I'm doing one of my favorite things, talking to you on a podcast.

00:19 Yeah, same here. You're all about podcasting today.

00:21 It's like you just block the whole calendar day.

00:24 It's just all podcasting all day.

00:26 Yeah, yeah.

00:27 Right on.

00:28 Well, I'm sure your other episodes on Test Code will come out good as well.

00:31 But before we get to our episode, let's just say thanks to DigitalOcean.

00:35 They support the podcast massively, and we're very thankful for that.

00:39 Check them out at pythonbytes.fm/DigitalOcean.

00:42 Get $100 credit for free for new users to use towards your virtual machines and whatnot.

00:46 Tell you more about that later.

00:48 Brian, I would normally ask you what your first assignment is or make some not very great transition into it

00:55 about coyotes or something.

00:58 But we're not going to go down the coyote route.

01:00 Yeah, we have some exciting news.

01:01 Yeah, we do.

01:02 So there's two things I would like to tell you about the podcast.

01:06 One is new and awesome, and one has just been around, but we haven't really bothered to talk

01:10 about it, and I don't know why.

01:11 So let's talk about it real quick.

01:12 First of all, we talk about six items and maybe a few extras more or less each week, right, Brian?

01:19 Yeah.

01:19 Our episodes are 25 minutes.

01:21 Wouldn't it be nice if you were interested in, say, the third thing to be able to just click on the third thing

01:26 and hear just that if you wanted to jump back as a refresher or whatever?

01:30 Yeah, like you said, if you heard it before and you're like, what did they say about Wiley?

01:35 And you could go back and listen to that.

01:36 Exactly.

01:37 And we do have transcripts.

01:38 We've always had transcripts, and that's great.

01:40 But now the podcast MP3 comes with chapters in each episode.

01:46 So if I open up, say, Overcast on my iPhone, and I flip over, I think I flipped to the right two times

01:51 or something funky like that, I see every topic that we cover now, and you can click on any of them.

01:56 It tells you how much time we spend on each one.

01:58 You can click on it.

01:59 You can get a little independent progress bar.

02:01 It's beautiful.

02:01 Yeah, it's nice.

02:02 It also works in Apple Podcasts.

02:04 You've got to swipe up.

02:05 And all the other podcast players, I don't know, but they support the most of them.

02:09 Which one do you listen with, Brian?

02:11 What do I listen to?

02:12 Overcast.

02:13 Pocket Cast for a while.

02:13 Yeah, Overcast.

02:14 I like Overcast.

02:15 It's not perfect, but it's better than the others, in my opinion, at least for iOS.

02:18 Yeah, I like a lot of the features of it.

02:21 I do, too.

02:22 So chapters.

02:23 Chapters are awesome, and they are now in there.

02:25 And also, if you go to the episode page, I've updated the website for roughly the same capability.

02:31 So there's a little play icon next to each chapter or each thing that we talk about.

02:36 And this only works for episode 103 and forward.

02:40 This doesn't work going way back in the past.

02:42 But everything going forward, assuming we keep this up, is a lot of work to do the chapters and figure out the times and put in all the pieces.

02:48 But hopefully people like it.

02:50 And, you know, as long as we're doing it, I'll put it on the website.

02:53 And you can click there as well.

02:54 And one of the things I like about the website is if, like, I'm looking at a, you know, in the future, I'm looking back at an old episode.

03:00 Yeah, I can listen to it without downloading the whole thing onto my iPhone or something.

03:05 Yeah, and I think people also don't understand how much we use our own site as reference.

03:10 Yeah.

03:11 Like, did we talk about it?

03:13 All right, throw it in the search engine.

03:14 No, it's not there.

03:15 So we probably didn't talk about it.

03:16 Let me look at this other thing.

03:17 Yeah, like, it's good for us.

03:18 And other people can use it too, right?

03:20 Yeah, I mean, we have over 100 episodes, six topics.

03:23 We've covered over 600 things.

03:25 So, yeah, it's hard to keep track.

03:27 Sometimes multiple.

03:27 Yeah, there's a ton of stuff in there.

03:29 And it's good to go back and find the links and comments we put.

03:31 So chapters, hopefully people enjoy them.

03:34 Be sure to take advantage of them in your podcast player, especially for reference.

03:37 And the other one is we have friends.

03:40 It's great deaf friends, isn't it?

03:41 Yes, friends of the show.

03:43 We have friends of the show in the sense of people who send us stuff.

03:46 And we love that.

03:47 We also have the ability to send out notifications for everyone that cares.

03:50 So if you visit pythonbytes.fm/friends dash of dash the dash show, or just pythonbytes.fm and click on it in the banner,

03:58 then put in your email address and you'll get notifications.

04:01 I'm going to try to start sending out more interesting stuff more frequently.

04:04 You can check that out.

04:06 But if you're not signed up there, you probably won't get it.

04:09 So be sure to do that.

04:10 You can even open up, say, Overcast, go to the show notes, click the title,

04:13 and even become a friend of the show right from your podcast player.

04:16 I think that's probably the most appropriate way to do it.

04:18 So are we going to collect all these email addresses and then sell them to some list?

04:22 Yeah, I think we're going to be so rich.

04:24 We could probably sell them for two cents an email.

04:26 No, we're not going to share those, of course.

04:29 No, we hate spam.

04:30 We won't do that either, of course.

04:31 All right.

04:32 Now it's time for the Wile E. Coyote.

04:34 Yes, the Wile E. Coyote.

04:35 And more friends.

04:37 Right.

04:37 So Anthony Shaw, we've talked about it.

04:42 He's been on the show.

04:42 He's been on both of our podcasts also.

04:45 And he joked recently that he's going to, at PyCon 2019, he might put friend of the show

04:52 as his name on his badge.

04:55 Nice.

04:56 So then one of the things that Ant or friend of the show or Anthony has been working on

05:01 is a project called Wile E.

05:03 And it is a Python application for tracking, reporting on timing, and complexity of the tests

05:09 of your application.

05:10 So it's sort of like we have some complexity checks for your application or for your module,

05:17 but this is a complexity of your tests.

05:20 And it's kind of an interesting project.

05:21 But I'm not going to actually talk about the testing part of it.

05:25 Why I brought it up is he's done something that I'm not going to say he's the first,

05:30 because it's possible that somebody else has done.

05:32 But it's the first that I've heard of.

05:33 Somebody that's done this new pyproject.toml style packaging.

05:39 So there's no setup.py.

05:41 It is pip installable.

05:43 And there's a lot of extra goodies that you can do with that.

05:46 And he's figured out all of the weird things that you have to figure out to make this all

05:51 work.

05:51 So he's got like hooked up to read the docs.

05:55 So the read the docs is generated.

05:56 It's a restructured text-based documentation that gets pushed to read the docs.

06:01 He's got it working on the talks is set up.

06:05 So there's talks configuration in there.

06:07 There's a black configuration within the project.

06:10 There's all the things you'd expect.

06:12 Plus, he's got pre-commit hooks set up.

06:15 And this isn't really part of the pyproject part.

06:19 But there is a pre-commit hook for an example.

06:22 And also, how to use...

06:24 If you're writing a tool that you want somebody else to be able to do pre-commit with, there's

06:30 an example hook there.

06:31 It's kind of a lot of goodies and it's not very much code.

06:33 So I like it as an example.

06:35 Yeah.

06:35 Nice work, Anthony.

06:36 That's really cool.

06:37 I like the use of PyProject.

06:39 Do you know if he's using poetry?

06:41 He's using Flit.

06:42 Flit.

06:43 Okay.

06:44 Right.

06:44 So Flit is another one of the ones like poetry or pipfemf, but one of the ones that understands

06:50 pyproject.toml.

06:51 And if you're curious to learn more about pyproject.toml, we talked about it in Python Bytes 100.

06:56 And then I also talked about it with Brett Cannon on testing code 52.

07:01 Nice.

07:01 Yeah.

07:01 That's a really good example.

07:02 Leave it to Anthony to be on the cutting edge of packaging.

07:05 The other thing, it's a small package, but one of the things I like is his contributing

07:11 guide includes the code of conduct right in there.

07:14 And I think that's, instead of having it as a separate file, I like the idea of having it

07:18 in this contributing guide.

07:20 Yeah.

07:20 I think the contributing guide should just link to Brett Cannon's presentation about open

07:25 source expectations.

07:26 Yeah.

07:27 Anyway, don't be a jerk.

07:28 Yeah.

07:29 You're giving me a puppy with this PR.

07:31 Just understand.

07:32 Thank you.

07:33 Thank you for the puppy.

07:35 I think I will link to that in certain projects.

07:37 Because I've got like, you know, like four contributors on my project.

07:41 So, wow, it's just exploding.

07:42 That's actually pretty good.

07:44 I think the step from zero to one is bigger than from like one to 10.

07:48 Maybe.

07:49 For most projects to get anybody to care, right?

07:51 Yeah.

07:51 Well, and I'm having trouble getting myself to do more work on it.

07:55 Yeah.

07:55 That's a different problem.

07:56 So, speaking of different problems.

07:59 Yes.

07:59 So, let's talk about data science for a minute.

08:01 The Visual Studio Code folks are building some really interesting tools.

08:05 And there's some quite unique things coming from it.

08:10 So, you know, I'm a big fan of PyCharm.

08:13 But if I'm not using PyCharm, VS Code is the thing that I would pick up and use.

08:17 Right?

08:18 So, it's like if I have something really small, I'll probably open it up with VS Code.

08:21 Like real projects probably stick to PyCharm.

08:23 But VS Code is definitely coming along.

08:25 I'm sure Brett can't love that.

08:30 For real projects.

08:30 I know.

08:31 I think it's more that PyCharm is more focused on working with lots of files and project stuff.

08:37 And it doesn't make a lot of sense, as much sense to just opening up for like one file.

08:40 It sort of can, but not as much.

08:42 Yeah.

08:43 So, VS Code is definitely coming along.

08:46 And one of the things it hasn't had a lot of is support for some of the data science tools.

08:50 But now, with the latest release, they just announced a really unique way of doing Jupyter Notebook type of support.

08:59 Oh, wow.

09:00 Right.

09:00 So, normally, Jupyter Notebook is like you go and you open up the notebook.

09:03 And you've got these cells.

09:05 And you type in the cells.

09:06 And you run the cells.

09:07 And there's like these IPNB files, whatever the extension is.

09:12 They're not really Python files.

09:14 They're like XML or something weird in there that has like embedded Python that can run.

09:18 Right.

09:18 So, this leads to all sorts of funky things like profiling it or testing it.

09:23 All those can be somewhat challenging.

09:25 Right.

09:25 Because you've got to get into the notebook and whatnot.

09:28 Yeah.

09:28 So, VS Code has taken like a pretty unique approach where what they'll do is they will turn their editor into like a notebook-like surface.

09:37 But it's actually still a single Python file.

09:40 And you just put, what's the syntax?

09:42 You put hash percent percent.

09:44 And that line defines a cell in the file.

09:47 Mm.

09:48 And you get separate output from them.

09:49 Okay.

09:49 You get separate graphs and all sorts of stuff that you would have in like a side window out of the Jupyter Notebooks.

09:55 But you have a single Python file that you still treat as a single Python file.

09:59 Okay.

09:59 Does it generate a notebook file?

10:02 I don't know if it generates it.

10:04 It will import them.

10:05 So, you could tell it to open a proper notebook and it'll convert it to this format that I just described.

10:11 Okay.

10:11 Neat.

10:12 Yeah.

10:12 So, if you're doing any sort of thing with notebooks, this is a really nice way to kind of work in a full-on text editor style.

10:20 But still get all the benefits or most of the benefits, at least, of Jupyter.

10:24 Yeah.

10:24 I do like that they're continuing.

10:27 I know that there's a lot of work on VS Code making it.

10:30 They're trying to make it even better and better all the time.

10:34 That's a good thing.

10:34 Yeah.

10:35 I guess some of the other things to throw out there that I added, now it has better support for virtual environments.

10:39 So, you can like create a virtual environment in your project level directory and it'll detect it.

10:44 Things like that.

10:45 So, there's a few other nice things.

10:47 Better completion, whatnot.

10:49 But the big deal is really the Jupyter, pseudo-Jupyter support.

10:53 Yeah.

10:53 Cool.

10:54 Yeah.

10:54 It's pretty cool.

10:54 I don't do that much with Jupyter, but if I did, I would definitely consider this.

10:58 I don't know if you would say it's the right way, but it's definitely a good way.

11:01 Yeah.

11:01 I don't play Doctor on TV, but never mind.

11:05 All right.

11:06 So, speaking of the right way.

11:07 Speaking of the right way.

11:09 So, a lot of people have projects they're supporting or thinking about maybe not a lot of people.

11:14 There are a lot of open source projects.

11:16 One of the things that we've talked about is if you have users, they might get upset if you change things.

11:24 And change is inevitable.

11:25 Don't fear change.

11:26 Send it to me.

11:27 But one of the things you've got to think about is your API.

11:31 And APIs evolve.

11:34 And so, there's an article called API Evolution the Right Way.

11:37 And this is written by A. Jesse Giroux Davis.

11:41 And he is an excellent writer.

11:43 I mean, even if you don't care about this topic, he puts really cool graphics in his articles.

11:49 And also, he's just a good writer.

11:51 He's a super storyteller.

11:52 And this one is, no doubt, part of that.

11:55 So, check it out for that alone, right?

11:57 Yeah.

11:57 And, like, it's, okay, the first line is, imagine you're a creator deity.

12:01 I mean, that's just good.

12:03 So, he does it in an analogy of, you know, a snake gaining wings and things like that.

12:09 But, anyway, he talks about how to go about adding features, removing features, deleting features.

12:16 That's something you sometimes have to do.

12:18 And he also, and adding and removing, like, you probably wouldn't remove parameters from an API call.

12:26 But you might add some.

12:27 How to go about doing that.

12:29 Changing behavior.

12:30 Sometimes things just aren't working the way they should.

12:33 And they should work different ways.

12:36 And he also gives some examples and some examples of things that, even in the Python standard library, that changed.

12:42 Because the way it used to work just was weird.

12:45 One of his examples was that you could date times.

12:49 So, if you did datetime.time with the parameters 0-0.

12:56 So, that's an odd time.

12:59 But it does happen.

13:00 And it happens if you have it in a loop and are checking to see if the time is not null or something.

13:08 But you just said if x or if time.

13:11 That'll return true sometimes if it's 0-0.

13:15 So, that's converting bools to time or time to bools.

13:20 A valid time should return true.

13:23 But it used to return false.

13:24 And that was in pre, yeah, 3.4 and before.

13:27 Oh, my gosh.

13:28 It returned false.

13:29 And that's just weird.

13:30 You know, sometimes there's just behaviors in your code that you didn't intend that you need to change.

13:36 And how to go about doing that in a nice way if you've got users in a public API.

13:41 So, it's a good article.

13:42 Yeah, he's got some good advice for sure.

13:44 One of them includes not putting feathers on snakes.

13:47 Another one is like evolve cautiously.

13:50 You know, avoid bad features if you knew, right?

13:53 Minimize features less to maintain.

13:56 Keep features narrow.

13:57 Mark experimental features as provisional.

13:59 Delete gently and stuff like that.

14:02 Yeah, provisional features actually are interesting.

14:05 But they're still tricky.

14:07 Like, for instance, pytest introduced an experiment on how to deal with fixtures at one point.

14:15 And they're still, I guess, just recently deprecated them.

14:19 Or they've been deprecated for a while.

14:22 But it took a while to, it's hard to remove stuff because people might be using it.

14:27 Yeah, yeah, definitely.

14:28 Even if you say provisional, someone's going to be like, wait, why did that leave?

14:31 I needed that.

14:32 Yeah.

14:32 It was a test.

14:35 I don't know.

14:35 Maybe separate branches.

14:36 Maybe.

14:38 I don't know.

14:38 It's hard to know what to do to really push that out and let people test it, but then actually take it away.

14:43 Yeah.

14:43 Yeah.

14:44 That's a tough one.

14:45 Thanks for that advice.

14:46 Yeah, yeah.

14:46 Jesse, that's a great article.

14:48 I really love it.

14:50 The way all the pictures and the storytelling.

14:52 And he's a great writer.

14:54 Nicely done.

14:54 Now, before we get back on one of our kicks, because it has returned.

15:00 So I want to tell you all about DigitalOcean.

15:01 So DigitalOcean, super big supporter of the show.

15:05 They're sponsoring every episode for the second half of this year.

15:08 So thank you to them for that.

15:10 And we've talked about you're not Netflix.

15:13 You're not LinkedIn.

15:14 You're not Facebook.

15:15 I just interviewed some guy from, a guy Colton from Adobe, talking about managing the security of 40,000 servers for some of their back-end stuff and how they do that.

15:28 Some people have those problems.

15:30 Yeah.

15:30 And the systems that manage that get pretty complicated.

15:33 But most people don't have that problem, and they shouldn't have to deal with systems that are way complicated to handle that kind of stuff, right?

15:39 Most people want to spin up a server, have a database server, maybe a firewall, a static IP.

15:44 And if that's the kind of thing you want, you can do quick, easy, affordable, reliable.

15:48 Go check out DigitalOcean.

15:49 So we use them.

15:51 WeWork, Docker, GitLab, Slack, all those folks use them.

15:54 And it's way, way cheaper, way, way simpler.

15:57 You can get started right away.

15:58 So check them out at pythonbytes.fm/DigitalOcean.

16:01 Get $100 to play around and get started.

16:03 And definitely recommend them working out well for us.

16:06 Probably will for you as well.

16:07 Yeah.

16:08 Thanks.

16:08 Yep.

16:09 Thanks, DigitalOcean.

16:09 Now, I'm trying to remember.

16:11 Have we spoken about GUIs?

16:12 I don't think we have.

16:13 No, let's talk.

16:13 We should totally do that.

16:15 Let's talk about them.

16:16 So actually, this is the thing.

16:18 This is a, we talk about GUIs so much, this item is back on Python Bytes.

16:22 Like it is previously on episode 90, we spoke about this thing called PySimpleGUI.

16:27 And PySimpleGUI, GUI is, I would put it in the category of this other thing called GUI, G-O-O-E-Y, which is, these are like really simple ways to build kind of standard, not overly customized UIs.

16:43 I just like quickly want to get like a UI up.

16:46 Like I can get some input, show some stuff to the user.

16:48 This one is more advanced than GUI, but still it's kind of meant to be, I want to get up something quick and not like massively complicated, right?

16:56 Like you wouldn't build like a full on web browser in here, but you might build like a little utility that you all use.

17:02 So the idea is you sort of declare the types of controls that go on your layout and then it pops up.

17:09 Now, one of my complaints back when we were on this kick in episode 90 was this is based on TK Enter and it looks like it's straight out of 1990, which was amazing because I love history.

17:20 But I don't want my modern apps to look that way, right?

17:23 And I mean, that's not a...

17:25 It's great music, bad user interfaces.

17:26 Exactly.

17:27 I mean, come on, Black, Pearl Jam, we even have a package named after.

17:30 Anyway, so the idea is you can simply create these GUIs, but the drawback was it was built on TK Enter.

17:39 Right?

17:39 Which you can build nice stuff, but it just looks a little out of place.

17:43 I think maybe based on our feedback, certainly on other people's feedback, Mike decided, you know what?

17:48 Let's try to create this for Qt because Qt looks modern.

17:51 Qt looks nice, right?

17:53 Like Qt is definitely a good looking framework.

17:55 Like if you build an app in there, you might not know that it's not native.

17:59 It's not built with Xcode, right?

18:01 And Coco, something like that on Mac.

18:03 So he took a shot at it.

18:06 And in one week, he fully created a Qt version.

18:09 So now you have TK Enter if you want no dependencies, and you have a Qt version if you want it to not look like, you know, Pearl Jam loved it.

18:15 It really does look nice.

18:19 So I'm excited about this, actually.

18:21 Yeah.

18:22 Yeah.

18:22 The new one is looking quite good.

18:24 So it's sort of a declarative little builder.

18:26 All you got to do is pip install PySide 2, and it has no dependencies.

18:30 It's a single Python file.

18:31 It only works on modern Python as well.

18:34 But he's sort of inspired by this.

18:36 He's also working towards a WX Python and a Kivy.

18:39 And if he gets Kivy going, that would be pretty sweet because that would be mobile.

18:43 Yeah.

18:44 Right.

18:44 So, so far, everything has been desktop.

18:46 But if he can get Kivy going, Kivy's a mobile Python framework, and that would be pretty killer.

18:50 Well, and also, it'd be kind of a cool thing to try to do something.

18:55 Like, if you had similar code and ran it, generated all these different versions, and then you can kind of look to see which one you like better.

19:02 Yeah, exactly.

19:03 And the, I should point out, the API is identical from TKenter and Qt, right?

19:09 Yeah.

19:09 So you just, you just do a different import statement.

19:11 You import the Qt one instead of the standard one.

19:14 And as long as you have the dependencies in place, like, the API doesn't change.

19:17 So you could, I mean, even do that at runtime.

19:18 Like, see if they have Qt installed.

19:21 If they don't fall back to TKenter and apologize a little bit.

19:24 Sorry.

19:26 But if you want this to look better, you got to go run this line.

19:29 No, you should go do something like check out the Fman build system, which will let you then take this thing, package it up as a installer for a binary, standalone binary for the various OSs, and then you'll be in business.

19:40 And you can make millions.

19:42 Millions and millions of cents.

19:44 Yes.

19:45 Okay.

19:45 Okay.

19:46 All right.

19:47 So nothing major, but just sort of an update on that one, because I think the featuring, the ability to use Qt here is actually a really, really big deal.

19:56 One of the other major things happening right now is a lot of the core development around Python is kind of put on hold because nobody knows who to ask on how something gets approved, who approves it, or anything.

20:07 Tell us more about this.

20:09 People at the heart of Python are the core developers.

20:12 They're trying to figure out all this stuff.

20:14 And since Guido has stepped down as official benevolent dictator for life, I'm not sure how that works, but the governance model around Python is changing.

20:27 I think it used to be go ask Guido for final word, and that was that.

20:31 Yeah.

20:31 I think it may have been a little more structured than that.

20:35 I'm summarizing.

20:36 I'm summarizing.

20:37 How do we go forward is a topic.

20:41 And Victor Stinner, who is one of the core developers also, I met him last year at PyCon, great guy.

20:48 He came up with this summary of there's a whole bunch of competing governance models.

20:53 And they are summarized at actually what there's one PEP called PEP 8000 that summarizes all of them.

21:00 But they don't it doesn't really compare them.

21:02 It's just a quick summary of the different ones.

21:04 But there's a they're numbered 10 through 16.

21:08 Why is that?

21:09 There's zero one, two.

21:11 I think there's seven different models.

21:13 Of course, Victor has put together a comparison of the different ones and how in different ways.

21:19 So, for instance, comparing them, what their hierarchy is like, how many people are involved, what the terminal limits look like, what's the PEP process going to be like and whether they include code of conduct and stuff.

21:31 And my guess is none of these are going to win just wholeheartedly.

21:34 There's probably going to be pieces of the different PEPs that get combined into whatever we end up with.

21:40 But if you're curious about what the core developers are up to for your future, you can look at some of this stuff.

21:47 Yeah, this is really interesting.

21:48 And it's a bit of a catch 22, right?

21:50 Like, who even decides on the governance model?

21:55 Well, right.

21:55 Because Guido explicitly said when he stepped back to just standard core developer was, and I'm not going to decide for you.

22:02 You all have to decide for yourselves.

22:04 I guess maybe vote by a core developer team.

22:06 I don't know.

22:07 Yeah.

22:07 So, there's only seven.

22:08 So, like, for instance, the first one is we just pick another leader.

22:13 So, it's something kind of like we have now, but it's a different person, a technical leader governance model.

22:18 There's one that's led by a trio.

22:21 So, kind of like that, kind of like Guido, but three other people kind of share that.

22:25 You know, when we talked to Brett Cannon and Carol Willing back on, what was that episode?

22:30 Around 90-ish.

22:32 I'm not sure.

22:32 Do you remember?

22:33 Wasn't it 100?

22:34 No, that was a different one.

22:35 Oh, okay.

22:36 We did a special dedicated one on this whole topic.

22:38 I just don't remember exactly what the number was.

22:40 The number was.

22:41 But anyway, I thought it was really interesting that I thought, of course, there's going to have to be an odd number of leaders because you're going to need a tiebreaker, right?

22:51 Yeah.

22:51 And Brett pointed out that some people are saying, you know, actually, it may be better to have an even number.

22:56 So, ties mean do nothing.

22:58 And you have to have a majority, like a clear majority to make any changes, which actually, I think, so maybe, like, led by four or six or something like that actually is an interesting option.

23:10 Yeah.

23:10 But I think it's kind of cool that this is all happening in the open and people can comment on the different proposals and they can also comment on this summary.

23:18 Yeah.

23:19 They definitely can, right, at the bottom of the show page.

23:21 Yeah.

23:21 Nice.

23:22 All right.

23:22 Well, thanks for featuring that.

23:23 It's going to be interesting.

23:24 And I would guess we hear by the time PyCon happens what the decision is.

23:29 I doubt they can go that long, more than, you know, close to a year without having any form of leading person or group.

23:38 One of the options that's not on the table is we can just say we're done and not develop Python anymore.

23:43 No, that's not an option.

23:46 We can't do that.

23:46 Right.

23:47 It's just doing too well.

23:48 But, you know, I guess it's always an implicit option if we could just stop.

23:52 All right.

23:53 So the last one that I want to cover, the last main topic, is this thing called Shiboken.

23:57 Because it comes from GUIs and I'm back on my GUI kick.

24:01 No, that's sort of true, but that's not why I care about it.

24:03 So Shiboken is this subsystem that the Qt folks made to create the Qt for Python, which is basically they go to the Qt libraries, which are all C++ header files,

24:16 and they want to make Python versions of that without maintaining a separate library that is, you know, here's the Qt one, here's the Python one, they'll get out of sync and whatnot.

24:25 So they created this thing called Shiboken, and the idea is you can run Shiboken against arbitrary C, C++ code,

24:33 and it will output Python libraries that interact with that at a C level.

24:37 That's cool.

24:38 Right.

24:39 So if you have any C code you want to interact with, you can just run this against it.

24:44 And it has like a type system, which is an XML file type of thing that you can customize.

24:48 So if you see, you know, this thing star in C, well, what that means is actually this type in Python.

24:55 Right.

24:56 So you can manage that a little bit.

24:58 Right.

24:59 Like standard string is actually, you know, str in Python, and you could tell it to do those mappings.

25:04 But then you point it at these libraries, and it can, you know, extract them, you can hide functions or add functions, all sorts of stuff.

25:11 So it's pretty cool.

25:12 That is great.

25:13 Automating the boring stuff.

25:14 Exactly.

25:14 Definitely automating the boring stuff.

25:16 So these folks are creating and maintaining it to build PySide 2, basically, at least the wrapper part of PySide 2.

25:26 But you can use it for whatever you want if you have C code.

25:29 It has nothing to do with GUIs or Qt or anything like that.

25:33 And there's two interesting blog posts.

25:35 One is Qt for Python under the hood, which I'll link to.

25:38 And that one basically shows you how this fits into their overall build system, which has Clang and C++ and CPython and all sorts of stuff.

25:47 And then one that's sort of a tutorial called Write Your Own Python Bindings.

25:53 And that one takes you through the process of more or less what I'm describing here.

25:56 It creates some non-trivial C++ classes with public, private members using the standard library and things like that.

26:05 And then it creates a Python wrapper and then uses it.

26:08 It's pretty cool.

26:08 Yeah.

26:08 That is neat.

26:09 Any idea where the name came from?

26:11 No.

26:11 No idea at all.

26:15 There's probably a really great story where the name came from.

26:18 Yeah.

26:18 But I don't know where it came from.

26:19 So this is one of the options if you want to do C++ stuff.

26:23 But there's others as well, right?

26:27 So you could use CFFI.

26:28 This is sort of a more modern way to explicitly write these mappings.

26:33 And Dan Bader over on dbader.org actually has a good write-up on that.

26:36 So I'll link to that.

26:37 Or you could use Cython, which actually is a really cool way to just directly import and start using C libraries.

26:46 Just basically you define the function shape and then you import the header.

26:50 You say, this function comes from this header file.

26:52 Let's roll with that.

26:53 And then you just start using it in Python.

26:55 Of course, you've got to compile your Cython code with Cython.

26:59 But it's pretty nice.

27:00 And so there's a good example of doing that from scratch as well.

27:03 So Shabokan, these other two, they're all quite interesting.

27:06 I'll link to them all.

27:06 Nice.

27:07 Yeah.

27:07 Well, that's it for our official items, right?

27:09 You got anything else you want to share?

27:10 I don't.

27:11 Do you?

27:11 I actually have a whole bunch of stuff that I'm very excited about, but it's very short.

27:16 So let me just tell you.

27:17 First of all, I bought my PyCon ticket.

27:19 Woo!

27:19 I still need to do that.

27:22 Yeah.

27:23 It's exciting.

27:24 The big news is that the PyCon tickets went on sale just like three or four days ago.

27:28 So I don't know if it sold out last year or not, but you don't want to be looking, you

27:34 know, standing outside there by the Great Lakes in Cleveland, looking at the windows with all

27:38 the people enjoying themselves and not being able to go in, get your PyCon ticket as soon

27:42 as you can, because it's going to be fun.

27:44 It's always fun.

27:44 I'm looking forward to being there with you, Brian.

27:46 Yeah.

27:46 It's going to be awesome.

27:47 And if you would like a closer, smaller, but still fun version, closer by definition

27:52 to Brian and me, PyCascades tickets also went on sale just a couple of days ago.

27:58 And this is the much smaller, like 200 person conference in Seattle.

28:01 And this one will definitely sell out because it's so small.

28:04 Yeah.

28:04 I think they received over 200 talk submissions and they can only have 200 people.

28:09 So I'm pretty sure it's going to sell out.

28:11 Yeah.

28:11 Yeah.

28:11 So look into that.

28:13 That one's cheaper, smaller.

28:14 And if you're in the Northwest, closer, but maybe that doesn't describe.

28:17 Many of the listeners, but yeah, it does for us.

28:19 So I'm going to be going this year, but it's the first time I didn't go last year.

28:22 So I'm excited to check it out.

28:24 Yeah, I'm excited.

28:25 This will be my second year.

28:26 I'm also going and it's going to be great.

28:28 Okay.

28:29 So those are the conference stories.

28:30 Those are the two big conferences.

28:32 You know, definitely the PyCon one is a big deal.

28:34 The other one is, have I talked about GUIs?

28:36 No.

28:36 So the other one is a book that caught my attention.

28:40 Like there's tons of Python books and, you know, sometimes they're interesting sounding, but

28:44 this one really seemed to have a unique, like really to draw the reader in.

28:49 It was really a cool angle on it.

28:51 It's called Mission Python Code a Space Adventure Game.

28:54 So basically it sets up the story of this universe that you have to save and it takes you using

29:00 PyGame and PyGame Zero and all sorts of stuff to create games with sounds and graphics and

29:05 just walks you through building this game.

29:07 And I think it looks like a super fun way to get into PyGame.

29:10 That's kind of exciting to check this out too.

29:12 It looks fun.

29:12 Yeah.

29:12 I'm like, maybe this needs to be one of my projects.

29:14 And then I remind myself, no, you're already too busy.

29:17 Please don't do this to yourself.

29:18 Yeah.

29:20 Like somebody said that we ought to go off and learn data science together.

29:24 But yeah, there's a lot going on in both of our lives.

29:28 Yeah.

29:28 Yeah, for sure.

29:29 Much of around Python, but that bucket is getting quite full.

29:32 So, but I, this is definitely one of the things that tempted me to like add one more

29:35 thing to the bucket.

29:36 It looks interesting.

29:36 Yeah.

29:37 All right.

29:37 Brian, thanks for being here and sharing all this with me and everyone else.

29:40 Yeah.

29:41 Thank you.

29:41 You bet.

29:41 Bye.

29:42 Thank you for listening to Python Bytes.

29:44 Follow the show on Twitter via at Python Bytes.

29:46 That's Python Bytes as in B-Y-T-E-S.

29:49 And get the full show notes at pythonbytes.fm.

29:52 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

29:57 We're always on the lookout for sharing something cool.

29:59 On behalf of myself and Brian Okken, this is Michael Kennedy.

30:03 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page