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


Transcript #133: Github sponsors - The model open source has been waiting for?

Return to episode page view on github
Recorded on Thursday, May 30, 2019.

00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds. This is episode 133 recorded May 30th, 2019. I'm Michael Kennedy.

00:10 And I'm Brian Okken.

00:11 And this episode is brought to you by DigitalOcean. Check them out at pythonbytes.fm/digitalocean. More on that later.

00:17 Brian, how you been?

00:18 I'm doing well. How about you?

00:20 I am as well. The summer is here. The weather is nice. Getting to finally emerge from being stuck by the rain inside for all these years or all these months, I guess, in Portland. So very, very happy. Everyone's got a little bit of a smile from the weather, I think.

00:34 Yeah, definitely. It's nice.

00:36 You know what I think also might make you smile is knowing that a bunch of cool features are already included in Python before you have to even go grab a library.

00:44 Yep, there are a whole bunch of built-ins. And I'm highlighting an article from Trey Hunter called Python built-ins worth learning. And this comes from when he does a lot of training new people into Python.

00:58 and some people sometimes feel a little overwhelmed about all the stuff they need to learn.

01:04 This is an interesting quote he has.

01:06 He said there's 69 built-in keywords or built-in functions with Python. There's more keywords, but anyway.

01:13 He said he estimates that most developers only need about 30 of them, but the 30 that you need is different depending on what you're doing.

01:21 And I think that's probably fair.

01:24 So he split all of these 69 keywords into a bunch of categories. I guess there's five categories commonly known overlooked by beginners learn it later and Maybe learn it eventually and you'll likely not need these and for the most part I agreed with them and I think it's kind of a fun thing to look at especially somebody new to the language or if you're Helping somebody out. I'm not gonna go through the entire list It's a big list, but I wanted to highlight a couple of them the ones that he said are often overlooked by beginners are some enumerate zip bool reversed sorted min max any and all and Of those I think people will figure out that there's probably a way to do this But the the zip feature is something that people don't get right away. And so practicing that a little bit is good enumerate also, but be careful.

02:20 - Yeah, enumerate stands out as like a super important one that you can have a lot of non-Pythonic patterns.

02:27 Like if I wanna do a loop over some collection and I wanna print out like, number one is this, number two is that, kind of like generating this ordered list that he has right here on his article, right?

02:38 You might go, well, the for-in loop doesn't work because I don't get the index or whatever, right?

02:42 There's a bunch of nice little cases where enumerate really, really helps.

02:46 Yeah, and there's a good list for somebody to read through.

02:49 He also got descriptions of all of them.

02:50 It's a fairly lengthy article, but it reads pretty quick.

02:53 All the stuff you already know, you'll just skim past, and the stuff that you don't stands out.

02:58 I didn't know about any and all at first for if there's any values in a list that are true or making sure that all of them are true.

03:07 Those sometimes are useful.

03:09 And then I wanted to jump to a little bit.

03:11 There's in his category of learn it later, there's a bunch of them, But one of the things in there is a get attr for get attribute.

03:19 I kind of disagree.

03:20 I think that you ought to learn that a little bit earlier because the behavior of getting an attribute and then defaulting to a different value is very important and it's hard to do otherwise.

03:31 >> Yeah. >> If you're going to get an attribute of an object and it might not have that attribute, but you know what value you want anyway, get attr is great.

03:41 I like using overloading get adder for basically nicer dictionaries, maybe with default values.

03:48 So we have default dict and we have some other things like regular dicts and so on.

03:53 But if you want to kind of treat them like JavaScript type of objects where you can just say object dot value, right, you can't do that with normal dictionaries.

04:03 And even with default dictionaries, you can't make it give the default value.

04:06 But if you say derive from dictionary, but then also implement git adder, you could actually add it so it has that nice little cleaner syntax, I think.

04:15 - Yeah, you can.

04:16 I often just use dictionaries, but then I use the git accessor.

04:21 - Yeah, exactly.

04:21 - That you can get a default for.

04:23 - Yeah, cool.

04:24 So this is a good one.

04:25 I definitely think it's worth skimming over.

04:27 Even as somebody who's not a beginner, it's kind of like, all right, well, let's try this.

04:31 So here's the ones I likely don't need, or maybe I don't really know.

04:35 Let me go through and see what I know.

04:36 Oh, well, there's round.

04:38 I know that one.

04:39 There's ABS and hash and objects.

04:40 Okay, all those.

04:41 Oh, wait, there's div mod.

04:43 What is div mod?

04:44 And for example, right?

04:44 So it's kind of fun to just go through and see which ones you do know, 'cause there's certainly some I don't.

04:48 - Yeah, and it's also, I think it's a fun article for people to bookmark, and it's just, as they're learning, come back to every couple months and learn something new.

04:56 - Yeah, absolutely.

04:57 So a while ago, Brian, we spoke about GitHub being acquired by Microsoft, And that actually created quite the kerfuffle.

05:06 A lot of folks saw that as like an ominous sign.

05:09 I personally didn't see it that dark.

05:13 I thought it was actually kind of a mixed bag, but looking more into it, like the state of GitHub, I feel like this is probably a pretty positive thing in the end, right?

05:22 Do you remember that?

05:23 We're starting to see consequences, outcomes, benefits, however you want to perceive this next round of announcements but there's actually two announcements that I'm gonna highlight in this show about that.

05:34 And the first one is, I think, is really cool.

05:37 So, for example, we have a Patreon for Python Bytes, and the way that works is people can say, I would like to support you guys doing this, we'll donate a dollar or two a month, whatever, right?

05:45 Something small like that.

05:47 And there's been a lot of failed attempts for this in open source.

05:50 So like, hey, on my open source, read the docs, I'm gonna put a PayPal button that says donate.

05:56 And it probably reaped like a massive $39 that year or something, right?

06:02 Like it just, it's not a way in which people do those types of things.

06:06 But I think Patreon legitimately works, right?

06:10 At least for folks who are really, like creators who are really focused on that.

06:14 I've seen some really successful people there.

06:16 So GitHub has just launched this thing called Sponsors.

06:20 Have you heard of this?

06:21 - Yeah, and I'm pretty excited about it.

06:22 - I'm pretty excited about it too.

06:23 And first, when I first heard the news, I thought, okay, GitHub Sponsors is a way to sponsor open source projects.

06:30 So maybe I'm a big fan of Flask.

06:32 So I go to Flask and I can give money to them.

06:36 Or maybe I'd like to see Pyramid doing more, so I'll go donate some money to Pyramid or something like that.

06:41 But it turns out, it is like this Patreon model for GitHub, but it's not just for projects, it's also for people, which I thought was pretty cool.

06:49 So anyone who contributes to open source, whether through code, documentation, leadership, mentorship, Designe is eligible to be sponsored.

06:56 - Yeah, that's pretty cool.

06:58 Is it in like a beta or something?

07:00 You can't just go sign up, you've got to like, request early access, or I don't know what the terminology they used there was.

07:06 But yeah, it's not fully open, but it's getting started.

07:08 - There's also some things about their matching funds and the fees.

07:12 - Yeah, that's pretty sweet.

07:13 So they said there will be no fees charged, all right, like Patreon, I don't know what they take, like 7%, 10%, something like that, to run Patreon as part of what they donate.

07:23 So GitHub says 100% of the fees go to developers, or 100% of the money that's given goes to developers.

07:29 There's no fees other than credit card fees, which like the world just has to accept 3% on all transactions apparently.

07:37 But I believe there's a little like star in the first year or something like that.

07:43 Like I don't think that's a permanent thing.

07:45 Also a little star in the first year, maybe not the first year of the program, but first year of your sponsorship is GitHub will match.

07:53 So suppose you get $6,000, no that's not, yeah, let's suppose you get $6,000.

07:57 GitHub will match up to 5,000 of whatever you've gotten.

08:01 So you would actually get 11,000 contributions that year.

08:03 - That's really cool, and it also encourages people to even donate a small amount to a developer that they depend on because they know that that money's gonna get doubled.

08:14 So that's pretty cool.

08:15 - Yeah, I'm pretty excited about this.

08:17 I think we need to wait 'til it becomes a little more public.

08:20 I haven't seen anywhere I can go sponsor somebody.

08:22 It's more like, hey, sign up, and I think they're building the list of people to be sponsored.

08:26 But yeah, this is super cool news and I'm excited about it.

08:29 I wonder how this will, if this will make open source even more viable in countries that don't have the same cost of living, but also not the same income levels as say, the US and Europe, right?

08:41 Like the Western world, right?

08:42 So if I live somewhere where the average monthly income is 500 bucks, if I can get 500 bucks in contributions on GitHub, right, maybe that's like a better way to spend my time, I don't know.

08:53 It could be really interesting there.

08:54 - Yeah, there should probably be like a list the Python people that are available for this so we could find them or something.

09:01 - Yeah, it'd be really cool if there's some kind of list or some people could maybe send it in or put it in the comments or something.

09:07 That would be great.

09:07 - Yeah, cool. - Yeah, what's next, Brian?

09:09 - One of the things I wanted to do is play with some REST frameworks.

09:12 And so I ran across this article called Build a REST API in 30 Minutes with Django REST Framework.

09:20 And it sounds like it'll fit within my lunch break.

09:26 So this is nice.

09:27 And so it's been at Garner, and it includes like from the very beginning, setting up a virtual environment, setting up Django, then creating a model in a database with the Django ORM.

09:38 Is it ORM or ORM?

09:39 How do people normally say that?

09:41 - I think it goes either way, like SQL and SQL, but I think ORM is a little more popular, at least in the spaces I've heard people talk about.

09:49 - And then setting up, installing and setting up the Django REST framework, and then serializing the model.

09:56 Okay, I see I haven't read the article yet completely, so I'm not sure what this means.

10:00 But then creating URI endpoints, is that universal resource?

10:05 I don't know what that is.

10:07 And how to serialize the data, but it's got pretty pictures and it goes through it in a little example of a hero database with a hero name and alias.

10:14 So it's a fairly simple toy model, but I'm gonna use it to try to learn Django REST framework rather quickly.

10:20 - Yeah, that's cool.

10:20 Yeah, Django REST framework looks nice.

10:22 I haven't done a whole lot with it, but it definitely seems nice, and this is a really good introduction.

10:26 So, well done, Bennett.

10:28 Speaking of well done, before we move on to the next news about GitHub, let me just tell you a little bit more about DigitalOcean.

10:35 So, DigitalOcean has now made their Kubernetes, their managed Kubernetes cluster generally available.

10:41 So, if you're trying to do Docker and containers and basically run your containers in production, Kubernetes is a super good option for that.

10:50 And so, all you gotta do is go over to DigitalOcean, sign up, fire up their cluster, and it'll, you know, within a minute or two, you'll have your cluster up and running, and you can just start issuing Kubernetes commands to it, running your containers over there, and get your stuff all working.

11:04 So definitely give that a shot.

11:06 Check them out at pythonbytes.fm/digitalocean.

11:09 Get a $50 credit for new users.

11:11 So help support the show, and they're doing good stuff.

11:14 We can definitely recommend it.

11:16 I told you I have two pieces of news on GitHub.

11:18 And the second one is that, have you heard of Dependabot?

11:22 I have not.

11:23 - So dependabot is interesting.

11:25 The idea is that most open source stuff is built upon layers and layers and layers of little libraries, right?

11:35 In Python we have PyPI, and if you pip install a thing, you know, that thing may pip install three other things as dependencies, and those may have two other ones, right?

11:46 So if I pip install requests, it's going to install even like five or six other little things that it needs to do its job.

11:52 for example, right?

11:53 So knowing, is there some kind of security problem or is there even just a new version that maybe I would like to have of that would be really nice to know, right?

12:03 If I could say somehow put it in my requirements files, you know, pin the versions in your requirement files, which is a good idea for apps, maybe not for libraries, but definitely for apps.

12:13 So say these are the versions I'm working with in my website or whatever.

12:17 If GitHub could say, hey, you know, there's a new version of the Stripe API, the Stripe package and hears its changes and help us automatically upgrade to that.

12:26 That would be super cool.

12:28 So that's basically what Dependabot does.

12:30 It looks at your requirements, and I believe it's not just for Python.

12:33 Like it could look at your NPM for your static JavaScript and all that kind of stuff, right?

12:37 So sort of spanning all the different dependencies that you might have across even programming languages.

12:44 It could say, hey, this week there's a whole bunch of changes and it will actually create a pull request.

12:50 So, checks for updates, then it'll create a pull request for stuff that's out of date, individual pull requests for each dependency, right?

12:58 That's kind of cool, I guess, if you can just check them all off.

13:01 And then, basically, that should trigger your CI, right, as it does for normal PRs.

13:05 Verify everything's working, you can check that in, accept, you know, merge it, and keep rolling.

13:10 So that's pretty cool, huh?

13:11 - Yeah, definitely.

13:12 If you got your CI set up to test all merge requests, then it'll just go ahead and run your tests against it, make sure that--

13:18 - Right, right, and probably the first step of your test is to create a virtual environment and pip install the requirements, or npm init or npm install them, or whatever you're gonna do, right?

13:26 So that's all good.

13:27 What does this have to do with GitHub?

13:29 Well, GitHub has now bought Dependabot, which used to be a commercial paid service, and now it's a free service of GitHub.

13:36 - Yeah, that's actually pretty cool.

13:37 - Yeah, so I think it's pretty awesome.

13:39 Basically said, if you already have an account at Dependabot, well, that's free.

13:43 And if you're not using it, you should definitely think about something to this effect, right?

13:48 Think about using something like this, because I use something called pyup at pyup.io and it's been around a little more Python focused since maybe even before Dependabot and I definitely like it.

14:00 I'm not sure what this announcement means for it.

14:02 It could be negative news for the PyUp folks, I would imagine.

14:06 But the service that both of these are providing is really valuable.

14:09 Like on Monday mornings, I wake up, I go check my email and I see all the changes.

14:13 Sometimes they're super minor, like Boto Core has been updated.

14:17 Like okay, I don't really care that much, but I guess I'll accept that, right?

14:20 But other times it's, there's been some bug fixed or there was a security vulnerability that's been fixed and it's really helpful.

14:26 So just, you know, you get in the habit of just like accepting the merge, the pull requests once a week or whatever and it's good.

14:32 - As you said, as they're coming in one at a time and you're accepting them, if something goes through and starts breaking stuff, you can roll back pretty easily.

14:42 - Yeah, yeah, absolutely.

14:43 And then like, yeah, the act of actually quickly rolling back is just to like revert requirements.txt or the pyproject.toml or whatever it is, right?

14:53 It's a minor, minor change.

14:54 Cool.

14:55 So we've talked a lot about legacy Python, modern Python, Python 2 versus Python 3.

15:01 We've kind of moved beyond that debate, or have we?

15:04 (laughing)

15:05 - Well, I don't know.

15:06 I was wondering, questioning whether it was too painful still, but you know, the transition's been going on for a while, so I think it's okay to joke about it.

15:14 And I think it's a guy named Charles Leifer.

15:18 He's the person behind the Pwe.org, but he wrote an article called New Features Planned for Python 4.0.

15:29 And this is totally a spoof article.

15:31 It's not real, but it's funny.

15:33 And it made me laugh.

15:35 So one of my favorite, I just pulled out a few of the favorites.

15:38 He has a long list of things that are humorously going in 4.0 that are not really.

15:43 So PEP 8 has been updated.

15:45 There's the long, or will be updated, the long debate between whether or not you should have 79 characters or 100 characters.

15:53 They're compromising at 89 and a half.

15:55 - Nice.

15:57 You can only put skinny characters on the last part, like an exclamation or a dot, but definitely not like a zero.

16:04 - Yeah, no.

16:05 Or capital Z, you can't do that.

16:07 - Nope.

16:08 - So all new libraries and standard lib modules must include the phrase for humans somewhere in their title.

16:13 (laughing)

16:14 - I agree.

16:15 - Type hinting has been extended to provide even fewer tangible benefits and will be called type whispering.

16:21 (laughing)

16:23 - I do like that name.

16:24 - And you can make stuff go faster by adding async before every other keyword, including if, when, if and all those things, you can just add async before everything.

16:34 It'll make it go faster.

16:35 And then notable items left out of 4.0, still no switch statement and absolutely no improvements to packaging.

16:44 - That's pretty funny.

16:46 I like it, I like it.

16:47 Yeah, that's a good article.

16:49 - Yeah. - I don't know.

16:50 - 89 and type whispering.

16:51 - A type whispering is pretty sweet.

16:54 All right, so last item I wanna cover for us today is something called Black Sheep.

16:59 Now, I felt like for a long time, like the web framework story in Python was fairly stable.

17:06 Django, Flask, Pyramid, some of the other stuff, Bottle and a few things had kind of been around.

17:10 They were kind of doing their thing, but this whole need for modern asynchronous framework involving say maybe type hinting for validation or the async keyword, it's just like unleashed all these little web frameworks, right?

17:28 So we've got Molten, Sanic, Gepronto, a whole bunch of others, API star.

17:34 Well, there's another one called Blacksheep that is here and people can check that one out.

17:39 So Blacksheet looks pretty cool.

17:41 It is a fast HTTP server and client micro framework.

17:46 So it has both the server side and the client side.

17:50 So it's both like trying to be kind of a replacement for Flask, but also for requests.

17:54 Yeah, and it's built on AsyncIO and Cython, which we talked about last week, UV loop and HTTP tools.

18:01 So it's kind of bringing in a lot of good stuff in it.

18:04 One of the things you'll notice really quickly when you work with it is it's Flask-like.

18:09 This I think is one of the more interesting parts of just thinking about these web frameworks.

18:17 If somebody were to ask you, Brian, which one is more popular, Django or Flask?

18:21 I don't know, do you have a sense of where that might land?

18:23 - No.

18:24 - I think the latest stats put it just pretty much even, right, both have met like 40% or something like this.

18:31 Right, and I think actually Flask is like growing faster than Django, so I think Flask is maybe a little more, it's maybe a little bit more of a vote in that because it's both like, it's raw numbers are matching, but now it's also, I think, growing more quickly.

18:46 But what is really interesting here is so many of these new little frameworks basically take the Flask API and give it like a solid hat tip, but then try to do their own thing.

18:58 So for example, to create a web app in Blacksheep, I say app equals application or blacksheep.application, blacksheep.server.application, I guess.

19:08 And then I say @app.route on some web function, right?

19:13 But there's a couple of differences, right, also.

19:16 So I could say async def function because it's async enabled natively based on UV loop, which is probably the best option.

19:24 And you also pass in the request object instead of not.

19:27 So what I think is really interesting is, Like Flask and Django, they're kind of neck and neck doing their battling, but all these other little frameworks seem to be like, we're gonna take Flask and change it a tiny bit in ways that we feel it's like, could be better or deficient, or we just like this better, over and over and over.

19:46 So there's like all these little Flask-like APIs.

19:48 So in that sense, I think Flask is sort of winning the API side of the world.

19:52 - Yeah, I don't even know if it's a fair comparison.

19:55 I know you can do lightweight things in Django, and you can do large applications in Flask.

20:01 But in general, they are in a different realm.

20:05 Generally, I think that people are writing larger applications, more people are writing larger applications in Django, and for the lightweight stuff, you're gonna use Flask or some of these other things.

20:17 For instance, there's probably a lot of Flask applications that absolutely have no front end.

20:21 They're REST only. - Right, right.

20:23 Yeah, I think you're right.

20:24 I think that is generally the trend that people use Django for larger stuff.

20:30 They probably appreciate the backend admin section and things like that.

20:34 All right, so for BlackSheep, let me just talk about a few interesting things.

20:36 So it has built-in support for multi-processing, which is cool.

20:40 It has its own middleware.

20:42 It has routing, much like Flask does.

20:45 It uses some really interesting features.

20:47 So for example, you can have chunked encoding, where if I'm gonna send bits of response over time, so it can come down progressively to the browser or the consumer. - Oh, that's cool.

20:58 - It uses the yield keyword for that.

21:00 That's pretty killer, right?

21:02 - Yeah. - It has special strategies for handling exceptions, automatic binding of route and query parameters, pass to the methods, automatic reloading, all sorts of stuff.

21:13 And then, like I said, it also has this client option.

21:17 So it has user-friendly SSL behavior by default, and it uses HTTP connection pooling.

21:25 So much like async or AIO HTTP client, rather than it is like requests.

21:32 So it's kind of like your joke, you have to create an async with block to create a client, and then you can call like get, post, put, all that kind of stuff.

21:41 But yeah, it's pretty cool.

21:43 So it has sort of both sides of the story.

21:45 And I guess you could just use only the server or only the client, but they're kind of all together there.

21:50 - Yeah, and it'll be interesting to watch.

21:51 We're in an interesting place where we can just see how many of these are gonna be still around in two or three years.

21:58 - That's a real challenge.

21:59 I think about would it make sense to create content around some of these various libraries or write articles or just whatever, use them potentially.

22:08 It's great that a thousand little flowers are blooming, but the lawnmower is coming.

22:14 They won't all exist.

22:15 They won't all be kept up.

22:17 And if there's 20 little web frameworks, each with 100 or 1,000 GitHub stars, like what ones are gonna last?

22:24 So I don't know.

22:26 I don't even know if they have to last, right?

22:27 Like I think some of these ideas could be really interesting like, okay, maybe something that they're doing that's really cool here around like chunked encoding makes its way into Flask.

22:35 And the async stuff makes its way into Flask.

22:37 And eventually like, well, it's not different enough from Flask anymore that we'll just keep using Flask, right?

22:42 But I think these little experimentations are super cool.

22:45 And that's why I wanted to highlight it.

22:46 - Yeah, I think so too.

22:47 And I do look forward to seeing what the flask equivalent of like the official, if it's flask or whether it's something else that's sort of the de facto standard for if you want something like flask, but asynchronous, what do you use?

23:00 - Yeah, it's definitely cool to see a lot of options out there.

23:02 Well, that's it for our main items, right?

23:04 Anything else you wanna touch on?

23:06 - I don't have anything extra, how about you?

23:08 - I got a couple of things.

23:10 One, kick it off, I guess, with the PSF.

23:13 So the PSF board elections, not to be confused with the steering council, which is like the core developer management stuff.

23:20 This is the PSF board itself.

23:22 Those elections are starting to get going.

23:25 So you can suggest, nominate people now.

23:28 You can submit a nomination.

23:30 And on June 7th, the election will actually begin.

23:33 So, yeah, until June 1st, you can nominate anyone.

23:36 And I believe they've changed the rules around who can be nominated to just like, pretty much anyone that people want to nominate.

23:44 So, I think there might've been rules of how you had to participate previously to be eligible, but it seems like it's pretty wide open at this point.

23:51 - Mm, neat.

23:52 - So also on that same page, I realized that, I knew about this before, but it kind of pointed out, it says, you can contribute to the PSF by purchasing a PyCharm license, and all proceeds benefit to the PSF.

24:05 So I think this is like a one-month thing going on here, but if you buy a copy of PyCharm, you'll get apparently 30% off, and all the profit, I'm guessing, goes to the PSF.

24:17 Probably not revenue, 'cause they gotta pay people and whatnot.

24:19 - That's neat.

24:20 - Yeah, that's a pretty good deal.

24:21 So, yay JetBrains for doing that.

24:24 That's great.

24:25 And then I guess two other really quick ones.

24:27 Just wanna remind people that if they wanna take some of my classes, they can go to training.talkpython.fm/apps, install one of the mobile apps, iOS or Android, and there's a couple of free courses in there, so people can check that out.

24:39 And then one more reminder before it kicks off next week, I'm doing my webcast next week called 10 Tools and Techniques Python Web Developers Should Explore.

24:50 So it has a bunch of ideas of things that maybe you've heard about, maybe you haven't.

24:54 But if you're doing stuff on the web, you definitely should think about.

24:58 So cool stuff like ngrok or async or database migrations or Let's Encrypt, all those little things, a bunch of cool little tips.

25:07 Some of the stuff we even found on the show.

25:09 That's free and that's around for next week.

25:12 - Is that one of those things where if I sign up and get emails about it, but I don't actually, can't actually watch it during the webcast, can I watch it later?

25:20 - Yeah, you should be able to.

25:21 And actually, honestly, it should just be, I'm doing this with a collaboration with Wintelect and it just should be on their YouTube channel like a couple days later, even if you don't sign up.

25:30 But yeah, sign up and you'll get notified, yeah.

25:31 - Cool, thanks.

25:32 - Yep, you bet.

25:33 Well, that was all serious, but we also have some jokes.

25:35 - Yeah.

25:36 - So, you know how I like to pick on you 'cause you're a fan of him?

25:38 - Yeah.

25:39 in a very nice and warm-hearted way.

25:42 So I've chosen a couple of things that I feel like might touch on that theme.

25:47 - Yeah, they're good.

25:48 - In programming, how do you generate a random string?

25:51 - Use the random module.

25:52 - One option, or you put a first-year computer science student in Vim and ask them to save and exit.

25:57 (laughing)

25:59 - This is funny.

26:00 - So another one is, imagine you're at a restaurant.

26:03 Some guy falls over, he starts choking, the waiter runs over and goes, "Oh my gosh, he's choking, is anyone here a doctor?" Some programmer stands up and goes, "Hey, I'm a Vim user." (both laughing)

26:15 - That doesn't make any sense.

26:17 - It's the programming equivalent of, how do you know if someone is a marathon runner?

26:22 - I don't know.

26:22 - Don't worry, they'll tell you.

26:23 (both laughing)

26:25 - Okay, so I was chuckling about these the other day and I tried to describe it to my daughter, my nine-year-old daughter.

26:32 I knew that I had to get some backstory.

26:34 I said, so this is sort of funny because in Vim, if especially you're in terminal mode, you save an exit by doing escape colon WQ, and if you're really serious about it, an exclamation point also.

26:49 And she's like, that's a terrible interface.

26:52 (laughing)

26:55 - She has a good sense.

26:57 How interesting.

26:57 Funny, funny.

26:59 Cool, all right, well, thanks for the laps and covering all these items as always.

27:03 - Yeah, thank you.

27:04 - Yep.

27:05 Thank you for listening to Python Bytes.

27:06 Follow the show on Twitter via @PythonBytes.

27:09 That's Python Bytes as in B-Y-T-E-S.

27:12 And get the full show notes at pythonbytes.fm.

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

27:19 We're always on the lookout for sharing something cool.

27:22 On behalf of myself and Brian Okken, this is Michael Kennedy.

27:25 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page