WEBVTT

00:00:00.001 --> 00:00:04.480
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to

00:00:04.480 --> 00:00:12.120
your earbuds. This is episode 199, almost 200, Brian. Almost. Almost. Recorded September 9th,

00:00:12.120 --> 00:00:17.620
2020. I'm Michael Kennedy. And I'm Brian Okken. And this episode is brought to you by us. We'll

00:00:17.620 --> 00:00:22.480
tell you more about the things that we're doing and what we have to offer later. But for now,

00:00:22.480 --> 00:00:29.000
I want to talk about not any huge announcement, but a very, very small announcement that it's

00:00:29.000 --> 00:00:33.500
also kind of huge. Very cool. Yeah. So micro, you might say. You might say it's microscopic,

00:00:33.500 --> 00:00:39.980
but it's a big deal. So MicroPython has just had a new release. And this is significant because the

00:00:39.980 --> 00:00:47.140
last release from MicroPython was December 19th of last year. So it's been, you know, what is that?

00:00:47.140 --> 00:00:51.520
Almost 10 months since the last release. So if you care about MicroPython, this is like a pretty big

00:00:51.520 --> 00:00:58.500
deal. So version 113 is out. And one of the major things is it has improved asyncio,

00:00:58.700 --> 00:01:06.880
async and await support. And it has cool Bluetooth improvements. And it even comes with the PEP 526,

00:01:06.880 --> 00:01:11.700
that walrus operator. Oh, nice. Yeah. So there's a lot of stuff going on here. They basically,

00:01:11.700 --> 00:01:19.980
MicroPython, as you can imagine, comes with a micro asyncio module. I'm guessing the U is really a MU.

00:01:19.980 --> 00:01:28.500
U asyncio module that's supposed to be more compatible with CPython's asyncio. So the main idea is that the

00:01:28.500 --> 00:01:34.200
task object, you can use a task object for each coroutine, which allows you to have like unbounded

00:01:34.200 --> 00:01:39.180
queues of work and stuff like that. Whereas previously, I think you had to pre-allocate it for some reason.

00:01:39.180 --> 00:01:45.900
I never tried to do asyncio on MicroPython, but apparently it was a little bit wonky. And so now it's more

00:01:45.900 --> 00:01:52.140
consistent. Another thing that I thought was interesting about this release, Brian, was they went through and

00:01:52.140 --> 00:01:59.580
auto-formatted all the code in the entire repository. And if you look at their repo, there is Python and MicroPython,

00:01:59.580 --> 00:02:05.900
but a lot like CPython, it's a lot of C as well. Right? I think it's like 80% C or something.

00:02:05.900 --> 00:02:06.240
Okay.

00:02:06.240 --> 00:02:10.820
And so they auto-formatted the Python code with black, and that probably won't surprise too many people,

00:02:10.960 --> 00:02:18.020
but they auto-formatted C with that community's equivalent of black, and get ready for the name,

00:02:18.020 --> 00:02:22.160
Uncrustify. They uncrustified the C code.

00:02:22.160 --> 00:02:22.500
Okay.

00:02:22.500 --> 00:02:23.260
Do you know about this?

00:02:23.260 --> 00:02:26.200
No, actually, I'm writing it down because I'd like to check this out.

00:02:26.200 --> 00:02:30.840
Isn't that great? So you can basically configure how it formats your C code. And it's like black. It's

00:02:30.840 --> 00:02:35.720
like, you know, it just runs automatically and fixes your C code. And boy, if you thought Python

00:02:35.720 --> 00:02:40.420
code needed some fixing, I'll bet you the C code. And there's more variety in there, right?

00:02:40.420 --> 00:02:43.380
Yeah. I've seen some ugly C code in my day.

00:02:43.380 --> 00:02:48.800
Yeah, for sure. For sure. Because with the curly braces and semicolons, you have a lot more flexibility

00:02:48.800 --> 00:02:53.500
in how you format stuff, whereas Python forces some of that structure upon you.

00:02:53.500 --> 00:03:00.700
All right. They also added Blue Kitchen. Apparently Blue Kitchen is a Bluetooth stack. And so they added a

00:03:00.700 --> 00:03:09.520
micro Mew Bluetooth module as an alternative to the Nimble stack as well. And there's a Unix port,

00:03:09.520 --> 00:03:14.360
and you can build the Unix port with the Bluetooth support for either of these bindings. That's pretty

00:03:14.360 --> 00:03:20.800
cool. That comes with new events. So if you're doing like Bluetooth discovery and things like that,

00:03:20.800 --> 00:03:27.640
you can like scan for Bluetooth stuff more easily. It also came with a big memory leak fix for ARM

00:03:27.640 --> 00:03:35.180
chips, which is big in the small space, ironically. So apparently, there was certain memory that was

00:03:35.180 --> 00:03:38.960
not reclaimed by the garbage collector and other types of things. So if you've, you know, and at the

00:03:38.960 --> 00:03:43.300
same time on these very small devices, you care a lot about not wasting memory, right? It's not like

00:03:43.300 --> 00:03:48.540
you got 32 gigs like my laptop does. So like whatever, right? It's going to matter if you lose memory on

00:03:48.540 --> 00:03:56.680
like a little micro Python chip. And also they set it up so you can run parallel tests against multiple

00:03:56.680 --> 00:04:01.740
micro Python targets. So I'm guessing like different chips and different devices, you can just say go test

00:04:01.740 --> 00:04:07.060
them, run it synchronized across two or more micro Python targets. I don't know if that's to speed it

00:04:07.060 --> 00:04:12.860
up or to like, test the whole thing on different platforms in parallel or whatever. But it sounds like a

00:04:12.860 --> 00:04:16.960
good improvement. And it does come with a few breaking changes. So people can check that out.

00:04:16.960 --> 00:04:22.220
Anyway, if you care about micro Python, and I'm guessing this may make its way over to CircuitPython

00:04:22.220 --> 00:04:27.080
as well at some point, knowing that those projects are really close. So anyway, this looks really good

00:04:27.080 --> 00:04:29.340
if you're doing big stuff on small things.

00:04:29.340 --> 00:04:31.420
Yeah, it's good to see this going forward.

00:04:31.420 --> 00:04:35.440
And thanks to Matt Trentini for sharing this and bringing it to our attention.

00:04:35.440 --> 00:04:40.500
I wish I was better at remembering names, but somebody I had on testing code brought up

00:04:40.500 --> 00:04:49.800
respx and or respix. I should stop. R-E-S-P-X. It's a utility for mocking out the Python HTTPX library.

00:04:49.800 --> 00:04:54.180
So that somebody brought that up and I had never heard of it before. So I figured we'd bring it up

00:04:54.180 --> 00:05:02.040
here. So with requests, if you want to mock it, there's a whole library called responses and cleverly

00:05:02.040 --> 00:05:08.200
named a bit hard to search for. And then with HTTPX, if you want to mock it, there is respx.

00:05:08.200 --> 00:05:12.100
I'm going to name it response X, but we just the other part, you just don't write it.

00:05:12.100 --> 00:05:15.800
It's like the opposite of a silent E. It's it's not written.

00:05:15.800 --> 00:05:17.000
Maybe.

00:05:17.000 --> 00:05:21.140
Sorry, keep going. It sounds like a great idea.

00:05:21.140 --> 00:05:25.700
Well, interestingly enough, when you write the two imports out, they're the same number of characters.

00:05:25.880 --> 00:05:32.000
Maybe that's part of the reason why they did that. Anyway, that quick start is like shows it's really quick.

00:05:32.000 --> 00:05:39.260
You just it's a really just a few lines of code to mock out a request response call or response call.

00:05:39.260 --> 00:05:44.580
You can do things like things that you would expect, like an assert that something was actually called

00:05:44.580 --> 00:05:48.180
and what the status code was and things like that.

00:05:48.180 --> 00:05:53.260
But you can also have custom content and you can return JSON content.

00:05:53.260 --> 00:05:57.580
of course, there's some examples. What I like is the documentation is pretty nice.

00:05:57.580 --> 00:06:01.380
There's some examples on how to use it with both pytest and UnitTest,

00:06:01.380 --> 00:06:05.800
including how to set up like a mocked API fixture for pytest.

00:06:05.800 --> 00:06:09.140
You can have multiple tests using the same mocked endpoint.

00:06:09.140 --> 00:06:12.680
And there's a bunch of nice things about it.

00:06:12.680 --> 00:06:16.720
Like, for instance, if you want to mock out a whole bunch of different URLs,

00:06:16.720 --> 00:06:22.780
you can use some regular expressions to set what URLs you want to catch with that.

00:06:22.780 --> 00:06:35.280
and then also the content that you return from your mocked object, your mocked request is you can have a callback that can generate that on the fly based on what you pass in it.

00:06:35.440 --> 00:06:40.760
If you have a HTTPX based application, you definitely need to know about this for testing.

00:06:40.760 --> 00:06:41.620
Yeah, absolutely.

00:06:41.620 --> 00:06:47.860
And one of the things that's challenging about testing the HTTPX is the async stuff, right?

00:06:47.860 --> 00:06:52.480
And so this is a really cool way to get in there and just make it work, right?

00:06:52.480 --> 00:06:52.780
Yeah.

00:06:52.820 --> 00:06:57.420
Just put a decorator there and it just mocks it out for you like you would expect.

00:06:57.420 --> 00:06:58.560
Looks very clean.

00:06:58.560 --> 00:06:59.780
Yeah, pretty easy.

00:06:59.780 --> 00:07:05.480
And there's a lot of magic going on under the hood to make that a clean interface, but I think they did a good job.

00:07:05.480 --> 00:07:05.740
Yeah.

00:07:06.520 --> 00:07:14.980
So HTTPX comes from sort of an async derivative of requests, which I think is a really fantastic library.

00:07:14.980 --> 00:07:16.680
And I've done some cool stuff with HTTPX.

00:07:16.680 --> 00:07:18.080
So yeah, I'm a fan of this.

00:07:18.080 --> 00:07:18.460
It's great.

00:07:18.460 --> 00:07:27.060
Now, before we move on, let's talk about a couple of things that we got going on that people can check out that will definitely help support the show.

00:07:27.180 --> 00:07:28.740
And they might find interesting.

00:07:28.740 --> 00:07:31.960
I know that you've got some updates for your book.

00:07:31.960 --> 00:07:32.340
Is that right?

00:07:32.340 --> 00:07:32.640
Yeah.

00:07:32.640 --> 00:07:38.180
The Python testing with pytestBook, just a minor, the book itself has a minor update.

00:07:38.180 --> 00:07:44.900
So there's, it wasn't a big enough change to change the hardback version, but the ebook will be updated.

00:07:44.900 --> 00:07:53.300
I don't think the hardback is going to be updated, but it's a couple lines of code in a couple of code examples in chapter five.

00:07:53.300 --> 00:07:55.620
So it's a very minor thing.

00:07:56.160 --> 00:07:59.240
But the big difference is the code download.

00:07:59.240 --> 00:08:01.300
So we've updated the code download.

00:08:01.300 --> 00:08:09.080
So even if you're working with the hardback book or using the old version and don't update the ebook, please redownload the code.

00:08:09.080 --> 00:08:11.800
It'll make your learning experience better.

00:08:11.800 --> 00:08:20.240
And the main change is that I've pinned the dependencies in the target project or the example project so that everything works better.

00:08:20.240 --> 00:08:20.960
Good.

00:08:20.960 --> 00:08:24.980
There was a tiny DB is a database that I use in the project.

00:08:25.140 --> 00:08:27.700
And it had some incompatible changes.

00:08:28.060 --> 00:08:35.000
And instead of trying to update everything to use the new, the new tiny DB, I just pinned it to an old version.

00:08:35.000 --> 00:08:35.840
Yeah, that makes sense.

00:08:35.840 --> 00:08:39.380
I mean, it's not like you're trying to teach people tiny DB.

00:08:39.380 --> 00:08:40.480
You're like, here's a dependency.

00:08:40.480 --> 00:08:42.180
We're trying to get around to something.

00:08:42.180 --> 00:08:42.500
Yeah.

00:08:42.620 --> 00:08:46.960
So that's not important to the content of teaching people how to write tests.

00:08:46.960 --> 00:08:49.020
Yeah, that's the problem of creating content.

00:08:49.020 --> 00:08:52.420
The world moves on and they're not always compatible with what you did.

00:08:52.420 --> 00:08:53.060
How about that?

00:08:53.220 --> 00:08:53.400
Yeah.

00:08:53.400 --> 00:08:57.920
Over at Talk Python, we've got a whole bunch of stuff coming.

00:08:57.920 --> 00:09:04.300
And so what I'd like to encourage people to do is just to go to talkpython.fm or training.talkpython.fm.

00:09:04.300 --> 00:09:08.000
And right there you can, at the front of the training site, you can just enter your email.

00:09:08.220 --> 00:09:14.380
So if you get a bunch of announcements, because I believe we are working on five or six courses right now are under active development.

00:09:14.380 --> 00:09:16.200
We've got all sorts of great stuff.

00:09:16.200 --> 00:09:18.980
And rather going through it, just sign up to get notified when those come out.

00:09:18.980 --> 00:09:19.460
Very cool.

00:09:19.460 --> 00:09:20.300
Indeed, indeed.

00:09:20.300 --> 00:09:26.480
So a while ago, I went on this Twitter journey, let's say.

00:09:26.480 --> 00:09:27.840
I don't know how to really explain it.

00:09:27.840 --> 00:09:31.740
It was like I posted a quick question that led to a ton of feedback.

00:09:32.200 --> 00:09:39.100
And then, wow, so many pieces of information and ideas and variations were sent around.

00:09:39.100 --> 00:09:45.720
What I was trying to say, like, I'd like a dictionary that contains objects that I can access, say, with different keys.

00:09:45.720 --> 00:09:52.020
Like, I'd like to put a bunch of users and access them by ID, but maybe also by email or by city.

00:09:52.020 --> 00:09:52.880
And that would come with a bunch.

00:09:52.880 --> 00:09:55.080
So it was like this sort of exploration there.

00:09:55.080 --> 00:10:01.980
And one of the recommendations that came over sort of around that is like, hey, you should check out this thing called GetPy.

00:10:02.240 --> 00:10:02.480
Okay.

00:10:02.480 --> 00:10:06.280
I don't know where the name comes from, but it doesn't tell a lot about what it is.

00:10:06.280 --> 00:10:10.860
But it's a vectorized Python dictionary and set implementation.

00:10:10.860 --> 00:10:20.740
And vectorized as in it matches up perfectly with NumPy and so pandas and all the things that are built upon NumPy to plug straight into them.

00:10:20.740 --> 00:10:31.540
So imagine I want to have a dictionary that has data in NumPy, but lets me treat it like a regular Python dictionary or a set and things like that.

00:10:31.540 --> 00:10:33.500
So that's what this is.

00:10:33.500 --> 00:10:43.400
It basically brings a super high performance Python dictionary and set implementation that automatically integrates into the Python scientific ecosystem, which I think is pretty cool.

00:10:43.400 --> 00:10:43.720
Yeah.

00:10:43.720 --> 00:10:44.040
Yeah.

00:10:44.080 --> 00:10:47.340
And it's built upon this thing called parallel hash map.

00:10:47.340 --> 00:10:55.860
So parallel hash map is apparently the current state of the art unordered map set with minimal memory overhead and super fast runtime.

00:10:55.860 --> 00:10:58.100
So like a C binding.

00:10:58.300 --> 00:11:02.620
And so this is just a Python wrapper on top of the C library.

00:11:02.620 --> 00:11:05.020
That's a super fast dictionary and set.

00:11:05.020 --> 00:11:06.320
So that's pretty awesome.

00:11:06.320 --> 00:11:11.260
And here's another one for you, Brian, for your C++ adventures.

00:11:11.560 --> 00:11:18.640
The integration between getpy and parallel hash map is this thing called pybind11.

00:11:18.640 --> 00:11:25.680
So pybind11 is a compatibility layer between C++11 and Python.

00:11:25.680 --> 00:11:32.400
So if you want to write like modern C++ and then plug it in easily to Python, here you go.

00:11:32.400 --> 00:11:32.920
Nice.

00:11:32.920 --> 00:11:33.280
Yeah.

00:11:33.280 --> 00:11:34.000
So that's pretty cool.

00:11:34.000 --> 00:11:34.300
Okay.

00:11:34.300 --> 00:11:39.580
There's two classes, GP, so getpy, gp.dict and gp.set.

00:11:39.580 --> 00:11:44.800
And they're designed to be basically similar to the standard dictionaries and sets from Python.

00:11:44.800 --> 00:11:45.800
But there's a few differences.

00:11:45.800 --> 00:11:46.900
So check out the docs.

00:11:46.900 --> 00:11:51.620
And then I threw in a quick little example here that has two numpy arrays.

00:11:51.620 --> 00:11:55.020
And you can say, here are the keys, here are the values, put them together.

00:11:55.020 --> 00:11:58.040
And then you can just access different values.

00:11:58.040 --> 00:12:01.120
And it's also typed, which I think is kind of interesting, right?

00:12:01.120 --> 00:12:06.140
Like it has like an unsigned 8-bit integer or something like that.

00:12:06.140 --> 00:12:08.020
Much like numpy is.

00:12:08.020 --> 00:12:16.480
But it's more like a Python array where you specify the numerical type than it is just an unbounded list.

00:12:16.480 --> 00:12:17.120
Right.

00:12:17.120 --> 00:12:18.480
So there's some interesting stuff going on here.

00:12:18.480 --> 00:12:20.420
Does it solve your problem that you were looking for?

00:12:20.420 --> 00:12:21.480
No, not at all.

00:12:21.480 --> 00:12:23.520
But it's very interesting.

00:12:23.520 --> 00:12:24.480
But it's still neat.

00:12:24.480 --> 00:12:24.780
Yeah.

00:12:24.780 --> 00:12:25.480
Yeah, it's still neat.

00:12:25.480 --> 00:12:28.920
Speaking of neat, we already talked about black once, but it's pretty neat.

00:12:28.920 --> 00:12:29.700
Let's talk about it again.

00:12:29.700 --> 00:12:31.820
Yeah, this was sent in by John Hagen.

00:12:31.820 --> 00:12:36.600
And he mentioned that, I mean, I'm pretty sure we've mentioned ISORT before.

00:12:36.600 --> 00:12:37.940
I know we've mentioned black.

00:12:37.940 --> 00:12:40.780
But a lot of projects use both.

00:12:40.780 --> 00:12:45.460
So ISORT will sort your imports so you don't have to.

00:12:45.460 --> 00:12:50.080
And then just so they're consistent and they're alphabetically sorted.

00:12:50.080 --> 00:12:51.240
And then there's some other.

00:12:51.240 --> 00:12:51.500
Right.

00:12:51.500 --> 00:12:58.680
And there's PEP 8 recommendations about that, I believe, about like grouping stuff that comes from the library, from standard library versus externals and whatnot.

00:12:58.680 --> 00:12:59.080
Yeah.

00:12:59.080 --> 00:12:59.160
Yeah.

00:12:59.160 --> 00:13:00.940
And so you don't have to think about it.

00:13:00.940 --> 00:13:01.840
You can just use ISORT.

00:13:01.840 --> 00:13:05.660
Black also is becoming more and more popular, I think.

00:13:05.660 --> 00:13:08.500
Or it's just constantly very popular.

00:13:08.500 --> 00:13:12.580
Reform, it's all of your code, but it includes the import statements as well.

00:13:12.960 --> 00:13:17.660
So there was this issue that some projects wanted to use both ISORT and black.

00:13:17.660 --> 00:13:22.500
And there is, and they kind of fight with each other right out of the box.

00:13:22.500 --> 00:13:28.380
If you run ISORT, you'll have one answer and black will do something different in some cases.

00:13:28.740 --> 00:13:29.680
So what do you do?

00:13:29.680 --> 00:13:40.400
Well, there's black had a configuration page, and we'll link to this in the show notes, that has documents what settings you have to set for ISORT so that it's compatible with black.

00:13:40.840 --> 00:13:44.420
They also do that for FLAKE 8 and PILINT, which is nice.

00:13:44.420 --> 00:13:47.160
But FLAKE 8 and PILINT are not that complicated.

00:13:47.160 --> 00:13:50.740
It's the ISORT that's, there's like six settings you have to change.

00:13:50.740 --> 00:13:53.380
But ISORT 5 just came out.

00:13:53.380 --> 00:13:56.940
And ISORT 5 has what they call profiles.

00:13:56.940 --> 00:14:07.480
And so if you run ISORT with Profile Black, black is one of the built-in profiles, it will sort the imports such that they're compatible with black.

00:14:07.480 --> 00:14:08.420
Nice.

00:14:08.420 --> 00:14:16.820
So now if you use ISORT with the black profile and black, also they won't fight with each other anymore.

00:14:16.820 --> 00:14:18.280
That's very cool.

00:14:18.280 --> 00:14:21.920
Black also came out with some new changes.

00:14:21.920 --> 00:14:24.920
So if you're interested in black, check those out.

00:14:24.920 --> 00:14:27.220
They're not huge changes, but some minor fixes.

00:14:27.220 --> 00:14:29.600
The profile feature is pretty cool.

00:14:29.600 --> 00:14:33.180
And even if you don't care about black, I think you should check it out.

00:14:33.180 --> 00:14:41.320
They do, apparently, Django, PyCharm, Google, OpenStack, Clone, Adders, and Hug are other profiles that are included.

00:14:41.320 --> 00:14:47.380
And also, they're just good examples so that you can look at how different projects are configuring their ISORT.

00:14:47.380 --> 00:14:49.880
You can configure yours if you want.

00:14:49.880 --> 00:14:50.980
Yeah, I really like it.

00:14:50.980 --> 00:14:51.660
That's super cool.

00:14:52.100 --> 00:14:59.020
And it is nice to have the top of your files nice and clean and organized in some certain way.

00:14:59.020 --> 00:14:59.660
It's interesting.

00:14:59.660 --> 00:15:04.020
There's a lot of people do different linters or code reformatters.

00:15:04.360 --> 00:15:11.640
But this combination of ISORT plus black is something that's becoming more and more common in a lot of projects.

00:15:11.640 --> 00:15:11.920
Yeah.

00:15:11.920 --> 00:15:12.480
Yeah.

00:15:12.480 --> 00:15:13.300
Very cool.

00:15:13.300 --> 00:15:15.920
So I have something interesting for you.

00:15:15.920 --> 00:15:28.940
If you were to think of the influence of Microsoft Excel relative to the influence of, like, all of human genetics and the genome science of the world, and they got into a fight, who would win?

00:15:28.940 --> 00:15:30.140
Like a superhero.

00:15:30.140 --> 00:15:32.660
You seem like apples and oranges.

00:15:32.660 --> 00:15:33.380
I have no idea.

00:15:33.380 --> 00:15:35.460
Well, they did get into a fight, and Excel won.

00:15:35.460 --> 00:15:36.720
So here's the story.

00:15:36.840 --> 00:15:39.300
There's an article that was sent over by Chris Moffitt.

00:15:39.300 --> 00:15:44.800
He's the guy who wrote the Moving from Excel to Python and Pandas course over at Talk Python.

00:15:44.900 --> 00:15:48.680
So we did a bunch of research into, like, all these funny things and weird things around Excel.

00:15:48.680 --> 00:15:51.360
So he sent this one over, and I thought I'd cover it because it's fun.

00:15:51.360 --> 00:16:00.920
So on The Verge, there's an article that talks about how scientists have renamed human genes to stop Excel from misreading them as dates.

00:16:00.920 --> 00:16:02.860
Okay.

00:16:02.860 --> 00:16:03.560
Is that crazy?

00:16:03.560 --> 00:16:04.000
Yeah.

00:16:04.000 --> 00:16:04.460
Yeah.

00:16:04.460 --> 00:16:08.420
So you think it was just, like, formatting and stuff like that.

00:16:08.420 --> 00:16:17.140
So there's, like, tens of thousands of genes in the human genome, and each gene is given a name and a numerical code, and then you used to talk about it.

00:16:17.140 --> 00:16:22.560
So, like, this one controls, like, what color of hair you have or whatever, right?

00:16:22.560 --> 00:16:31.060
So over the past year or so, 27 human genes have been renamed all because Excel kept rereading them as symbols.

00:16:31.060 --> 00:16:32.160
They're symbols as dates.

00:16:32.160 --> 00:16:32.600
Okay.

00:16:32.600 --> 00:16:34.200
Well, the examples are important.

00:16:34.200 --> 00:16:34.600
Yeah.

00:16:35.080 --> 00:16:37.000
So, like, March 1.

00:16:37.000 --> 00:16:39.140
No spaces.

00:16:39.140 --> 00:16:42.080
March 1 is one of the genes, right?

00:16:42.080 --> 00:16:50.080
But it gets converted to 03 slash 01 slash the year, or if you're in Europe, 01 slash 03 slash the year, right?

00:16:50.080 --> 00:16:52.180
Either way, that's not what you wanted.

00:16:52.180 --> 00:17:02.000
So March 1 actually stands for membrane-associated ring CH-type finger 1, which, of course, is the first of March.

00:17:03.340 --> 00:17:06.380
Now, it sounds funny, and, like, we're making fun of, like, ah, whatever.

00:17:06.380 --> 00:17:20.020
There was a study in 2016 that examined the genetic data shared alongside 3,600 published papers and found that one-fifth of them, which, what is that?

00:17:20.020 --> 00:17:24.200
That's, like, 700 papers were affected by Excel errors.

00:17:24.200 --> 00:17:25.460
Oh, man, yeah.

00:17:25.580 --> 00:17:26.520
Isn't that messed up?

00:17:26.520 --> 00:17:33.900
So, there's a scientific body in charge of naming genes called Hugo Gene Nomenclature Committee.

00:17:33.900 --> 00:17:34.400
Who knew?

00:17:34.400 --> 00:17:36.340
There's a committee for naming genes, but apparently.

00:17:36.340 --> 00:17:43.420
So, they published new guidelines for naming genes, and they said, you have to consider what happens if you type into Excel.

00:17:43.420 --> 00:17:45.520
If it gets reformatted, that's not okay.

00:17:45.520 --> 00:17:46.980
Got to pick a new name.

00:17:48.660 --> 00:17:55.580
So, they put, like, weird suffixes and stuff on these things to make them work, like, March 1 is now, like, March 1 N1 or something like that.

00:17:55.580 --> 00:17:57.800
Anyway, so, why do I bring this up on the Python show?

00:17:57.800 --> 00:18:06.100
You know, so much of this work that people are doing there can totally be solved by Pandas and Jupyter Notebook and stuff.

00:18:06.200 --> 00:18:14.580
And so, you know, the guy who was quoted in there was like, hey, I made these mistakes when I was in grad school because all I knew how to use was Excel.

00:18:14.580 --> 00:18:28.160
So, here's a bit of an example along with a plea to help folks who are overusing Excel to take a step forward and use, you know, something like Pandas and Jupyter.

00:18:28.160 --> 00:18:33.280
And, you know, you're going to be able to do a lot more cool processing anyway, which I think is great.

00:18:33.280 --> 00:18:33.520
Yeah.

00:18:33.640 --> 00:18:50.080
Also, one other thing, if you think that geneticists have an exclusive right to these mistakes, there's a really cool article, blog post over on Oracle's blog, actually, called The 10 Costliest Spreadsheet Boo-Boos in History.

00:18:50.080 --> 00:18:52.080
And they're really hilarious.

00:18:52.080 --> 00:18:54.540
And, like, thank God this didn't happen to me.

00:18:54.540 --> 00:18:58.560
Well, and just, like, awesome stock photo that they have for this, too.

00:18:58.560 --> 00:19:00.500
Yeah, it's so bad.

00:19:00.500 --> 00:19:01.400
Yeah, it's, like, perfect.

00:19:01.400 --> 00:19:02.880
It could just come out of Excel.

00:19:03.520 --> 00:19:03.840
Yeah.

00:19:03.840 --> 00:19:03.920
Yeah.

00:19:03.920 --> 00:19:20.300
So, some of them are fairly mundane, but others, like MI5, the British Intelligence Agency, bugged over 1,000 wrong phone numbers because the 000 and the last three digits of the number got, you know, misstated.

00:19:20.300 --> 00:19:21.180
Oh, no.

00:19:21.460 --> 00:19:21.900
Yeah.

00:19:21.900 --> 00:19:21.900
Yeah.

00:19:21.900 --> 00:19:21.960
Yeah.

00:19:21.960 --> 00:19:22.100
Yeah.

00:19:22.100 --> 00:19:33.580
Or Eastman Kodak was forced to reinstate financial results for two quarters by from 2 million and 13 million respectively due to a spreadsheet mistake.

00:19:33.580 --> 00:19:37.780
Yeah, there's just all these crazy examples of stuff just going wrong.

00:19:37.780 --> 00:19:42.120
Like, oh, sorry, that was a billion dollar mistake because we were off by some random thing.

00:19:42.120 --> 00:19:44.160
Anyway, there's a bunch of errors like this.

00:19:44.160 --> 00:19:48.880
And it's really interesting to think how you might use the Python tools to not have these errors.

00:19:48.880 --> 00:19:49.240
Yeah.

00:19:49.820 --> 00:19:52.340
I think Excel has too much influence over the world.

00:19:52.340 --> 00:19:52.800
It does.

00:19:52.800 --> 00:19:57.920
But if you were going to use Python and you had a Jupyter Notebook, would you run it in your downloads folder?

00:19:57.920 --> 00:19:58.460
No.

00:19:58.460 --> 00:20:01.020
No, definitely not.

00:20:01.020 --> 00:20:07.040
Yeah, so this is another just kind of an interesting and shocking, wherever you think about it before.

00:20:07.040 --> 00:20:12.940
But Glyph has written an article called Never Run Python in Your Downloads Folder.

00:20:12.940 --> 00:20:15.000
It's not just about that.

00:20:15.000 --> 00:20:16.440
Okay, so there's your advice.

00:20:16.440 --> 00:20:18.080
Don't run Python in your downloads folder.

00:20:18.520 --> 00:20:26.880
But I think it's a good article to spread around and read because it's a nice short tutorial on how syspath works and how it's populated.

00:20:26.880 --> 00:20:32.180
So Python has this thing called syspath that is, that's where it looks up.

00:20:32.180 --> 00:20:39.560
So if you say import something or mostly that, where it's importing things, also the dash M or something.

00:20:39.560 --> 00:20:43.740
If you say dash M and then some module, where does it find that?

00:20:44.300 --> 00:20:45.960
And it finds it in lots of places.

00:20:45.960 --> 00:20:51.220
One is the normal system include directory or the system packages.

00:20:51.220 --> 00:20:53.300
But there's other places too.

00:20:53.920 --> 00:20:59.520
And one of the places where Python uses is the location you're in when you run Python.

00:20:59.520 --> 00:21:20.780
So a little example, he talks about a lot of people are now using, instead of running pip directly, they run python-m pip, which I also am including that in my advice usually, because I'm tired of trying to fix people's errors when their Python and their pip are pointing to two different places.

00:21:20.960 --> 00:21:21.960
That's frustrating.

00:21:21.960 --> 00:21:31.460
So what happens if you run python-m pip install something, some wheel in your downloads directory?

00:21:31.880 --> 00:21:34.780
Well, normally, everything's fine.

00:21:34.780 --> 00:21:45.960
Except if there's a malicious fake pip.py in your downloads directory that happens to have gotten there because somebody wrote some malicious JavaScript code, stick it there.

00:21:45.960 --> 00:21:47.260
It's possible.

00:21:47.260 --> 00:21:49.620
I don't know if it would happen, but it's possible.

00:21:49.620 --> 00:21:50.780
It's more likely now.

00:21:50.780 --> 00:21:52.340
Yeah, especially now.

00:21:52.340 --> 00:21:53.340
Thanks, Cliff.

00:21:53.740 --> 00:21:59.940
But then it's going to run that instead of the pip that you expect it to run, which is bothersome.

00:21:59.940 --> 00:22:00.840
So this is hidden.

00:22:00.840 --> 00:22:02.780
There's some extra advice in here.

00:22:02.780 --> 00:22:04.900
I encourage everybody to read the whole article.

00:22:04.900 --> 00:22:18.720
Understanding how the Python path variable works as well, because sometimes other applications will, and if the installer of an application can change things and change your Python path.

00:22:18.740 --> 00:22:21.980
It shouldn't, but sometimes they'll do that out of convenience.

00:22:21.980 --> 00:22:32.300
So occasionally look at your Python path and make sure that there's nothing weird in there, and maybe contact application developers or if they're doing something odd.

00:22:32.520 --> 00:22:36.700
If you are mucking with Python path, the recommendation is put absolute paths.

00:22:36.700 --> 00:22:38.520
Don't put anything relative in there.

00:22:38.520 --> 00:22:41.160
You want to be able to have complete control over that.

00:22:41.160 --> 00:22:49.500
The problem with the downloads folder is not that the downloads folder has weird permissions or higher permissions or anything of that nature.

00:22:49.500 --> 00:23:03.440
It's just that web virus maliciousness might, it's most likely to drop the payload there, and the Python path plus that operation or that aspect is what is likely to lead to trouble.

00:23:03.440 --> 00:23:03.700
Yeah.

00:23:03.700 --> 00:23:04.000
Right.

00:23:04.000 --> 00:23:08.880
Like you wouldn't say don't run it in your documents folder unless you copy virus Python files in there.

00:23:10.320 --> 00:23:10.760
Yeah.

00:23:10.760 --> 00:23:22.660
And the example was real of like sometimes, like let's say you're behind a firewall or something like that, and pip install just doesn't work, and you haven't figured out how to do proxies yet, and you really just need some package.

00:23:22.660 --> 00:23:24.740
You might just download the wheel somewhere.

00:23:24.740 --> 00:23:25.720
Okay.

00:23:25.720 --> 00:23:29.660
You might have that, and the wheel might be fine, but put it somewhere else.

00:23:29.660 --> 00:23:31.260
Don't leave it in your downloads directory.

00:23:31.260 --> 00:23:32.160
Put it someplace else.

00:23:32.160 --> 00:23:34.400
And please use virtual environments.

00:23:34.400 --> 00:23:35.820
That'll help things as well.

00:23:35.820 --> 00:23:36.060
Yeah.

00:23:36.060 --> 00:23:36.540
Absolutely.

00:23:36.540 --> 00:23:40.180
Good advice, and definitely another thing to be aware of.

00:23:40.180 --> 00:23:42.820
That internet, it's a scary place.

00:23:42.820 --> 00:23:45.380
Yes, but we love it.

00:23:45.380 --> 00:23:46.080
It's also a good place.

00:23:46.080 --> 00:23:47.800
It goes both ways, because we do love it.

00:23:47.800 --> 00:23:52.540
That's it for our main topics, but I do want to share two quick things, and they both have to do with the internet.

00:23:52.540 --> 00:23:57.320
Number one is we just passed 5 million downloads, Brian.

00:23:57.320 --> 00:23:57.960
Wow.

00:23:57.960 --> 00:23:58.660
That's awesome.

00:23:58.660 --> 00:23:58.940
That's awesome.

00:23:58.940 --> 00:24:04.680
Yeah, and we're in the top 150 or so of all tech podcasts in the world.

00:24:04.680 --> 00:24:08.760
So I just want to say thank you, everyone, that's helped to make that happen, because that's kind of a milestone.

00:24:08.760 --> 00:24:09.460
So that's really cool.

00:24:09.460 --> 00:24:10.100
Yes, thank you.

00:24:10.100 --> 00:24:10.360
Indeed.

00:24:10.360 --> 00:24:17.220
Also, I recently finally broke down and got a Wi-Fi mesh router.

00:24:17.220 --> 00:24:18.140
Routers?

00:24:18.140 --> 00:24:19.260
Can you say singular router?

00:24:19.260 --> 00:24:20.220
It's got to be plural, right?

00:24:20.220 --> 00:24:24.800
So one of those routers where it has a bunch of different stations, and they all work together.

00:24:25.200 --> 00:24:31.040
But because of the way it works, you don't actually have to connect to different ones at different places.

00:24:31.040 --> 00:24:32.360
It's just all one Wi-Fi.

00:24:32.360 --> 00:24:33.420
Okay.

00:24:33.420 --> 00:24:42.580
And man, I got this Linksys Wi-Fi 6 mesh router, which is quite pricey, but man, it is so, so awesome.

00:24:42.580 --> 00:24:46.260
So if people are suffering from being home all the time, they're like, gosh, I got to get better internet.

00:24:46.660 --> 00:24:54.340
My internet was actually pretty good here, but we started getting a ton of radio interference from different sources, and it would degrade it and stuff.

00:24:54.340 --> 00:24:58.820
So I have my recording area office above my garage.

00:24:58.820 --> 00:25:04.640
It's like a little studio apartment thing we built above the garage, which is a separate building across from the house.

00:25:04.640 --> 00:25:10.040
And over here, if I go speed test, I get 400 megabit measured off my Wi-Fi now.

00:25:10.240 --> 00:25:11.360
That is solid.

00:25:11.360 --> 00:25:14.960
Okay, so how far away are the mesh nodes?

00:25:14.960 --> 00:25:21.320
It's probably 50 feet, but it goes through several outside walls, through a couple inside walls.

00:25:21.320 --> 00:25:23.060
There's layers it's got to go through.

00:25:23.060 --> 00:25:30.000
But now with the mesh, I could put one of the nodes much closer to the wall that I'm close to that spans that gap between houses.

00:25:30.000 --> 00:25:30.420
Okay.

00:25:30.420 --> 00:25:32.400
And how are they talking to each other?

00:25:32.400 --> 00:25:37.700
They have their own channel, and they do some kind of back channel Wi-Fi 6 thing.

00:25:38.240 --> 00:25:40.600
So anyway, super good recommendation.

00:25:40.600 --> 00:25:40.920
Yes.

00:25:40.920 --> 00:25:41.960
How about you?

00:25:41.960 --> 00:25:43.300
Any extra stuff you want to share with the world?

00:25:43.300 --> 00:25:43.940
No.

00:25:43.940 --> 00:25:48.440
Just that I'm sort of sick of it and fires and all that sort of stuff.

00:25:48.440 --> 00:25:49.180
Yeah, man.

00:25:49.180 --> 00:25:51.120
It's looking a little smoky outside.

00:25:51.120 --> 00:25:53.300
And yeah, the whole West Coast.

00:25:53.300 --> 00:25:55.880
And my sympathies go out to the folks in Northern California.

00:25:55.880 --> 00:26:00.160
I just had a meeting with someone, and oh my gosh, is it smoky there.

00:26:00.160 --> 00:26:02.480
It looked like night in the daytime.

00:26:02.480 --> 00:26:07.740
In the background, I could see their window, and it was dark, as if they were in a different time zone.

00:26:07.740 --> 00:26:08.960
But they weren't.

00:26:08.960 --> 00:26:09.700
Not good.

00:26:09.700 --> 00:26:12.040
So hopefully that'll end soon.

00:26:12.040 --> 00:26:17.880
But before we end this episode, I got a question, Brian, for you.

00:26:17.880 --> 00:26:19.760
Are you a real programmer?

00:26:19.760 --> 00:26:20.960
Like a real one?

00:26:20.960 --> 00:26:21.580
Like a hardcore?

00:26:21.580 --> 00:26:24.080
I mean, you do C++, so that puts you a little closer.

00:26:24.080 --> 00:26:24.940
Oh my God.

00:26:24.940 --> 00:26:28.320
Imposter syndrome flares every time I get that question.

00:26:28.320 --> 00:26:30.000
So I don't think so.

00:26:30.100 --> 00:26:32.060
Let's go to XKCD and answer it.

00:26:32.060 --> 00:26:32.420
Okay?

00:26:32.420 --> 00:26:32.680
Okay.

00:26:32.680 --> 00:26:35.820
So XKCD has this cartoon called Real Programmers.

00:26:35.820 --> 00:26:42.220
And it starts with two people debating about what kind of editor they're using, right?

00:26:42.220 --> 00:26:44.120
It says there's somebody working.

00:26:44.120 --> 00:26:46.240
They're using Nano, the editor.

00:26:46.240 --> 00:26:48.660
And the person, come on, Nano?

00:26:48.660 --> 00:26:49.420
For real?

00:26:49.420 --> 00:26:51.260
Real programmers use Emacs.

00:26:51.880 --> 00:26:53.060
And then Brian walks in.

00:26:53.060 --> 00:26:55.040
Hey, real programmers use Vim.

00:26:55.040 --> 00:26:55.600
Come on.

00:26:55.600 --> 00:26:58.280
Oh yeah, well, real programmers use Ed.

00:26:58.280 --> 00:27:01.460
No, no, real programmers use Cat and just stick it on the end.

00:27:01.460 --> 00:27:05.140
Real programmers use a magnetized needle in a steady hand.

00:27:05.140 --> 00:27:08.620
Excuse me, but real programmers use butterflies.

00:27:09.620 --> 00:27:11.100
Everyone turns and looks at the person.

00:27:11.100 --> 00:27:15.060
They open their hands and they let the delicate wings flap once.

00:27:15.060 --> 00:27:20.180
The disturbance ripples outward, changing the flow of the eddy currents in the upper atmosphere,

00:27:20.180 --> 00:27:25.760
which acts as a lens that deflects incoming cosmic rays, focus them to strike the derived platter

00:27:25.760 --> 00:27:27.060
and flip the desired bit.

00:27:27.060 --> 00:27:28.300
Nice.

00:27:28.300 --> 00:27:31.020
Of course, there's an Emacs command to do that.

00:27:31.020 --> 00:27:32.400
Oh yeah?

00:27:32.400 --> 00:27:33.040
Yeah.

00:27:33.040 --> 00:27:36.040
Command X, Command M, Command Butterfly.

00:27:39.300 --> 00:27:39.860
Nice.

00:27:39.860 --> 00:27:40.840
Yeah.

00:27:40.840 --> 00:27:41.320
Yeah, yeah.

00:27:41.320 --> 00:27:45.440
CXCMCM Butterfly.

00:27:45.440 --> 00:27:45.800
Indeed.

00:27:45.800 --> 00:27:47.480
Damn it, Emacs, they say.

00:27:47.480 --> 00:27:50.000
Does anybody use Emacs?

00:27:50.000 --> 00:27:50.400
Yeah.

00:27:50.400 --> 00:27:53.420
Well, I don't know, but I'm not a real programmer because I don't use butterflies.

00:27:53.420 --> 00:27:54.000
I'm sorry.

00:27:54.000 --> 00:27:55.400
No, I don't use butterflies.

00:27:55.400 --> 00:27:56.540
Okay.

00:27:56.540 --> 00:27:57.960
Well, we're in the joke section.

00:27:57.960 --> 00:28:00.720
I got to share a terrible joke that my wife came up with.

00:28:00.720 --> 00:28:01.000
You wait.

00:28:01.000 --> 00:28:01.420
Okay.

00:28:01.420 --> 00:28:03.460
99 bottles of beer on the wall.

00:28:03.460 --> 00:28:04.720
99 bottles of beer.

00:28:04.720 --> 00:28:05.760
Take one down.

00:28:05.760 --> 00:28:06.620
Pass it around.

00:28:06.620 --> 00:28:08.080
Now everybody's infected.

00:28:08.080 --> 00:28:09.060
Morons.

00:28:09.060 --> 00:28:15.000
Hey, that sounds like college here in the US.

00:28:15.000 --> 00:28:16.300
I think that's what they're doing.

00:28:16.300 --> 00:28:18.040
I'm going to tell from all the news I'm watching.

00:28:18.040 --> 00:28:18.840
Oh my gosh.

00:28:18.840 --> 00:28:19.720
Jeez.

00:28:19.720 --> 00:28:20.140
Sorry.

00:28:20.140 --> 00:28:20.460
Yeah.

00:28:20.460 --> 00:28:23.160
These jokes are the 2020 jokes.

00:28:23.160 --> 00:28:23.740
Oh yeah.

00:28:23.740 --> 00:28:25.680
So this won't make sense in the future.

00:28:25.680 --> 00:28:26.040
Yeah.

00:28:26.040 --> 00:28:26.360
Yeah.

00:28:26.360 --> 00:28:26.580
Yeah.

00:28:26.580 --> 00:28:32.380
So in the future, when you speak to a historian and you say, oh, you're a historian.

00:28:32.380 --> 00:28:33.280
What do you study?

00:28:33.280 --> 00:28:37.040
Oh, I actually study the year 2020.

00:28:37.540 --> 00:28:38.800
Like that won't be enough.

00:28:38.800 --> 00:28:40.980
You have to say, well, which part do you study?

00:28:40.980 --> 00:28:42.560
Like the beginning?

00:28:42.560 --> 00:28:45.660
Do you study the financial crash?

00:28:45.660 --> 00:28:47.040
Do you study this crazy election?

00:28:47.040 --> 00:28:48.500
Do you study the pandemic?

00:28:48.760 --> 00:28:52.560
Like you got to be like 20, that year is not enough to say what your specialty is.

00:28:52.560 --> 00:28:53.340
You got to pick one.

00:28:53.340 --> 00:28:54.300
Pick a quarter.

00:28:54.300 --> 00:28:55.300
Yeah.

00:28:55.300 --> 00:28:56.340
It's a crazy time, right?

00:28:56.820 --> 00:28:58.260
I study the flyers.

00:28:58.260 --> 00:28:59.420
Oh boy.

00:28:59.420 --> 00:28:59.920
Anyway.

00:28:59.920 --> 00:29:02.360
Well, good talking with you as always.

00:29:02.360 --> 00:29:03.000
You as well.

00:29:03.000 --> 00:29:03.520
Catch you later.

00:29:03.840 --> 00:29:05.440
Thank you for listening to Python Bytes.

00:29:05.440 --> 00:29:07.960
Follow the show on Twitter via at Python Bytes.

00:29:07.960 --> 00:29:10.820
That's Python Bytes as in B-Y-T-E-S.

00:29:10.820 --> 00:29:14.060
And get the full show notes at pythonbytes.fm.

00:29:14.060 --> 00:29:18.260
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:29:18.260 --> 00:29:20.960
We're always on the lookout for sharing something cool.

00:29:20.960 --> 00:29:24.080
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:29:24.080 --> 00:29:27.500
Thank you for listening and sharing this podcast with your friends and colleagues.