WEBVTT

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

00:00:06.080 --> 00:00:12.320
It's Tuesday, May 30th, 2017, and this is episode 28 of Python Bytes.

00:00:12.320 --> 00:00:13.680
And I'm Michael Kennedy.

00:00:13.680 --> 00:00:14.760
And I'm Brian Okken.

00:00:14.760 --> 00:00:17.180
Brian, can you believe that we've done 28 episodes already?

00:00:17.180 --> 00:00:20.820
No, I can't. I was telling somebody about the show recently and I said,

00:00:20.820 --> 00:00:24.260
oh, we've only done like, oh my gosh, we've done like 27 episodes already.

00:00:24.260 --> 00:00:27.480
Yeah, we've done over half a year in the history of Python Podcast.

00:00:27.700 --> 00:00:34.000
I think over half a year's worth, over 20 episodes, makes it like one of the longest running podcasts of all time, actually.

00:00:34.000 --> 00:00:38.620
Right? A lot of the other ones, they sort of cut out early 20s, you know, things like that.

00:00:38.620 --> 00:00:39.180
Oh yeah, that's true.

00:00:39.180 --> 00:00:42.920
Yeah, I mean, Talk Python and Podcasting, they've been going for a while, but still.

00:00:42.920 --> 00:00:50.600
One of the primary rules that, or documents, or enhancements, that tells us how we should write our code is PEP 8, right?

00:00:50.600 --> 00:00:55.940
Yeah, definitely everybody that's really into Python knows about PEP 8.

00:00:56.300 --> 00:01:04.680
But sometimes when you mention, hey, you should follow PEP 8 to somebody new, it's not really that easy to get them up to speed.

00:01:04.680 --> 00:01:06.280
You know, it's not that hard to read.

00:01:06.280 --> 00:01:10.360
But I didn't know about this thing called PEP 8.org.

00:01:10.360 --> 00:01:13.000
And so I just stumbled across this recently.

00:01:13.260 --> 00:01:15.180
And it's from Kenneth Reitz.

00:01:15.180 --> 00:01:21.380
And it's just an easy to use, it is the, just PEP 8, the style guide.

00:01:21.380 --> 00:01:25.380
It's a nice webpage with, styled nicely.

00:01:25.740 --> 00:01:29.160
It's got red for bad examples and green for good examples.

00:01:29.160 --> 00:01:32.240
And it's got a nice index on the left that you can click through.

00:01:32.240 --> 00:01:35.220
Yeah, it's definitely, yeah, it's a really nice and navigable thing.

00:01:35.220 --> 00:01:39.140
And you're right, like, the green do this, red don't do that.

00:01:39.140 --> 00:01:47.120
And, you know, even little touches like the code samples that demonstrate good and bad, just basically any of the code samples that demonstrate anything.

00:01:47.120 --> 00:01:51.460
Are color-coded, which is, like, surprisingly delightful.

00:01:51.460 --> 00:01:51.800
Yeah.

00:01:51.800 --> 00:01:57.460
And I also like, because there's the index there, they're all anchors in the webpage.

00:01:57.460 --> 00:01:59.480
So you can take one of those.

00:01:59.480 --> 00:02:08.720
And if you want to mention a particular guideline to somebody, maybe a coworker that's not following it, you can email them that link and say, hey, could you read this?

00:02:08.720 --> 00:02:09.220
Exactly.

00:02:09.220 --> 00:02:12.020
Yeah, put that in your get issue response.

00:02:12.020 --> 00:02:15.740
Like, I'm willing to take your PR, but hold on, you got to fix this first.

00:02:15.740 --> 00:02:16.380
Yeah.

00:02:16.680 --> 00:02:22.640
And, but one of the things that I always want to mention when I talk about Pep 8 is don't be a Pep 8 bully.

00:02:22.640 --> 00:02:27.860
The first line of Pep 8 talks about hobgoblins or something like that.

00:02:27.860 --> 00:02:29.680
And basically...

00:02:29.680 --> 00:02:30.040
Yes.

00:02:30.040 --> 00:02:34.940
Blondly following rules is the hobgoblins of little minds or something to this effect, yeah?

00:02:34.940 --> 00:02:35.760
Yeah.

00:02:35.760 --> 00:02:40.820
So somebody might have a decent reason for not following Pep 8.

00:02:40.820 --> 00:02:44.400
So tread carefully when you try to get somebody to follow it.

00:02:44.780 --> 00:02:57.680
If you haven't stumbled across Pep 8 before, which is kind of hard to think that's possible if you're listening to this podcast, it does describe itself as being the style guide for the standard library for Python.

00:02:57.680 --> 00:03:01.160
But it's a lot more than that.

00:03:01.160 --> 00:03:05.400
Most open source Python projects follow it to some degree, don't you think?

00:03:05.400 --> 00:03:06.020
Right, yeah.

00:03:06.020 --> 00:03:09.660
And you can set up linters that will, like, mention violations.

00:03:09.660 --> 00:03:27.300
So, for example, I think cookie cutter, if you do a PR back to them and you do something like, say, write an 81 character line, it will fail the automated build and say we're not going to accept it because it fails Flake 8 or something to this effect.

00:03:27.300 --> 00:03:27.480
Right.

00:03:27.480 --> 00:03:28.160
Okay.

00:03:28.160 --> 00:03:28.460
Yeah.

00:03:28.460 --> 00:03:35.900
You know, I suspect everyone, pretty much everyone's heard of Pep 8, but I'm not sure everyone has actually taken the time to read through Pep 8.

00:03:35.900 --> 00:03:37.520
And I think that this thing is more readable.

00:03:37.520 --> 00:03:41.140
So it's probably, you know, if you're in that group, then go check it out, pepe.org.

00:03:41.140 --> 00:03:41.340
Okay.

00:03:41.340 --> 00:03:43.040
So what's next?

00:03:43.040 --> 00:03:45.200
I want to talk about asynchronous stuff.

00:03:45.200 --> 00:03:45.960
Is it surprising?

00:03:45.960 --> 00:03:47.340
I always talk about asynchronous stuff.

00:03:48.840 --> 00:03:54.100
So there's this new project called Tokio, I think is how you might say it, T-O-K-I-O.

00:03:54.100 --> 00:04:02.200
And at the heart of AsyncIO and the Async and Await stuff are these things called Async Event Loops and whatnot.

00:04:02.200 --> 00:04:05.180
And this is one of those.

00:04:05.180 --> 00:04:09.620
We'd previously spoken about Sanic and some of these faster web frameworks.

00:04:09.620 --> 00:04:13.340
And their magic was that they run on top of this thing called uv Loop.

00:04:13.920 --> 00:04:20.740
And uv Loop is, I think, implemented in C and is an alternate implementation of this internal AsyncIO loop.

00:04:20.740 --> 00:04:25.860
Well, Tokoy is a similar concept, but implemented in Rust.

00:04:25.860 --> 00:04:32.700
So Rust is a compiled low-level language such as, you know, like C.

00:04:32.700 --> 00:04:34.200
I mean, you can debate with this low-level.

00:04:34.200 --> 00:04:35.120
I feel like it is.

00:04:35.120 --> 00:04:36.640
It's closer to the metal anyway.

00:04:36.640 --> 00:04:38.240
It's a compiled language.

00:04:38.960 --> 00:04:44.780
And it's supposed to be a little better for threading, a little better for memory management and safety.

00:04:44.780 --> 00:04:49.140
So it's a little bit of a safer, more modern, low-level way to implement this.

00:04:49.140 --> 00:04:57.080
And I just thought it was kind of an interesting example that you could go check out and say, like, here's integration of Python with Rust.

00:04:57.080 --> 00:04:57.800
Okay.

00:04:57.800 --> 00:05:00.280
So it's a Python thing?

00:05:00.280 --> 00:05:00.680
Yeah.

00:05:00.680 --> 00:05:01.600
So you use it from Python.

00:05:01.600 --> 00:05:04.620
But instead of having, like, a C extension, you have a Rust extension.

00:05:04.620 --> 00:05:05.100
Oh, okay.

00:05:05.100 --> 00:05:05.640
That makes sense.

00:05:05.640 --> 00:05:06.620
Took me a while to catch up.

00:05:06.720 --> 00:05:07.120
Yeah, yeah, yeah.

00:05:07.120 --> 00:05:14.240
So, like, the heart of the asyncIO event loop is, like, written in C when you're looking at a uvloop.

00:05:14.240 --> 00:05:15.380
Here it's written in Rust.

00:05:15.380 --> 00:05:18.180
And so here's, like, an interesting internal bit.

00:05:18.180 --> 00:05:24.480
But you basically plug it into your Python code, and then you can, you know, work with the async event loop like you normally would.

00:05:24.480 --> 00:05:24.740
Okay.

00:05:24.740 --> 00:05:29.040
And I'm guessing it might be pronounced Tokyo, but just guessing.

00:05:29.040 --> 00:05:29.440
Tokyo?

00:05:29.440 --> 00:05:29.480
Tokyo?

00:05:29.480 --> 00:05:29.880
Yeah, yeah.

00:05:29.880 --> 00:05:30.100
Okay.

00:05:30.100 --> 00:05:30.520
Tokyo.

00:05:30.520 --> 00:05:31.180
You're probably right.

00:05:31.180 --> 00:05:34.320
You're probably right about that.

00:05:34.320 --> 00:05:36.660
So, yeah, cool.

00:05:37.320 --> 00:05:40.120
And the project's still super early stage development.

00:05:40.120 --> 00:05:46.960
So if you're into Rust or you want to play with Rust and you would like it, a lot of people ask me, like, hey, I want to do something open source.

00:05:46.960 --> 00:05:48.640
Is there an approachable small project?

00:05:48.640 --> 00:05:50.200
This thing's pretty early days.

00:05:50.200 --> 00:05:55.440
And so it's probably not too complicated to jump in and play around with if people are looking for some project to get involved with.

00:05:55.440 --> 00:05:56.140
Well, that's great.

00:05:56.140 --> 00:05:57.180
Yeah, absolutely.

00:05:57.180 --> 00:05:59.360
Tell me about some boilerplate.

00:05:59.360 --> 00:06:02.860
Well, this is – I've got another project that is fairly early.

00:06:02.860 --> 00:06:05.680
I guess I was just assuming it's fairly early in the project.

00:06:05.680 --> 00:06:08.100
But I stumbled across – stumbled.

00:06:08.100 --> 00:06:09.380
I'm saying that a lot today.

00:06:09.380 --> 00:06:13.240
I came across this – a website called Python Boilerplate.

00:06:13.400 --> 00:06:16.120
It's python-boilerplate.com.

00:06:16.120 --> 00:06:21.380
And it's addictively fun, at least right at first.

00:06:21.380 --> 00:06:23.260
I wouldn't try it on a phone.

00:06:23.260 --> 00:06:25.200
Actually, I haven't tried it on a phone.

00:06:25.200 --> 00:06:29.100
But it's got a whole bunch of push buttons and stuff.

00:06:29.100 --> 00:06:32.780
And you can say which sort of boilerplate you want to have it spit out.

00:06:33.200 --> 00:06:36.880
And you can select Python 2 even or Python 3.

00:06:36.880 --> 00:06:39.780
Luckily, it does default to Python 3.

00:06:39.780 --> 00:06:49.300
And you can say whether or not you want an executable – whether it's an executable script or – and whether or not you want arg parse stuff in there.

00:06:49.300 --> 00:06:55.620
Which actually, somebody that wants to add arg parse stuff, it's kind of nice to have some built-in boilerplate of examples.

00:06:55.620 --> 00:06:56.140
Yeah.

00:06:56.300 --> 00:07:04.660
So it's a little bit like what Cookie Cutter does for large projects where you can say, I want to generate kind of a starter code, a starter skeleton.

00:07:04.660 --> 00:07:10.160
But it's more like that but for command line apps, CLI apps, right?

00:07:10.160 --> 00:07:10.580
Yeah.

00:07:10.580 --> 00:07:11.780
Smaller little projects.

00:07:11.780 --> 00:07:22.100
And it even, like, puts together a preliminary – like, for instance, if you add Flask or pytest, for instance, it'll add your requirements.txt to it.

00:07:22.660 --> 00:07:28.120
So it's a similar vein as Cookie Cutter but a little more interactive and it's fun.

00:07:28.120 --> 00:07:28.860
Yeah, I know.

00:07:28.860 --> 00:07:29.200
I like it.

00:07:29.200 --> 00:07:30.080
People should check that out.

00:07:30.080 --> 00:07:31.920
So that one's fun.

00:07:31.920 --> 00:07:33.800
We recently went to PyCon.

00:07:33.800 --> 00:07:34.440
It was awesome, right?

00:07:34.440 --> 00:07:35.500
It was very awesome, yeah.

00:07:35.500 --> 00:07:40.060
Hopefully this year people will take us seriously when we say, get your tickets before it sells out.

00:07:40.060 --> 00:07:50.140
Because – anyway, one of the things that's really cool that I really liked from PyCon was the presentation that Instagram – the folks from Instagram did.

00:07:51.180 --> 00:07:54.520
And luckily this is all on YouTube so people can check it out.

00:07:54.520 --> 00:08:06.660
So Instagram, they're probably not the biggest but they're one of the biggest by traffic number of users and whatnot, consumers or users of Python for their web apps and their backend services.

00:08:06.660 --> 00:08:09.040
Like, they seriously use Python.

00:08:09.040 --> 00:08:10.880
They use Django in many, many places.

00:08:12.000 --> 00:08:20.100
And they had found themselves in a bit of a situation like many, many of our listeners probably find themselves.

00:08:20.100 --> 00:08:23.860
But to a degree that is way, way higher, right?

00:08:23.860 --> 00:08:26.880
So they've got hundreds of millions of users.

00:08:26.880 --> 00:08:30.060
Many, many, who knows how many thousand lines of Python.

00:08:30.340 --> 00:08:38.860
And they were stuck on Python 2.7 and Django, I think they said 1.3, which is years out of date.

00:08:38.860 --> 00:08:40.560
It's quite out of date.

00:08:40.560 --> 00:08:42.080
Like, the current one is 1.8.

00:08:42.080 --> 00:08:44.060
The one people are working on is 2.

00:08:44.060 --> 00:08:49.480
The big news about Django 2 is it's only going to support Python 3, right?

00:08:49.500 --> 00:08:50.760
That was the big news there.

00:08:50.760 --> 00:08:57.740
And so they said, we somehow need to get onto Python 3, right?

00:08:57.740 --> 00:09:00.180
A lot of companies say we have this huge bit of code.

00:09:00.180 --> 00:09:02.960
And so, well, I'll throw my hands up in the air.

00:09:02.960 --> 00:09:04.760
We just couldn't possibly switch, right?

00:09:04.760 --> 00:09:05.560
It's just too much work.

00:09:05.560 --> 00:09:06.380
It's too much risk.

00:09:06.380 --> 00:09:12.980
If you watch this presentation, there's almost no way you can look at this and go,

00:09:12.980 --> 00:09:16.320
oh, there's no way we can switch to Python 3 after you see what they went through.

00:09:16.320 --> 00:09:18.040
So it's really intense.

00:09:18.040 --> 00:09:22.700
So, for example, they don't believe in branches in their Git repo.

00:09:22.700 --> 00:09:23.860
Wow, I must have missed that.

00:09:23.860 --> 00:09:24.480
That's interesting.

00:09:24.480 --> 00:09:24.880
Yeah.

00:09:24.880 --> 00:09:25.960
It's interesting, right?

00:09:25.960 --> 00:09:33.320
Because I think to some degree rightly feel that the farther you are away from master or, yeah, from master,

00:09:33.320 --> 00:09:38.360
what they're calling it, the more it's going to be hard to integrate that back in.

00:09:38.360 --> 00:09:40.480
And the more you could introduce trouble by merging that back in.

00:09:40.480 --> 00:09:43.300
So what they do is they use feature switches.

00:09:43.300 --> 00:09:47.240
So if you're working on a new feature, there's a config on your dev server that says,

00:09:47.460 --> 00:09:48.200
enable this feature.

00:09:48.200 --> 00:09:50.960
But in production, it might be turned off.

00:09:50.960 --> 00:09:52.020
So they're shipping.

00:09:52.020 --> 00:09:59.520
They said they check in to the master branch quite often, like many times a day.

00:09:59.520 --> 00:10:03.740
And with an hour of that check-in, it's pushed to production, even when the features are not done.

00:10:03.740 --> 00:10:04.160
Right?

00:10:04.560 --> 00:10:14.280
So now they have this huge, huge branch of Python code where lots of the libraries and modules and stuff are shared across different services and different servers.

00:10:14.680 --> 00:10:17.180
It runs on our old version of Django on Python 2.7.

00:10:17.180 --> 00:10:20.820
And they're like, all right, what we're going to do is we're going to upgrade to Python 3.

00:10:20.820 --> 00:10:22.200
And we're not going to branch.

00:10:22.200 --> 00:10:26.580
We're going to keep shipping on this main branch and convert it to Python 3.

00:10:26.880 --> 00:10:29.020
We're going to upgrade like years worth of Django.

00:10:29.020 --> 00:10:33.600
I'm going to keep shipping on Python to production and so on.

00:10:33.600 --> 00:10:44.280
And so the process that they went through and the little steps that they took, and even for you, the testing procedures they went through to make this work was really, really interesting.

00:10:44.280 --> 00:10:47.480
So basically, I'll give you guys the summary.

00:10:47.480 --> 00:10:49.760
If you want to watch the video, it's highly recommended.

00:10:49.760 --> 00:10:57.280
But it's really a concrete roadmap for every large project, every large company with lots of users and traffic to switch.

00:10:57.280 --> 00:11:08.900
So they said they got between 12% and 40% performance improvement, depending on where you look, like, say, the web tier versus the async queue tier and so on.

00:11:08.900 --> 00:11:12.020
And I think like 30% better memory usage.

00:11:12.020 --> 00:11:14.760
So just like straight across the board, everything was better.

00:11:14.760 --> 00:11:18.000
And they haven't even started using the asyncio stuff.

00:11:18.000 --> 00:11:22.060
And they're super happy now that they can switch to a new version of Django.

00:11:22.060 --> 00:11:26.480
Something cool comes out in terms of performance, say, like Python 3.7.

00:11:26.480 --> 00:11:28.500
Some function call becomes much faster.

00:11:28.500 --> 00:11:29.460
They just get that.

00:11:29.460 --> 00:11:31.680
They don't have to, like, go, well, that'd be nice, right?

00:11:31.680 --> 00:11:36.680
They basically, so they get to be part of the forefront of Python once again, and they're happy about it.

00:11:36.680 --> 00:11:41.680
So then they, like, start converting their code base so that it could run on Python 3.

00:11:41.840 --> 00:11:44.980
But they were still deploying on Python 2.7.

00:11:44.980 --> 00:11:45.340
Yes.

00:11:45.340 --> 00:11:46.780
Yes, exactly.

00:11:46.780 --> 00:11:56.740
And then eventually one of the changes, one of the steps they made was we're going to make all the developers run and develop on Python 3, but still deploy to Python 2.

00:11:57.020 --> 00:12:04.600
And so that was one of the main, like, checks and balances was the developers will start hitting these bugs locally.

00:12:04.600 --> 00:12:06.140
I will never push it out.

00:12:06.140 --> 00:12:08.500
And then they didn't push it out to production fully then.

00:12:08.500 --> 00:12:10.820
They pushed it out to just Facebook employees.

00:12:11.220 --> 00:12:14.300
And then they pushed it out to 0.1% of their users.

00:12:14.300 --> 00:12:14.760
Yeah.

00:12:14.760 --> 00:12:15.680
To see how that worked.

00:12:15.680 --> 00:12:19.700
And then finally they started, they switched to, like, 20% and then, like, they pushed it all the way out.

00:12:19.700 --> 00:12:20.220
Something like that.

00:12:20.220 --> 00:12:20.400
Yeah.

00:12:20.400 --> 00:12:20.920
Yeah.

00:12:20.920 --> 00:12:22.360
So it was a really interesting rollout.

00:12:22.360 --> 00:12:27.320
And on their testing, they had, like, at first there was a bunch of tests that just couldn't be fixed.

00:12:27.860 --> 00:12:32.280
And so they set up a, like, these are the tests that are included in the automated build.

00:12:32.280 --> 00:12:38.580
And slowly as they migrated tests, they added them to also include this so they would not regress back to be broken.

00:12:38.580 --> 00:12:38.860
Yeah.

00:12:38.860 --> 00:12:41.600
And they kind of chopped their way through that.

00:12:41.600 --> 00:12:45.200
And then eventually they said, okay, the default is new tests all have to pass on Python 3.

00:12:45.200 --> 00:12:49.080
And the old ones are going to go into this exclude list until we get the failing ones to 0.

00:12:49.080 --> 00:12:51.060
And I really liked the presentation.

00:12:51.060 --> 00:12:54.560
And I liked how they talked about actually a lot of the points that they went through.

00:12:54.740 --> 00:12:59.140
And it's a lot, I think the example is a good example for any project.

00:12:59.140 --> 00:13:04.960
But the, I also, I really liked the, just the reality that it's not trivial.

00:13:04.960 --> 00:13:05.340
Yeah.

00:13:05.340 --> 00:13:06.420
No, it wasn't trivial.

00:13:06.420 --> 00:13:09.100
It was like six months or four months or something huge.

00:13:09.100 --> 00:13:09.260
Yeah.

00:13:09.260 --> 00:13:11.420
But very doable and while in production.

00:13:11.420 --> 00:13:12.060
That's pretty cool.

00:13:12.060 --> 00:13:12.340
Yeah.

00:13:12.340 --> 00:13:14.040
And they also kept shipping new features, right?

00:13:14.040 --> 00:13:15.120
That was one of their requirements.

00:13:15.120 --> 00:13:15.460
Right.

00:13:15.460 --> 00:13:17.600
So they shipped a bunch of new features at the same time.

00:13:17.600 --> 00:13:20.920
I bet they used at least one underscore in their code when they did that.

00:13:20.920 --> 00:13:22.200
Probably several underscores.

00:13:22.200 --> 00:13:22.440
Yeah.

00:13:22.900 --> 00:13:27.900
We've featured Dan Bader on the show a lot, but this is a pretty cool article.

00:13:27.900 --> 00:13:30.120
The meaning of underscores in Python.

00:13:30.120 --> 00:13:31.580
And again,

00:13:31.580 --> 00:13:34.600
I think this falls into the realm of like what you said with PEP 8, right?

00:13:34.600 --> 00:13:39.100
Like a lot of people are seeing these, but maybe they haven't really looked specifically at what it's about, right?

00:13:39.100 --> 00:13:39.560
Yeah.

00:13:39.660 --> 00:13:42.960
And also he goes through pretty much all the different meanings.

00:13:42.960 --> 00:13:51.520
But one of the things that I, it took me a while to understand is that when people say dunder, they mean something with two underscores on both ends.

00:13:51.520 --> 00:13:51.900
Yes.

00:13:51.900 --> 00:13:53.560
Shortened of double underscore.

00:13:53.560 --> 00:13:55.740
So it's a good list.

00:13:55.740 --> 00:14:04.360
He talks about the leading underscore, meaning that it's sort of by convention, private for, or internal use only.

00:14:04.360 --> 00:14:10.120
But, and I added a note in our show notes that that doesn't apply to named tuple.

00:14:10.120 --> 00:14:15.300
Named tuple has its functions starting with leading underscore, but you can still use them.

00:14:15.300 --> 00:14:16.100
That's what they're for.

00:14:16.240 --> 00:14:16.360
Yeah.

00:14:16.360 --> 00:14:16.700
Nice.

00:14:16.700 --> 00:14:17.140
Nice.

00:14:17.140 --> 00:14:17.840
Yeah.

00:14:17.840 --> 00:14:22.220
I was just pairing with somebody today and said, what does class underscore mean?

00:14:22.220 --> 00:14:23.840
Like why is the underscore there?

00:14:23.840 --> 00:14:24.400
Oh yeah.

00:14:24.400 --> 00:14:24.900
Right.

00:14:24.900 --> 00:14:34.120
So if that's the trailing underscore, it's because somebody doesn't want to collide with a Python keyword or something.

00:14:34.120 --> 00:14:35.100
Yeah, exactly.

00:14:35.100 --> 00:14:36.040
Like it's class.

00:14:36.040 --> 00:14:36.860
So class underscore.

00:14:36.860 --> 00:14:37.080
Yeah.

00:14:37.080 --> 00:14:44.760
And I do like, I actually like that convention a lot better than having like my class or this class or something like that.

00:14:44.760 --> 00:14:45.740
I know that really.

00:14:45.940 --> 00:14:46.080
Yeah.

00:14:46.080 --> 00:14:52.200
And one of the things that a lot of people don't, that I was surprised by when I first learned about it is a single underscore by itself.

00:14:52.200 --> 00:14:52.560
Yes.

00:14:52.560 --> 00:14:53.580
That's my, one of my favorites.

00:14:53.580 --> 00:15:02.060
And that's a, that's a, I don't care variable that you can, like, if you have to assign a variable, something to a variable, but you're not going to use it anymore or use it at all.

00:15:02.060 --> 00:15:03.680
That's a decent one.

00:15:03.680 --> 00:15:05.880
And the warning, you don't get a warning for that.

00:15:05.880 --> 00:15:08.780
If it's a, something assigned and never used.

00:15:08.780 --> 00:15:09.260
Exactly.

00:15:09.260 --> 00:15:10.360
It's meant to not be used.

00:15:10.360 --> 00:15:10.600
Yeah.

00:15:10.600 --> 00:15:10.780
Yeah.

00:15:10.780 --> 00:15:15.640
I mean, the couple of places I see that like a tuple unpacking, when you don't care about all the

00:15:15.640 --> 00:15:17.320
values is kind of good.

00:15:17.320 --> 00:15:22.560
If you say, I just want to do a loop from one to 10, but I don't care about the number.

00:15:22.560 --> 00:15:23.640
I just want to do it 10 times.

00:15:23.640 --> 00:15:28.500
You could say four underscore in range, you know, zero, 10, whatever, things like that.

00:15:28.500 --> 00:15:29.660
That's a good use for that.

00:15:29.660 --> 00:15:29.920
Yeah.

00:15:29.920 --> 00:15:30.140
Yeah.

00:15:30.280 --> 00:15:33.200
The other place that I really liked this is where I have function signatures.

00:15:33.200 --> 00:15:35.940
I have to match, but I don't care about the variables.

00:15:35.940 --> 00:15:40.800
So for example, in the web methods, a lot of them take request as a parameter.

00:15:40.800 --> 00:15:47.260
And if you don't put the request parameter there, like the framework will fail to like try to pass it and won't like match and it'll crash and all that.

00:15:47.340 --> 00:15:50.800
But I don't care about calling the request variable or working with it.

00:15:50.800 --> 00:15:53.280
So you'll get like a flake eight violation.

00:15:53.280 --> 00:15:54.200
You're not using it.

00:15:54.200 --> 00:15:55.100
So underscore.

00:15:55.420 --> 00:15:57.980
In that case, can you use it multiple times?

00:15:57.980 --> 00:16:00.980
Like, can you have multiple parameter names that are underscore?

00:16:00.980 --> 00:16:01.660
I think so.

00:16:01.660 --> 00:16:01.820
Yeah.

00:16:01.820 --> 00:16:07.440
I mean, you just like blast away the previous value stored in underscore, but if you're really using it as like, I don't care, then it's fine.

00:16:07.440 --> 00:16:07.700
Cool.

00:16:07.700 --> 00:16:08.220
Okay.

00:16:08.220 --> 00:16:09.560
Yeah, absolutely.

00:16:09.560 --> 00:16:11.740
So the underscore is definitely good.

00:16:11.740 --> 00:16:13.960
If you're not familiar with that, check out Dan's article.

00:16:13.960 --> 00:16:14.820
It's a good one.

00:16:14.820 --> 00:16:18.740
So let's close this out with a little bit of a look towards the future.

00:16:18.740 --> 00:16:19.500
Okay.

00:16:19.500 --> 00:16:24.260
And we talked about recently the Stack Overflow tools, trends tool.

00:16:24.780 --> 00:16:33.080
And when Stack Overflow released it, one of the things that they featured right up in the front was like language popularity for a few languages, including Python.

00:16:33.080 --> 00:16:34.040
And it looked pretty good, right?

00:16:34.040 --> 00:16:34.420
Yeah.

00:16:34.420 --> 00:16:34.700
Yeah.

00:16:34.700 --> 00:16:35.480
So I want to come back.

00:16:35.480 --> 00:16:44.760
There's a guy who wrote a Medium post that actually dug into this quite a bit and played around with it and said, the future is looking bright for Python.

00:16:44.760 --> 00:16:50.060
And basically took that tool and did a little better analysis with it than we did.

00:16:50.060 --> 00:16:58.920
And there's one chart that they put up as a standard chart at Stack Overflow since we covered it called the most popular languages trend chart.

00:16:59.320 --> 00:17:01.820
And that's got like 15 languages or something still.

00:17:01.820 --> 00:17:03.040
It's really completely overwhelming.

00:17:03.040 --> 00:17:07.420
But if you hover over the language names, it highlights them and dims the other so you can actually see it.

00:17:07.420 --> 00:17:07.720
Okay.

00:17:07.720 --> 00:17:08.280
Cool.

00:17:08.380 --> 00:17:18.080
What's really interesting is if you go through that chart and you hover over the languages, there are only like two languages that have upward trends and recently.

00:17:18.080 --> 00:17:22.180
And which one is the most steeply upward?

00:17:22.180 --> 00:17:24.440
Has the most positive derivative?

00:17:24.440 --> 00:17:25.180
Well, probably Python.

00:17:26.180 --> 00:17:27.140
Of course it does.

00:17:27.140 --> 00:17:29.520
Actually, by quite a large margin.

00:17:29.520 --> 00:17:34.400
And there's also a trend chart on there for Python 2 versus Python 3.

00:17:34.400 --> 00:17:37.540
And last year, Python 3 overtook Python 2.

00:17:37.540 --> 00:17:38.020
Oh, nice.

00:17:38.360 --> 00:17:43.400
So just a little, same kind of ideas with this trends, but just digging in a little more detail on it.

00:17:43.400 --> 00:17:44.180
It's kind of interesting.

00:17:44.180 --> 00:17:53.400
I thought it'd be fun to tie that together with the Instagram story so you can go back to your company, your boss, whatever, and go into life 2020 for Python 2.

00:17:53.400 --> 00:17:56.240
Django is no longer supporting Python 2.

00:17:56.240 --> 00:17:58.780
Look, the Python 3 is growing here.

00:17:58.780 --> 00:17:59.940
Just like all the good stuff, right?

00:17:59.940 --> 00:18:05.280
Bring it all together to help get a little more Python versus legacy Python in the world.

00:18:05.280 --> 00:18:13.260
Yeah, and I definitely don't hear, a couple years ago, we still heard people coming up with good reasons to stay on 2.7.

00:18:13.260 --> 00:18:15.920
And I don't hear anybody talking about that anymore.

00:18:15.920 --> 00:18:16.860
Nope.

00:18:16.860 --> 00:18:21.060
It's definitely, definitely, we've crossed over some sort of boundary, for sure.

00:18:21.060 --> 00:18:25.720
Well, hopefully also in the future, it'll bring us at least another half year of Python bytes.

00:18:25.720 --> 00:18:29.940
I'm pretty sure we can at least get another half year of this.

00:18:29.940 --> 00:18:30.320
Yeah, so.

00:18:30.320 --> 00:18:31.500
It's fun.

00:18:31.500 --> 00:18:33.120
That's all of our topics.

00:18:33.120 --> 00:18:34.920
Any news for us, Michael?

00:18:35.120 --> 00:18:36.000
No real news for me.

00:18:36.000 --> 00:18:40.000
I'm just recording podcasts like crazy, trying to get ahead for the summer.

00:18:40.000 --> 00:18:47.000
So I have, like I was just telling you, the opening of the show before we hit record, like eight episodes of Talk Python To Me.

00:18:47.000 --> 00:18:49.520
I'm recording over the next six, seven days.

00:18:49.520 --> 00:18:53.640
So there's going to be a whole bunch of good stuff lining up, and I'm excited about what's coming.

00:18:53.640 --> 00:18:54.180
How about you?

00:18:54.180 --> 00:18:56.360
I'm kicking off some more recording also.

00:18:57.140 --> 00:18:59.020
Definitely the book is still going strong.

00:18:59.020 --> 00:18:59.540
Yeah.

00:18:59.540 --> 00:19:03.060
And doing a lot of work on that.

00:19:03.060 --> 00:19:08.080
But I recorded an interview this morning, and I'll have at least a couple coming out in the next couple weeks.

00:19:08.080 --> 00:19:09.900
So Test and Code is not dead.

00:19:09.900 --> 00:19:11.240
It will come back.

00:19:11.240 --> 00:19:12.420
What was the topic?

00:19:12.420 --> 00:19:13.240
What did you record on today?

00:19:13.360 --> 00:19:17.420
Actually, I recorded somebody that does mobile testing.

00:19:17.420 --> 00:19:21.280
So mobile application and mobile and responsive web page testing.

00:19:21.280 --> 00:19:27.800
And it's a company that offers a service that has, like you can rent a device.

00:19:28.040 --> 00:19:36.520
So somebody, like, tells you that your website or your web application or something doesn't work on this particular device.

00:19:36.520 --> 00:19:38.360
You don't have to go out and buy it.

00:19:38.360 --> 00:19:38.740
Yeah.

00:19:38.740 --> 00:19:41.540
Android, Oreo, whatever, right?

00:19:41.540 --> 00:19:41.780
Yeah.

00:19:41.780 --> 00:19:42.500
It's on this?

00:19:42.500 --> 00:19:42.820
Yeah.

00:19:42.820 --> 00:19:49.460
You can go and rent it for, like, I think their prices are, like, 10 cents a minute or something like that.

00:19:49.460 --> 00:19:52.200
But you can – I have no idea what their prices are, actually.

00:19:52.200 --> 00:19:52.800
I can't remember.

00:19:52.800 --> 00:19:59.000
But it's a commercial product, but I want to make sure that Test and Code isn't just about open source stuff.

00:19:59.000 --> 00:20:02.200
It's also companies that are helping out that area.

00:20:02.200 --> 00:20:03.420
So it's good.

00:20:03.420 --> 00:20:03.700
Yeah.

00:20:03.700 --> 00:20:05.180
It's cool to cover the whole spectrum.

00:20:05.180 --> 00:20:10.340
And can you imagine what their data center must be like with a thousand different phones running in there?

00:20:10.340 --> 00:20:10.580
Yeah.

00:20:10.580 --> 00:20:16.040
And I also asked them silly things like, okay, so I operate my phone with my finger.

00:20:16.040 --> 00:20:19.720
Do you have somebody – are you paying somebody to move their finger or something?

00:20:19.720 --> 00:20:22.500
And they said, no, they've got that all figured out, automated.

00:20:23.300 --> 00:20:23.980
So –

00:20:23.980 --> 00:20:25.080
Perfect.

00:20:25.080 --> 00:20:25.580
Perfect.

00:20:25.580 --> 00:20:26.920
All right.

00:20:26.920 --> 00:20:29.540
Well, Brian, thanks for sharing the news this week and meeting with me.

00:20:29.540 --> 00:20:30.680
And as always, you know.

00:20:30.680 --> 00:20:30.900
Yeah.

00:20:30.900 --> 00:20:31.380
Thank you.

00:20:31.380 --> 00:20:32.220
Talk to you later.

00:20:32.220 --> 00:20:32.560
You bet.

00:20:32.560 --> 00:20:32.760
Bye.

00:20:32.760 --> 00:20:33.340
Bye, everyone.

00:20:33.340 --> 00:20:36.360
Thank you for listening to Python Bytes.

00:20:36.360 --> 00:20:38.920
Follow the show on Twitter via at Python Bytes.

00:20:38.920 --> 00:20:41.820
That's Python Bytes as in B-Y-T-E-S.

00:20:41.820 --> 00:20:45.220
And get the full show notes at Pythonbytes.fm.

00:20:45.220 --> 00:20:49.580
If you have a news item you want featured, just visit Pythonbytes.fm and send it our way.

00:20:49.580 --> 00:20:52.300
We're always on the lookout for sharing something cool.

00:20:52.780 --> 00:20:55.680
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:20:55.680 --> 00:20:59.300
Thank you for listening and sharing this podcast with your friends and colleagues.