WEBVTT

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

00:00:06.920 --> 00:00:11.800
This is episode 23, recorded April 25th, 2017.

00:00:11.800 --> 00:00:14.200
And I'm one of your hosts, Michael Kennedy.

00:00:14.200 --> 00:00:15.260
And I'm Brian Okken.

00:00:15.260 --> 00:00:18.380
And we're here to share a bunch of cool Python stuff with you.

00:00:18.380 --> 00:00:21.760
We've got six cool items queued up and ready to go.

00:00:21.760 --> 00:00:24.260
But before we get to that, I want to say thanks to Advanced Digital.

00:00:24.260 --> 00:00:26.560
They have an awesome Python job.

00:00:26.560 --> 00:00:28.980
You can check it out at python.advance.net.

00:00:29.200 --> 00:00:30.620
And we'll talk more about that later.

00:00:30.620 --> 00:00:32.240
Right now, I want to talk about the GIL.

00:00:32.240 --> 00:00:32.920
Brian, what do you think?

00:00:32.920 --> 00:00:34.580
I think it's great to talk about the GIL.

00:00:34.580 --> 00:00:36.880
And I'm really glad that...

00:00:36.880 --> 00:00:42.080
So this is an article called Grok the GIL, How to Write Fast and Thread Safe Python.

00:00:42.080 --> 00:00:51.640
And we talk about the GIL as the reason why we can't do parallel computing and programming just built in in Python.

00:00:51.640 --> 00:00:54.940
But, you know, I haven't really jumped into it a lot.

00:00:54.940 --> 00:00:58.860
And this article is from A. Jesse Giroud Davis.

00:00:59.120 --> 00:01:01.280
Who, by the way, is an excellent writer.

00:01:01.280 --> 00:01:04.740
If you want to have some examples of great writing, read his stuff.

00:01:04.740 --> 00:01:05.780
It's great.

00:01:05.780 --> 00:01:08.040
So he has this little...

00:01:08.040 --> 00:01:11.540
It's a very lightweight introduction to what the GIL is.

00:01:11.540 --> 00:01:12.900
And to talk...

00:01:12.900 --> 00:01:16.360
And I like the approach of not just the details of it.

00:01:16.360 --> 00:01:20.900
Because most of us aren't going to go in and start hacking the CPython core.

00:01:21.100 --> 00:01:26.500
But a little peek into the CPython core to see that it's a mutex inside an interpreter lock.

00:01:26.500 --> 00:01:30.340
The GIL is the global interpreter lock.

00:01:30.340 --> 00:01:33.340
I love how he pulls out little snippets from CPython.

00:01:33.340 --> 00:01:34.660
He's got a section.

00:01:34.660 --> 00:01:36.520
Behold, the global interpreter lock.

00:01:36.520 --> 00:01:38.100
And it just shows you, like, the C code.

00:01:38.100 --> 00:01:39.180
Yeah, it's just one line.

00:01:39.320 --> 00:01:39.760
Yeah, exactly.

00:01:39.760 --> 00:01:42.440
And you don't really need to know a lot of C to appreciate it.

00:01:42.440 --> 00:01:43.480
But there's just, like...

00:01:43.480 --> 00:01:45.780
There's enough to make it super concrete.

00:01:45.780 --> 00:01:50.180
You're like, this is actually the code that runs when you, like, call the socket.

00:01:50.180 --> 00:01:53.040
Like, and that's how the GIL gets released, for example, right?

00:01:53.160 --> 00:01:54.340
Yeah, talking about sockets.

00:01:54.340 --> 00:01:55.900
And it really...

00:01:55.900 --> 00:01:57.280
He really talks about that.

00:01:57.280 --> 00:01:59.520
That it's focused around...

00:01:59.520 --> 00:02:02.020
The lock is around I.O.

00:02:02.020 --> 00:02:03.700
Whenever you're waiting for I.O.

00:02:03.700 --> 00:02:05.560
And I think there's other places, too.

00:02:05.560 --> 00:02:11.520
But that's the main place where your code will pause and let some other thread run.

00:02:11.520 --> 00:02:13.040
I like the...

00:02:13.040 --> 00:02:16.280
He has a thing that says it's so simple that you can...

00:02:16.280 --> 00:02:19.400
The effect on threads is so simple you can write it on the back of your hand.

00:02:20.060 --> 00:02:24.120
One thread runs Python while in others sleep or await I.O.

00:02:24.120 --> 00:02:26.860
And he actually has a picture of his hand.

00:02:26.860 --> 00:02:27.780
I think it's his hand.

00:02:27.780 --> 00:02:29.400
Yeah, I was wondering if that's actually his hand.

00:02:29.400 --> 00:02:33.060
Yeah, and if he wrote it, that means he must be left-handed

00:02:33.060 --> 00:02:34.740
because it's written on the back of his right hand.

00:02:34.740 --> 00:02:35.980
Or he had somebody else write it.

00:02:35.980 --> 00:02:38.560
So I was always curious about this.

00:02:38.560 --> 00:02:39.440
What are the limitations?

00:02:39.440 --> 00:02:43.140
And how do you utilize it to have faster code?

00:02:43.140 --> 00:02:47.480
And the gist of it is if you've got some code that's waiting I.O.,

00:02:47.480 --> 00:02:51.080
like maybe pulling off a whole bunch of different...

00:02:51.080 --> 00:02:53.940
Taking a bunch of connections or pulling off a bunch of URLs...

00:02:53.940 --> 00:02:55.180
Downloading a bunch of URLs.

00:02:55.180 --> 00:02:58.660
That's a great place to use multi-threading

00:02:58.660 --> 00:03:01.380
because the guild doesn't really get in your way.

00:03:01.380 --> 00:03:02.540
There's...

00:03:02.540 --> 00:03:05.080
In places where you really have multiple processing,

00:03:05.080 --> 00:03:08.260
where you really want your Python code to run at the same time,

00:03:08.260 --> 00:03:11.580
then you have to jump into multi-processing.

00:03:11.780 --> 00:03:13.860
And he actually gives an example of that.

00:03:13.860 --> 00:03:15.500
And it's not that bad either.

00:03:15.500 --> 00:03:19.380
So anyway, I liked the quick jump into it.

00:03:19.380 --> 00:03:23.220
And I think I'm going to be a better Python programmer for reading this.

00:03:23.220 --> 00:03:24.840
Yeah, this is really nice work.

00:03:24.840 --> 00:03:25.780
Good job, Jesse.

00:03:25.780 --> 00:03:26.760
He's a great writer.

00:03:26.760 --> 00:03:29.560
I actually had him on Talk Python on episode 69, I think,

00:03:29.560 --> 00:03:33.140
about design patterns for programmer blogs.

00:03:33.140 --> 00:03:35.360
And we did a whole session on blogging.

00:03:35.360 --> 00:03:35.800
It was great.

00:03:36.440 --> 00:03:40.920
And one of the things I like about this is he talks about cooperative multitasking,

00:03:40.920 --> 00:03:44.500
concurrency versus parallelism, preemptive multitasking,

00:03:44.500 --> 00:03:49.140
how sometimes you still need to actually lock your Python code,

00:03:49.140 --> 00:03:52.660
even though you might think of like, well, this is all straight Python.

00:03:52.660 --> 00:03:54.320
It's not going to get interrupted.

00:03:54.320 --> 00:03:59.580
But there's certain mechanisms that slightly vary between Python 2 and 3,

00:03:59.580 --> 00:04:02.640
where if you hang on to the guild too long,

00:04:02.640 --> 00:04:05.980
it will be potentially taken from you and given to another thread.

00:04:05.980 --> 00:04:10.460
And so that might still cause what would appear to be parallel race conditions.

00:04:10.460 --> 00:04:12.360
So that's also worth reading about.

00:04:12.360 --> 00:04:12.660
Yeah.

00:04:12.660 --> 00:04:14.600
And one of the things that surprised me is,

00:04:14.600 --> 00:04:16.840
and I do realize I don't really worry about that.

00:04:16.840 --> 00:04:18.560
I deal with multi-threading in C++.

00:04:18.560 --> 00:04:24.940
And with C++, you have to do it fine-grained locking of data structures,

00:04:24.940 --> 00:04:28.040
any data structure shared by multiple threads.

00:04:28.040 --> 00:04:33.320
But I was surprised how much you can share between threads in Python

00:04:33.320 --> 00:04:36.980
because the GIL won't interrupt a bytecode.

00:04:36.980 --> 00:04:43.120
And it'll only interrupt, yeah, between bytecodes, not in the C code.

00:04:43.120 --> 00:04:47.640
So the, like, things like sorting a list will happen atomically,

00:04:47.640 --> 00:04:50.020
and you won't be interrupted with that,

00:04:50.020 --> 00:04:51.880
which is, that surprised me.

00:04:51.880 --> 00:04:52.660
I didn't know that.

00:04:52.740 --> 00:04:56.480
It is where, ironically, incrementing a variable could be interrupted.

00:04:56.480 --> 00:04:56.800
Right.

00:04:56.800 --> 00:05:01.320
Because it ends up being, like, a two-step or read-modify-write operation.

00:05:01.320 --> 00:05:01.900
Yeah, exactly.

00:05:01.900 --> 00:05:02.460
Exactly.

00:05:02.460 --> 00:05:06.080
And Jesse uses the disk module to look inside, which is all very good.

00:05:06.080 --> 00:05:06.860
So that's a great article.

00:05:06.860 --> 00:05:09.820
I think that's probably the most substantive thing we're covering.

00:05:09.820 --> 00:05:13.540
Do you want to think about not so substantive but pretty cool?

00:05:13.540 --> 00:05:14.080
Yes.

00:05:14.180 --> 00:05:14.900
I've got one for you.

00:05:14.900 --> 00:05:18.940
Let's talk about the NBA as in National Basketball Association.

00:05:18.940 --> 00:05:20.740
The American basketball.

00:05:20.740 --> 00:05:25.180
So there was a pretty big deal on Twitter the other day.

00:05:25.180 --> 00:05:27.980
So Mark Cuban, he owns the Dallas Mavericks.

00:05:27.980 --> 00:05:31.840
And he's, I don't know if he comes from tech or not.

00:05:31.840 --> 00:05:33.060
I don't really think so.

00:05:33.060 --> 00:05:34.580
But he definitely was an entrepreneur.

00:05:34.580 --> 00:05:36.960
He's, you know, worth, like, he's a billionaire, basically.

00:05:37.500 --> 00:05:46.140
But as a billionaire, owner of a NBA team, he posted out a pretty interesting thing on Twitter saying, here's the new NBA.

00:05:46.140 --> 00:05:54.540
And it was a picture of him learning Python machine learning with, I think, iPython, an iPython notebook open.

00:05:54.540 --> 00:05:57.600
And he's like, I need to understand the Mavericks in the NBA.

00:05:57.600 --> 00:05:58.260
I'm on it.

00:05:58.260 --> 00:05:58.700
Wow.

00:05:58.700 --> 00:05:59.480
It's pretty cool, right?

00:05:59.480 --> 00:06:00.240
It is pretty cool.

00:06:00.460 --> 00:06:09.600
I don't know much about basketball or Mark Cuban or any of that, but it's neat that somebody that high up is wanting to learn Python and notebooks.

00:06:09.600 --> 00:06:11.420
That was basically the main takeaway.

00:06:11.420 --> 00:06:15.860
A bunch of people, like our friends over at Partially Derivative, invited him to be on the show.

00:06:15.860 --> 00:06:17.100
They're like, oh, we have to hear your story.

00:06:17.100 --> 00:06:18.880
He's like, no, no, I'm just getting started.

00:06:18.880 --> 00:06:20.380
They have a team at the Mavericks.

00:06:20.380 --> 00:06:27.280
I just want to understand what they're doing when they use machine learning to help make predictions and planning.

00:06:27.620 --> 00:06:32.820
And that's kind of cool to think of how machine learning is actually driving these professional sports teams as well.

00:06:32.820 --> 00:06:33.240
Yeah.

00:06:33.240 --> 00:06:34.600
Very interesting.

00:06:34.600 --> 00:06:35.100
Indeed.

00:06:35.100 --> 00:06:35.460
Indeed.

00:06:35.460 --> 00:06:36.660
All right.

00:06:36.660 --> 00:06:39.920
So next up, we have somebody winning an award.

00:06:39.920 --> 00:06:40.540
How cool is that?

00:06:40.540 --> 00:06:40.900
Yeah.

00:06:40.900 --> 00:06:42.060
Ian Kurdasko.

00:06:42.060 --> 00:06:49.280
He got a, or it was announced that he will get the 2017 Community Service Award from the Python Software Foundation.

00:06:49.280 --> 00:06:52.120
And I think that's pretty cool.

00:06:52.120 --> 00:06:56.320
It's apparently, I didn't know that he was doing, that a lot of the stuff that he did.

00:06:56.320 --> 00:06:58.140
I mean, I was familiar with Ian.

00:06:58.140 --> 00:07:01.100
He was on Test and Code episode 13.

00:07:01.100 --> 00:07:09.080
And we talked about Betamax library that he has for recording and playing back requests interactions.

00:07:09.620 --> 00:07:17.680
He's apparently been the election administrator for the PSF since 2015, volunteering all that time, of course.

00:07:17.680 --> 00:07:29.140
And he is active in mentoring new coders and supporting other Python developers with apparently really a focus on trying to be active in mentoring women in Python.

00:07:29.140 --> 00:07:31.720
And I think that's just pretty awesome.

00:07:31.720 --> 00:07:32.660
Yeah, that's really awesome.

00:07:32.820 --> 00:07:34.020
So congratulations, Ian.

00:07:34.020 --> 00:07:39.020
And his project that you talked about, like replaying requests, that's called Betamax?

00:07:39.020 --> 00:07:39.480
Yes.

00:07:39.480 --> 00:07:40.460
That's an awesome name.

00:07:40.460 --> 00:07:40.900
Yeah.

00:07:40.900 --> 00:07:41.220
Yeah.

00:07:41.300 --> 00:07:48.000
And it's, I guess, the idea, of course, of there's a VCR type library in some other languages.

00:07:48.000 --> 00:07:52.320
But he chose Betamax because, well, everybody knows Betamax was better.

00:07:52.320 --> 00:07:52.800
That's right.

00:07:52.800 --> 00:07:55.780
But yeah, you should listen to it.

00:07:55.780 --> 00:07:57.340
It's a pretty interesting tool.

00:07:57.340 --> 00:08:00.620
So that was one that the community asked me to do.

00:08:00.620 --> 00:08:07.440
There were community members of listeners of Test and Code that said, hey, could you go find Ian and talk to him about Betamax?

00:08:07.440 --> 00:08:08.300
That's awesome.

00:08:08.300 --> 00:08:13.000
We love to get those recommendations for all the shows, including some stuff that we're covering here today, right?

00:08:13.000 --> 00:08:14.020
Yeah, definitely.

00:08:14.020 --> 00:08:14.460
Definitely.

00:08:14.460 --> 00:08:25.740
So if you want to work with these kind of fun things, maybe you work at a company where you're doing Java and you dabble in Python or you don't really get to do all the cool things you'd like,

00:08:25.740 --> 00:08:30.580
Advanced Digital has a cool job offer for everyone out there who might want to make a change.

00:08:30.580 --> 00:08:33.760
I wish I was near Jersey City because this sounds fun.

00:08:33.760 --> 00:08:34.780
It does sound fun.

00:08:34.780 --> 00:08:39.860
So, right, they're in Jersey City just across the Hudson from Manhattan there.

00:08:39.860 --> 00:08:41.800
Small, agile environment.

00:08:41.800 --> 00:08:45.100
They're mostly a Python shop, but they play with other cool technologies.

00:08:45.100 --> 00:08:48.760
They fund you guys to go to conferences, professional development.

00:08:48.760 --> 00:08:55.200
And most importantly and coolest, I think, is they run one of the 10 largest news sites by traffic in the U.S.

00:08:55.200 --> 00:08:56.440
And they do it with Python.

00:08:56.440 --> 00:08:59.900
So if you want to be part of that team and you want to play with cool stuff like that,

00:09:00.020 --> 00:09:03.520
just visit python.advance.net and check it out.

00:09:03.520 --> 00:09:10.160
So there's a couple of things coming up, Brian, that have to do with Python versus legacy Python.

00:09:10.160 --> 00:09:19.020
Remember, Matthias from the IPython project, Matthias Boussournier, I'm sorry if I mess up your name, but I think that's pretty close.

00:09:19.020 --> 00:09:25.520
He was the original guy who got us talking Python versus legacy Python instead of Python 3 versus Python 2.

00:09:25.680 --> 00:09:26.520
Oh, yeah, right.

00:09:26.520 --> 00:09:26.680
Yeah.

00:09:26.680 --> 00:09:29.740
So he works on IPython and Jupyter and all that stuff.

00:09:29.740 --> 00:09:32.760
And he's back with a new blog post, which is my next item.

00:09:32.760 --> 00:09:35.080
And it's a pretty big deal.

00:09:35.080 --> 00:09:39.260
We just talked about Mark Cuban, the new NBA machine learning, IPython.

00:09:39.760 --> 00:09:43.200
And so they just released IPython 6.

00:09:43.200 --> 00:09:44.340
Okay.

00:09:44.340 --> 00:09:45.840
So that's pretty big news.

00:09:45.840 --> 00:09:46.740
That is big news.

00:09:46.740 --> 00:09:47.120
Yeah.

00:09:47.120 --> 00:09:50.620
And so people who use IPython, you know, there's a brand new version.

00:09:50.620 --> 00:09:51.260
That's awesome.

00:09:51.700 --> 00:09:57.440
The bigger thing is that this is the first release where IPython goes Python 3 only.

00:09:57.440 --> 00:09:59.620
They've dropped support for Python 2.

00:09:59.620 --> 00:10:00.220
That's great.

00:10:00.220 --> 00:10:05.620
So, or as Matthias would say, they now support Python and not mixing in legacy Python with it.

00:10:05.620 --> 00:10:05.940
Yeah.

00:10:05.940 --> 00:10:08.600
And what I thought was nice is, you know, it's a pretty major project.

00:10:08.600 --> 00:10:15.420
They did a little write-up of what was their experience of converting a mixed source code to Python 3 only.

00:10:15.420 --> 00:10:17.060
What were the benefits and what were the drawbacks?

00:10:17.740 --> 00:10:21.320
So let's see, a couple of things, a couple of stats that Matthias put out.

00:10:21.320 --> 00:10:26.480
The size of the IPython code base has decreased by 1,500 lines.

00:10:26.480 --> 00:10:28.620
That's pretty solid, right?

00:10:28.620 --> 00:10:29.340
That's significant.

00:10:29.340 --> 00:10:30.640
Less code means less maintenance.

00:10:30.640 --> 00:10:31.020
Right.

00:10:31.020 --> 00:10:35.840
They said it's not just because they're dropping Python 2, but it's a significant amount is.

00:10:35.840 --> 00:10:41.760
And even more impressive is they added some entirely new features that required hundreds of new lines of code.

00:10:42.340 --> 00:10:51.960
So they're really the decrease in amount of code they had to support for Python 3 or really for 2 they were able to get rid of when they went to Python 3 is actually probably more.

00:10:51.960 --> 00:10:54.220
So that's pretty cool.

00:10:54.220 --> 00:11:01.140
And they said one of the benefits, they think, is that contributors can spend less time worrying about, well, how does this work if we do it in Python 2?

00:11:01.800 --> 00:11:03.720
Or, you know, this has happened to me.

00:11:03.720 --> 00:11:04.700
You make a pull request.

00:11:04.700 --> 00:11:05.440
You submit it.

00:11:05.440 --> 00:11:07.640
It runs on the continuous integration.

00:11:07.640 --> 00:11:09.360
And it works fine in Python 3.

00:11:09.360 --> 00:11:14.200
But then it fails in Python 2 because, you know, you forgot the B in the string or whatever, right?

00:11:14.200 --> 00:11:16.100
So they don't have to worry about that.

00:11:16.100 --> 00:11:17.820
CI runs faster.

00:11:18.820 --> 00:11:21.600
They said basically, in summary, we're totally happy.

00:11:21.600 --> 00:11:26.420
We're entirely pleased with having switched to basically have the ability to write Python 3 only code.

00:11:26.420 --> 00:11:33.880
And they're looking forward to using a lot of the improvements in Python 3, specifically async and await, which will be cool.

00:11:33.880 --> 00:11:37.240
So an async and await REPL inside of IPython.

00:11:37.240 --> 00:11:37.900
How cool is that?

00:11:37.900 --> 00:11:38.620
That's neat.

00:11:38.620 --> 00:11:42.680
Is async and await in all of the three versions or did that get introduced?

00:11:42.680 --> 00:11:43.940
It came in 3.5.

00:11:43.940 --> 00:11:44.540
Okay.

00:11:44.540 --> 00:11:47.940
The async I.O. stuff was introduced in Python 3.4, I think.

00:11:47.940 --> 00:11:52.080
And then 3.5, they're like, let's put some proper syntax on this and make it really easy.

00:11:52.080 --> 00:11:52.380
Yeah.

00:11:52.380 --> 00:12:02.760
I'm trying to, I'm writing a little thing that I want to have available on Python 2 also and at least 2.7.

00:12:02.760 --> 00:12:10.360
And even if I were to just do Python 3, all of the three versions, I still can't use f-strings, which I wish I could use f-strings.

00:12:10.360 --> 00:12:11.080
I know.

00:12:11.080 --> 00:12:11.660
They're so new.

00:12:11.660 --> 00:12:12.480
It's 3.6 only.

00:12:12.880 --> 00:12:14.740
Even on my production server, it's 3.5.

00:12:14.740 --> 00:12:16.280
So it is what it is.

00:12:16.280 --> 00:12:17.500
That's a move in the right direction.

00:12:17.500 --> 00:12:22.820
And I think it's great that Matias and others talked about their experience with that change.

00:12:22.820 --> 00:12:23.220
Yeah.

00:12:23.220 --> 00:12:23.860
That's awesome.

00:12:23.860 --> 00:12:24.200
Yeah.

00:12:24.200 --> 00:12:24.680
Thanks, Matias.

00:12:24.680 --> 00:12:25.140
Excellent.

00:12:25.140 --> 00:12:28.340
I think I'm, to use an American expression, beating a dead horse.

00:12:28.340 --> 00:12:29.980
But we have another.

00:12:29.980 --> 00:12:31.240
Is that dead horse called Source?

00:12:31.240 --> 00:12:31.780
SRC?

00:12:31.780 --> 00:12:32.460
Yes.

00:12:32.460 --> 00:12:33.180
Yes.

00:12:33.580 --> 00:12:38.100
The other package I was talking about me building up, it's for the book.

00:12:38.100 --> 00:12:47.020
But it's, I wanted to make sure I was representing the community correctly and how to, how to put together a distributable package and do it correctly.

00:12:47.020 --> 00:12:48.960
At least with best practice.

00:12:48.960 --> 00:12:50.240
I know there's not really a correct.

00:12:50.560 --> 00:12:57.180
But somebody pointed me to the direction of an article by, I'm going to probably get this wrong.

00:12:57.180 --> 00:12:58.040
I think it's Enoch.

00:12:58.040 --> 00:13:00.640
And it's called Testing and Packaging.

00:13:00.900 --> 00:13:05.860
And it's basically, he's the guy that did the Adders project or ATTRS.

00:13:05.860 --> 00:13:07.080
Great project.

00:13:07.080 --> 00:13:08.500
That we've talked about a couple times.

00:13:08.500 --> 00:13:26.920
And how there were issues, at least with one package that wasn't using the source, SRC, that the testing that was done was, there was a bug that showed up in, with installed applications that doesn't show up in non-installed.

00:13:27.460 --> 00:13:37.040
So one of the benefits of using SRC is you can more easily make sure that you're only testing the installed package and not the non-installed.

00:13:37.040 --> 00:13:41.260
And he also just shows that it's really just two lines of code change.

00:13:41.260 --> 00:13:44.680
So to do the right thing is not that much work.

00:13:44.680 --> 00:13:44.960
Right.

00:13:44.960 --> 00:13:51.580
So basically in your setup, PY, the call to setup, you set the packages to be looking in the source directory.

00:13:51.580 --> 00:13:54.220
And you set the package to be in the source directory, right?

00:13:54.300 --> 00:13:54.440
Yeah.

00:13:54.440 --> 00:14:02.500
So when you would normally say find packages, he recommends specifically saying find packages and then give it a where equals SRC.

00:14:02.500 --> 00:14:07.100
But you can also just put SRC in the, as the first argument.

00:14:07.100 --> 00:14:07.860
And that works also.

00:14:07.860 --> 00:14:10.500
And then listing it in the packages dir.

00:14:10.900 --> 00:14:18.080
And then one of the things I noticed, which I don't think people have really talked about, is the entire repository looks better.

00:14:18.080 --> 00:14:24.960
You've got all of the package junk, like your setup and your manifest and all that stuff at the top level.

00:14:24.960 --> 00:14:30.080
And the stuff you really care about on a day-to-day basis is separated into subdirectories.

00:14:30.080 --> 00:14:34.180
You've got the docs in one and the tests in another, and then your source in another.

00:14:34.660 --> 00:14:37.680
And that separation just, it pleases my organization.

00:14:37.680 --> 00:14:39.060
It just is nice.

00:14:39.060 --> 00:14:39.280
Yeah.

00:14:39.280 --> 00:14:40.620
I'm coming around to this as well.

00:14:40.620 --> 00:14:41.480
It sounds pretty solid.

00:14:41.480 --> 00:14:41.860
Anyway.

00:14:41.860 --> 00:14:46.500
But that's, I'll probably try to drop talking about that every episode.

00:14:46.500 --> 00:14:47.560
But there you go.

00:14:47.560 --> 00:14:48.240
One more article.

00:14:48.240 --> 00:14:52.080
Well, I'm not quite done beating the Python versus legacy Python horse yet.

00:14:52.080 --> 00:14:53.780
So I'm going to keep going on that one.

00:14:53.780 --> 00:14:55.120
Because there's some more big news.

00:14:55.200 --> 00:14:57.520
We've heard that IPython went to Python 3 only.

00:14:57.520 --> 00:15:05.860
And now, same week, last week, AWS Lambda goes to Python, or ads not only, but ads.

00:15:05.860 --> 00:15:08.000
Python 3.6 support was just 2.7.

00:15:08.000 --> 00:15:09.380
So that's a big jump, right?

00:15:09.380 --> 00:15:10.280
Wow, that's a big jump.

00:15:10.280 --> 00:15:10.500
Yeah.

00:15:10.500 --> 00:15:10.760
Yeah.

00:15:10.760 --> 00:15:12.400
So that's pretty awesome.

00:15:12.400 --> 00:15:14.660
And do you have much experience with Lambda?

00:15:14.660 --> 00:15:15.280
Have you played with it?

00:15:15.280 --> 00:15:15.680
No.

00:15:15.680 --> 00:15:18.200
I've heard a lot about it, but I haven't played with it yet.

00:15:18.200 --> 00:15:27.360
So Lambda is one of these things from AWS, from Amazon, that fits into this serverless architecture.

00:15:27.360 --> 00:15:29.940
So basically, you say, here's a function.

00:15:29.940 --> 00:15:33.600
And when something happens, run this, please.

00:15:33.600 --> 00:15:34.800
So run it on a schedule.

00:15:34.800 --> 00:15:36.580
Somebody changes a database.

00:15:36.580 --> 00:15:39.180
Somebody uploads a file to S3, whatever.

00:15:39.180 --> 00:15:40.760
And it just runs.

00:15:40.760 --> 00:15:43.000
There's no servers that you deal with.

00:15:43.000 --> 00:15:43.940
Obviously, there are servers.

00:15:43.940 --> 00:15:48.040
But it just distributes your code to run when it needs to.

00:15:48.040 --> 00:15:49.540
So I'll cross a whole bunch of servers.

00:15:49.540 --> 00:15:51.780
So it scales basically infinitely.

00:15:51.780 --> 00:15:55.500
As long as you have infinite money, you can infinitely scale this.

00:15:55.500 --> 00:15:56.180
It's fine, right?

00:15:56.180 --> 00:15:58.400
And that's pretty cool.

00:15:58.400 --> 00:15:58.760
Yeah.

00:15:58.760 --> 00:16:00.120
So have you tried it?

00:16:00.120 --> 00:16:03.560
No, I have not had a real reason to do it.

00:16:03.560 --> 00:16:06.200
I mean, I guess there's a couple of things that I could do.

00:16:06.200 --> 00:16:14.140
Like on the websites, there's a job that runs every couple hours that will completely re-index the database

00:16:14.140 --> 00:16:17.220
and reorganize it for super fast queries.

00:16:17.220 --> 00:16:20.660
Like the queries on the various websites run.

00:16:20.660 --> 00:16:21.960
And I'm going to be adding to Python bytes.

00:16:21.960 --> 00:16:22.500
No worries.

00:16:22.500 --> 00:16:25.620
They run like sub-millisecond, right?

00:16:25.620 --> 00:16:28.080
In order to get that stuff, you've got to kind of pre-compute some things.

00:16:28.080 --> 00:16:31.200
Maybe that's a perfect Lambda operation, right?

00:16:31.200 --> 00:16:37.680
Well, I mean, especially now that they have 3.6 support, I'm intrigued enough that I might give it a shot anyway.

00:16:37.680 --> 00:16:41.540
Just to make up some excuse to play with it.

00:16:41.860 --> 00:16:42.220
Exactly.

00:16:42.220 --> 00:16:43.040
We need to run this.

00:16:43.040 --> 00:16:49.320
But I mean, if you're using other AWS stuff, like their database services, Dynamo or RDS or S3,

00:16:49.540 --> 00:16:54.820
like here's a way to run code like really near your resources on triggers with no effort.

00:16:54.820 --> 00:16:58.440
And one of the things I thought was pretty cool, like this announcement just came out.

00:16:59.120 --> 00:17:07.160
And Zappa, so Zappa, if you look at their page, which I linked, it's called serverless Python web services.

00:17:07.160 --> 00:17:09.100
That's interesting, right?

00:17:09.660 --> 00:17:17.600
So basically you can set it up so that using the AWS architecture, you can route web requests to these Lambda functions.

00:17:17.600 --> 00:17:20.520
But you don't really have servers or anything like that.

00:17:20.520 --> 00:17:25.300
And people have been asking for Python 3 support.

00:17:25.300 --> 00:17:26.740
They've been saying, no, no, no, no.

00:17:26.740 --> 00:17:29.800
As soon as this dropped, they're like, yes, it has Python 3 support.

00:17:29.800 --> 00:17:31.720
So that is pretty cool as well.

00:17:31.720 --> 00:17:38.040
So you've seen things that basically are layered on top of Lambda also started to support Python 3, which is great.

00:17:38.040 --> 00:17:38.760
Yeah, definitely.

00:17:38.760 --> 00:17:39.460
Cool.

00:17:39.680 --> 00:17:40.900
All right, yeah, maybe we should play with Lambda.

00:17:40.900 --> 00:17:41.440
I don't know.

00:17:41.440 --> 00:17:41.960
Yeah.

00:17:41.960 --> 00:17:43.060
Very nice.

00:17:43.060 --> 00:17:44.340
All right, well, that's it for the news, Brian.

00:17:44.340 --> 00:17:46.680
You got anything personally you want to share with everyone?

00:17:46.680 --> 00:17:57.860
No, I'm going to be, I guess I'll be in the Munich area the second week in May if there's anybody around that wants to have a beer or something with me.

00:17:57.860 --> 00:17:58.440
Hit me up.

00:17:58.440 --> 00:17:59.500
Yeah, that sounds awesome.

00:17:59.500 --> 00:18:00.420
I'm jealous.

00:18:00.420 --> 00:18:01.500
I'd love to go visit Germany.

00:18:01.500 --> 00:18:03.660
Well, I'll do that at the end of the summer maybe.

00:18:03.660 --> 00:18:04.260
We'll see.

00:18:04.260 --> 00:18:05.920
But no news for me.

00:18:05.920 --> 00:18:08.400
I just want to say thank you, everyone, for listening.

00:18:08.400 --> 00:18:08.940
Oh, you know what?

00:18:09.020 --> 00:18:09.780
Actually, one more thing.

00:18:09.780 --> 00:18:12.060
This is not personal news, but it falls right in here.

00:18:12.060 --> 00:18:15.540
I also saw CheckIO at CheckIO.org.

00:18:15.540 --> 00:18:19.360
These guys have a pretty cool gamification of learning Python.

00:18:19.360 --> 00:18:21.660
They also just went Python 3.

00:18:21.660 --> 00:18:22.300
Oh, cool.

00:18:22.500 --> 00:18:24.360
So just to keep on this.

00:18:24.360 --> 00:18:26.140
Hey, Python 3 is starting to really roll.

00:18:26.140 --> 00:18:27.980
I'd say it's really starting to roll this week.

00:18:27.980 --> 00:18:35.620
I use CheckIO for, hopefully I won't get in trouble for this, but I've gone through a bunch of this stuff and I use them for interview questions.

00:18:35.840 --> 00:18:37.180
Yeah, I think it's actually pretty good.

00:18:37.180 --> 00:18:42.720
What I really like is you can solve a puzzle and then you can look at other people's solutions.

00:18:42.720 --> 00:18:53.640
And I found after solving a bunch and looking at the solutions that I unknowingly have an implicit bias towards performance over ease of reading or simplicity or whatever.

00:18:53.640 --> 00:18:56.240
It's interesting that it uncovered that for me.

00:18:56.320 --> 00:18:57.060
Oh, that's interesting.

00:18:57.060 --> 00:18:58.180
And I totally have the opposite.

00:18:58.180 --> 00:19:01.280
I like them to be readable more than anything else.

00:19:01.280 --> 00:19:01.580
Yeah.

00:19:01.580 --> 00:19:01.960
Yeah.

00:19:01.960 --> 00:19:02.620
Funny, huh?

00:19:02.620 --> 00:19:03.600
All right.

00:19:03.600 --> 00:19:04.700
Well, thanks, Brian.

00:19:04.700 --> 00:19:05.920
Thank you, everyone, for listening.

00:19:05.920 --> 00:19:07.060
And we'll catch you next week.

00:19:07.060 --> 00:19:07.660
And thank you.

00:19:07.660 --> 00:19:08.060
Yep.

00:19:08.060 --> 00:19:08.500
You're welcome.

00:19:08.500 --> 00:19:08.960
Bye.

00:19:09.320 --> 00:19:11.840
Thank you for listening to Python Bytes.

00:19:11.840 --> 00:19:14.400
Follow the show on Twitter via at Python Bytes.

00:19:14.400 --> 00:19:17.280
That's Python Bytes as in B-Y-T-E-S.

00:19:17.280 --> 00:19:20.700
And get the full show notes at pythonbytes.fm.

00:19:20.700 --> 00:19:25.060
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:19:25.060 --> 00:19:27.760
We're always on the lookout for sharing something cool.

00:19:27.760 --> 00:19:31.140
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:19:31.140 --> 00:19:34.780
Thank you for listening and sharing this podcast with your friends and colleagues.

