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 bites where we deliver Python news and headlines directly to your buds. This is episode 104 recorded November 15th 2018 I'm Michael Kennedy, but I'm Brian. Okay. Hey Brian. How you doing? I am great. Yeah, it's it's a wonderful day Yeah, it is and I'm doing one of my favorite things talking to you on a podcast. Yeah, same here You're all about podcasting today. It's like you just put a block the whole calendar day. It's just all podcasting all day - Yeah, yeah.

00:27 - Right on.

00:28 Well, I'm sure your other episodes on Test of 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:47 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 about like coyotes or something, but we're not gonna 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 about it, and I don't know why, so let's talk about it real quick.

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

01:19 - Yeah.

01:20 - Our episodes are 25 minutes.

01:21 Wouldn't it be nice if like you were interested and say the third thing to be able to just click on the third thing and hear just that if you wanted to jump back as a refresher or whatever?

01:30 - Yeah, like you said, if you wanted to, 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:37 - Exactly, 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 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, you can get a little independent progress bar.

02:01 It's beautiful.

02:02 - Yeah, it's nice.

02:02 - It also works in Apple Podcasts.

02:04 You gotta swipe up, and all the other podcast players, I don't know, but they support the most of them.

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

02:11 - What do I listen to?

02:12 - Trade 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 it.

02:19 I like a lot of the features of it.

02:21 - I do too.

02:22 So chapters, chapters are awesome.

02:24 And they are now in there.

02:26 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:37 And this only works for episode 103 and forward.

02:40 This doesn't work going way back in the past, but everything going forward, assuming we keep this up, it's a lot of work to do the chapters and figure out the times and put in all the pieces, but hopefully people like it.

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

02:54 - And one of the things I like about the website is if I'm looking at a, in the future, I'm looking back at an old episode, yeah, I can listen to it without downloading the whole thing onto my iPhone or something.

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

03:10 (laughing)

03:11 - Yeah.

03:12 - Like, did we talk about it?

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

03:14 No, it's not there, so we probably didn't talk about it.

03:16 Let me look at this other thing.

03:17 Yeah, it's good for us, and other people can use it too, right?

03:20 - Yeah, I mean, we've have over 100 episodes, six topics, we've covered over 600 things, so yeah, it's hard to keep track.

03:27 - Sometimes multiple, yeah, there's a ton of stuff in there and it's good to go back and find the links and comments we put.

03:32 So chapters, hopefully people enjoy them.

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

03:38 And the other one is, we have friends.

03:40 It's great to have 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, and we love that.

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

03:51 So if you visit pythonbytes.fm/friends-of-the-show, or just pythonbytes.fm and click on it in the banner, then put in your email address and you'll get notifications.

04:02 I'm gonna try to start sending out more interesting stuff more frequently.

04:05 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, 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:19 - So are we gonna collect all these email addresses and then sell them to some list so that--

04:23 - Yeah, I think we're gonna be so rich, we could probably sell them for two cents an email.

04:27 - No, we're not gonna share those, of course.

04:29 - No, we hate spam, we won't do that either, of course.

04:31 All right, now it's time for the Wiley Coyote.

04:34 - Yes, the Wiley Coyote.

04:36 - And more friends.

04:37 - Right, so (laughs)

04:40 Anthony Shaw, we've talked about it, he's been on the show, he's been on both of our podcasts also, And he joked recently that he's going to, at PyCon 2019, he might put Friend of the Show as his name on his badge.

04:55 So--

04:56 >>Nice.

04:57 >>So then, one of the things that Ant, or Friend of the Show, or Anthony, has been working on is a project called Wiley.

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

05:10 So it's sort of like, we have some complexity checks for your application or for your module, but this is a complexity of your tests and it's kind of an interesting project.

05:22 But I'm not gonna actually talk about the testing part of it.

05:25 Why I brought it up is he's done something that I'm not gonna say he's the first 'cause it's possible that somebody else has done, but it's the first that I've heard of.

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

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

05:41 It is pip installable 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 work.

05:52 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:02 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, and this isn't really part of the PyProject part, but there is a pre-commit hook for an example.

06:22 And also, how to use, if you're writing a tool that you want somebody else to be able to do pre-commit with, there's an example hook there.

06:31 It's kind of a lot of goodies, and it's not very much code, so I like it as an example.

06:35 - Yeah, nice work, Anthony.

06:36 That's really cool.

06:38 I like the use of PyProject.

06:40 Do you know if he's using Poetry?

06:41 He's using Flit.

06:42 - Flit, okay.

06:44 Right, so Flit is another one of the ones, like Poetry or PipFim, but one of the ones that understands PyProject.toml.

06:52 - And if you're curious to learn more about PyProject.toml, we talked about it in Python Bytes 100 and then I also talked about it with Brett Cannon on Testing Code 52.

07:01 - Nice, yeah, that's a really good example.

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

07:06 - The other thing I, it's a small package, but one of the things I like is his contributing 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 in this contributing guide.

07:20 >> Yeah, I think the contributing guide should just link to Brett Cannon's presentation about open source expectations.

07:27 >> Yeah, anyway, don't be a jerk.

07:29 >> Yeah, you're giving me a puppy with this PR, just understand.

07:33 Thank you.

07:34 Thank you for the puppy.

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

07:38 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 ten.

07:49 Maybe.

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

07:51 Yeah.

07:51 Well, 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 and there's There's some quite unique things coming from it.

08:11 So, you know, I'm a big fan of PyCharm, but if I'm not using PyCharm, VS Code is the thing that I would pick up and use, right?

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

08:24 But VS Code is definitely coming along.

08:25 (laughing)

08:28 - I'm sure Brett can't love that, for real projects.

08:31 - I know, I think it's more that PyCharm is more focused on working with lots of files and project stuff, 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:43 That's what, yeah, that's a good net.

08:44 So VS Code is definitely coming along, 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.

09:00 - Oh, wow.

09:00 - Right, so normally, Jupyter Notebook is like, you go and you open up the notebook, and you've got these cells and you type in the cells and you run the cells and there's like these IPNB files, whatever the extension is, they're not really Python files, they're like XML or something weird in there that has like embedded Python that can run, right?

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

09:23 All those can be somewhat challenging, right?

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

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, but it's actually still a single Python file.

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

09:43 You put #%% and that line defines a cell in the file.

09:48 And you get separate output from them, 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, does it generate a notebook file?

10:03 - I don't know if it generates it, 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 - Oh, okay, neat.

10:12 - Yeah, 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, but still get all the benefits, or most of the benefits at least, of Jupyter.

10:24 - Yeah, neat.

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

10:27 I know that there's a lot of work on VS Code making it, they're trying to make it even better and better all the time, that's a good thing.

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

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

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

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

10:53 - Yeah, cool.

10:54 - Yeah, it's pretty cool.

10:55 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, I don't play doctor on TV, but nevermind.

11:05 - All right, so speaking of the right way.

11:08 - Speaking of the right way.

11:09 So a lot of people have projects they're supporting, and we're thinking about, maybe not a lot of people, there are a lot of open source projects.

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

11:24 And change is inevitable.

11:26 Don't fear change, send it to me.

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

11:32 So, and APIs evolve, and so there's an article called API Evolution the Right Way, and this is written by A. Jesse Giroux Davis.

11:41 And he is an excellent writer.

11:44 I mean, even if you don't care about this topic, he puts really cool graphics in his articles, and also he's just a good writer.

11:51 - He's a super storyteller, and this one is no doubt part of that.

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

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

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

12:04 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, but you might add some.

12:28 How to go about doing that.

12:29 Changing behavior, sometimes things just aren't working the way they should, and they should work different ways.

12:36 And he also gives some examples of things that even in the Python standard library that changed because the way it used to work just is weird.

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

12:50 So if you did datetime.time with the parameters 0-0, so that's an odd time, but it does happen.

13:01 It happens if you have it in a loop and are checking to see if the time is not null or something, but you just said if x or if time, that'll return true sometimes if it's a 0-0.

13:16 So that's converting time to bools.

13:21 A valid time should return true, but it used to return false.

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

13:28 - Oh my gosh.

13:29 - It returned false, and that's just weird.

13:31 You know, sometimes there's just behaviors in your code that you didn't intend that you need to change, and how to go about doing that in a nice way if you've got users and a public API.

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

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

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

13:47 Another one is like, evolve cautiously, you know, avoid bad features, if you knew, right?

13:53 Minimize features less to maintain keep features narrow mark experimental features as provisional Delete gently and stuff like that. Yeah provisional features actually are interesting the but they're still tricky like pipe for instance pie tests introduced an Experiment on how to deal with fixtures at one point and they're still they I guess just recently deprecated them So are they they've been deprecated for a while, but they're it took a while to it's hard to remove stuff because people might be using It yeah, yeah, definitely even even if you say provisional someone's gonna be like wait. Why did that leave I needed that yeah?

14:32 Yeah It was yeah the test. I don't know maybe separate branches Maybe I don't know it's hard to know what to do to really push that out and let people test it But then actually take it away. Yeah, yeah, that's a tough one. Thanks for that advice. Yeah, yeah, Jesse. That's I mean That's a great article.

14:48 I really love it, the way, all the pictures and the storytelling, and he's a great writer.

14:54 Nicely done.

14:55 Now, before we get back on one of our kicks, because it has returned, so I wanna tell you all about Digital Ocean.

15:02 So Digital Ocean, super big supporter of the show.

15:05 They're sponsoring every episode for the second half of this year, so thank you to them for that.

15:10 And we've talked about, you're not Netflix, you're not LinkedIn, 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 backend stuff and how they do that.

15:29 Some people have those problems and the systems that manage that get pretty complicated, 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.

15:39 Most people wanna spin up a server, have a database server, maybe a firewall, a static IP, and if that's the kind of thing you want You can do quick, easy, affordable, reliable.

15:48 Go check out DigitalOcean.

15:50 So we use them.

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

15:55 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 and definitely recommend them.

16:06 Working out well for us, probably will for you as well.

16:08 - Yeah, thanks.

16:08 - Yep, thanks DigitalOcean.

16:10 Now, I'm trying to remember, have we spoken about GUIs?

16:12 - I don't think we have.

16:13 - No, let's talk.

16:14 We should totally do that.

16:15 Let's talk about them.

16:16 So actually, this is the thing.

16:19 We talk about GUI so much.

16:20 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, G-U-I, is--

16:31 I would put it in the category of this other thing called GUI, G-O-O-E-Y, which is these are 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 or I can get some input, show some stuff to the user.

16:49 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 you all use.

17:03 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 TKinter, and it looks like it's straight out of 1990, which was amazing, 'cause I love history.

17:21 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 was great music, bad user interfaces.

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

17:30 Anyway, so the idea is you can simply create these GUIs, but the drawback was it was built on TKinter, 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:49 Let's try to create this for Qt, 'cause Qt looks modern.

17:52 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, it's not built with Xcode, right?

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

18:04 So he took a shot at it, 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 cute version if you want it to not look like Pearl Jam loved it.

18:16 (laughing)

18:18 - It really does look nice, so I'm excited about this, actually, so it's good.

18:22 - Yeah, the new one is looking quite good, so it's sort of a declarative little builder.

18:26 All you gotta do is pip install PySide 2, and it has no dependencies, it's a single Python file.

18:32 It only works on modern Python as well, but he's sort of inspired by this.

18:36 He's also working towards a WX Python and a Kivy, If he gets Kivy going, that would be pretty sweet because that would be mobile.

18:44 - Yeah.

18:45 - So far everything has been desktop.

18:47 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 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 I should point out the API is identical from TKenter and Qt.

19:09 So 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, the API doesn't change.

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

19:19 See if they have Qt installed.

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

19:26 Sorry, but if you want this to look better, you're going to have to go run this line.

19:29 Now, 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, then you'll be in business.

19:41 - And you can make millions.

19:42 - Millions and millions of cents.

19:45 - Yes. - Okay.

19:46 - Okay.

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

19:57 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:08 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 So there's... and how 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:28 I think it used to be "Go ask Guido for final word," and that was that.

20:31 Yeah, I think may have been like a little more like structured than that, but there's I'm summarizing. I'm summarizing how do we go forward is a topic and Victor Stinner who is one of the core developers also met him last year at PyCon great guy he came up with this summary of there's a whole bunch of different competing governance models and They are summarized at actually what there's one pep called pep 8,000 that summarizes all of them But they don't it doesn't really compare them. It's just a quick summary of the different ones, but there's a Their number 10 through 16. Why is that?

21:08 There's just zero one two three. I think there's seven different models Of course Victor is put together a comparison of the different ones and how in different ways So for instance comparing them what their hierarchy is like how many people are involved?

21:24 What does the terminal limits look like?

21:26 What's the pep process going to be like and whether they include code of conduct and stuff?

21:30 And my guess is none of these are going to win just wholeheartedly There's probably going to be pieces of the different peps that get combined into whatever we end up with But if you're if you're curious about what the core developers are up to for your future, you can look at some of this stuff Yeah, this is really interesting and it's a bit of a catch-22 right like who even decides on the governance model (laughing)

21:55 - Well, right.

21:56 - 'Cause Guido explicitly said when he stepped back to just standard core developer was, and I'm not gonna decide for you, you all have to decide for yourselves.

22:04 I guess maybe vote by core developer team, I don't know.

22:07 - Yeah, so there's only seven.

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

22:13 So it's something kinda 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, So, kind of like that, kind of like Gato, 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:31 Around 90ish, I'm not sure.

22:33 Do you remember?

22:34 - Wasn't it 100?

22:35 - No, that was a different one.

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

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

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

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

22:57 So ties mean do nothing, 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, but I think it's kind of cool that this is all happening in the open and people can comment on, people can comment on the different proposals and they can also comment on this summary.

23:19 - Yeah, they definitely can, right?

23:20 the bottom of the show page.

23:21 - Yeah.

23:22 - Nice, all right, well thanks for featuring that.

23:23 It's gonna be interesting 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 close to a year without having any form of leading person or group.

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

23:44 (laughing)

23:45 - No, that's not an option, we can't do that.

23:47 It's just doing too well, but I guess it's always, an implicit option if we could just stop.

23:52 All right, so the last one that I wanna cover, last main topic is this thing called Shaboken.

23:58 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 Shaboken 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, and they want to make Python versions of that without maintaining a separate library that is, here's the cute one, here's the Python one, they'll get out of sync and whatnot.

24:26 So they created this thing called Shaboken and the idea is you can run Shaboken against arbitrary C, C++ code and it will output Python libraries that interact with that at a C level.

24:38 - And that's cool.

24:39 - Right, so if you have any C code you wanna 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:49 If you see this thing star in C, what that means is actually this type in Python.

24:56 You can manage that a little bit.

24:59 Standard string is actually str in Python.

25:02 You could tell it to do those mappings.

25:04 But then you point it at these libraries and it can extract them.

25:08 You can hide functions or add functions, all sorts of stuff.

25:12 It's pretty cool.

25:13 That is great.

25:14 Automating the boring stuff.

25:15 Exactly.

25:16 Definitely automating the boring stuff.

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

25:27 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 in our same blog post.

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 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, that is neat.

26:10 Any idea where the name came from?

26:11 No.

26:14 No idea at all.

26:15 There's probably a really great story where the name came from, 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:24 But there's others as well, right?

26:27 So you could use CFFI.

26:29 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, 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 You just basically define the function shape and then you import the header.

26:50 You say, this function comes from this header file, let's roll with that.

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

26:56 Of course, you gotta compile your Cython code with Cython, 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:07 - Nice.

27:07 - Yeah, well, that's it for our official items, right?

27:09 Got anything else you want to share?

27:10 - I don't.

27:11 Do you?

27:12 - I actually have a whole bunch of stuff that I'm very excited about, but it's very short, so let me just tell you.

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

27:19 Woo!

27:20 - I still need to do that.

27:22 - Yeah.

27:23 - 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 know, standing outside there by the Great Lakes in Cleveland, looking at the windows with all the people enjoying themselves and not be able to go in, get your PyCon ticket as soon as you can, 'cause it's gonna be fun.

27:44 It's always fun.

27:44 Looking forward to being there with you, Brian.

27:46 - Yep. - It's gonna be awesome.

27:47 And if you would like a closer, smaller, but still fun version, closer by definition to Brian and me, PyCascades tickets also went on sale just a couple days ago.

27:58 This is the much smaller, like 200-person conference in Seattle, and this one will definitely sell out because it's so small.

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 gonna sell out.

28:11 - Yeah.

28:12 - Yeah, so look into that.

28:13 That one's cheaper, smaller, and if you're in the Northwest, closer.

28:16 But that doesn't describe many of the listeners, but yeah, it does for us.

28:19 - So I'm gonna be going this year, but it's the first time.

28:22 I didn't go last year, so I'm excited to check it out.

28:24 - Yeah, I'm excited.

28:25 This'll be my second year.

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

28:29 Okay, 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:37 So the other one is a book that caught my attention.

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

28:44 But this one really seemed to have a unique--

28:47 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:55 So basically, it sets up the story of this universe that you have to save.

28:59 And it takes you using PyGame and PyGame Zero and all sorts of stuff to create games with sounds and graphics and just walks you through building this game.

29:07 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:13 - Yeah, I'm like maybe this needs to be one of my projects.

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

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

29:18 (laughing)

29:20 - Yeah, like somebody said that we ought to go off and learn data science together.

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

29:28 - Yeah, yeah, for sure.

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

29:32 But this is definitely one of the things that tempted me to add one more thing to the bucket.

29:36 looks interesting. Yeah. All right, Brian, thanks for being here and sharing all this with me and everyone else. Yeah, thank you. You bet. Bye.

29:42 Thank you for listening to Python Bytes. Follow the show on Twitter via @PythonBytes. That's Python Bytes as in B-Y-T-E-S. And get the full show notes at PythonBytes.FM. If you have a news item you want featured, just visit PythonBytes.FM and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Aukin, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends

Back to show page