Transcript #136: A Python kernel rather than cleaning the batteries?
Return to episode page view on github00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:05 This is episode 136, recorded June 19, 2019.
00:09 I'm Michael Kennedy.
00:10 And I'm Brian Okken.
00:11 And this episode is brought to you by Datadog.
00:13 Check them out at pythonbytes.fm/datadog.
00:15 Get a cool shirt.
00:16 More on that later.
00:17 Brian, how you been?
00:18 I am doing well.
00:19 Good, good.
00:20 Same here.
00:21 Rolling into summer.
00:22 Kids are home.
00:23 Working from home is now chaos, but it's all right.
00:26 Yeah.
00:26 It's a little cooler today, too.
00:28 It's nice.
00:28 Yeah, it's beautiful.
00:30 So you've got some kind of magic trick lined up for us for this first thing?
00:33 What's going on here?
00:33 Well, actually, I think it's just going to be me trying to pronounce a French word.
00:39 So I think, is it, I know it's not voila.
00:42 Voila?
00:43 Voila?
00:44 Do you pronounce the V?
00:45 I don't know.
00:46 Voila.
00:46 I think so.
00:47 Voila?
00:47 Viola.
00:48 No.
00:48 No.
00:49 Voila is a new project.
00:53 It's a newly announced project from the Jupyter Notebook people.
00:56 Cool.
00:57 So the idea is Jupyter Notebooks in standalone applications or dashboards.
01:01 So people that are used to working with notebooks and they want to share what they found with other people and you want to have people be able to interact with it and have it be a little bit interactive, but not allow people to change your code.
01:16 How do you do that?
01:17 That's where Voila steps in.
01:20 It's a pretty cool project.
01:22 I was playing around with it a little bit.
01:24 You can have custom, or at least reading about it, custom widgets to set up your page and even like templates and grid layouts.
01:32 But you don't have to be a web developer.
01:33 It's like drag and drop stuff.
01:35 This is cool.
01:35 I like the idea of presenting the interactive plots and graphs and stuff and also being able to have people be able to run the code and do selectors and things, but not let people change the code.
01:48 So that's pretty cool.
01:50 Yeah.
01:50 You just take your notebook and you just turn it into a web application.
01:53 That's pretty awesome.
01:54 And it has nice restrictions like does not permit execution of arbitrary code by consumers of the dashboard.
02:01 It's language agnostic.
02:03 So you could have C++ code up there in addition to Python or whatever, you know, Jupyter does.
02:07 That's pretty sweet.
02:08 Yeah.
02:08 I could see a lot of people using this, even for dashboards for like peeking into databases and stuff.
02:14 Nice.
02:14 So Voila, and you have a website.
02:16 Voila.
02:16 I have a Jupyter notebook and here it is.
02:20 Cool.
02:20 Awesome.
02:22 I don't think we covered this.
02:24 I kind of tried to sort of intentionally didn't want to go too far into it because it didn't seem super productive, but there was a presentation back at the language summit called Python, something like cleaning up Python's dead batteries or something to that effect.
02:38 Did you catch that?
02:39 Yeah.
02:40 So the idea was there are some modules and parts of Python that are outdated.
02:46 Their existence puts pressure on the core developers in ways that doesn't let them focus on what they need to be doing.
02:53 It also makes it super hard for people to contribute.
02:56 Like, for example, there's a color sys module in Python in the standard library.
03:01 I'm going to pick on this thing a lot during this little segment.
03:04 And it has the very important purpose of converting CSS colors between coordinate systems.
03:12 Super important to have that in the standard library, right?
03:15 I don't know.
03:17 Maybe, maybe not.
03:18 At one point, you know, Python standard library was really the goal of it was to come with everything you need because installing extra stuff like downloading it, getting it, like running the setup and all that was really tricky.
03:30 Right?
03:31 Now everything's pip install one away.
03:33 So, like, it looks a little bit weird.
03:36 And if, say, you wanted to fix or change the color sys module, it's not the same as if you want to go contribute to some random thing on GitHub.
03:43 No, you've got to be a core developer.
03:44 There's a lot of steps that go through this.
03:47 It only ships every 16 months, or sorry, 18 months for new content and new things, changes.
03:53 So, how much do you really care to make a contribution or change to color sys?
03:57 Right?
03:58 Probably not very much for all those reasons, right?
04:00 It's slow on purpose.
04:01 It's hard to make changes to and so on.
04:04 But the problem is, like, it has things like color sys that probably don't make a lot of sense to be there anymore.
04:10 So, Amber Brown and some other folks were making a case that maybe we should take some stuff away.
04:17 And it was pretty controversial.
04:19 There was some, like, heated disagreements at the actual presentation and stuff.
04:23 And I don't care about that.
04:24 I don't want to go into it.
04:25 But that approach was, we have stuff in Python that maybe shouldn't be there.
04:30 Let's talk about what we can take out.
04:33 And Glyph wrote a cool article called Toward a Kernel Python.
04:40 And I've talked about this before.
04:41 I don't know if I talked about it on Python Bytes or on Talk Python.
04:44 But I think there should be some kind of subset of Python that is defined to be, like, the minimum subset of Python that is guaranteed to be everywhere.
04:55 So, for example, if you work with PyPy, you get one variant of mostly Python.
05:01 If you work with CircuitPython or MicroPython, you get another variant of mostly Python, but not all of it, right?
05:07 Yeah.
05:08 If you work with Python or some of the JavaScript versions that run in the browsers, again, similar subset but not the same.
05:17 So, if we had, like, a smaller sort of essential Python standard language definition and library that was, like, I don't know what's the right number, but a smaller amount that you could guarantee was identical across all those platforms.
05:32 And then opt in to bringing the other stuff in.
05:34 So, Glyph's main idea was, like, could we say, instead of, like, take what we have and hack away a few things that don't make sense, rather trim it down to this kernel, to this essence.
05:45 And then, I don't know, pip install the rest of the libraries or something like that, the rest of the standard library.
05:51 You want the networking stack, you pip install networking.
05:53 I don't know.
05:54 Like, I'm just making up parts that we would do that for.
05:57 But that was his idea, that basically there's a PEP, PEP594, that's about removing, obviously, obsolete and dead stuff from the standard library.
06:05 And that's all well and good.
06:07 But it actually turns out that having things like ColorSys in the standard library mean that the core devs have to deal with a bunch of stuff.
06:16 So, he runs Twisted.
06:18 So, he talks about, like, how is Twisted doing on keeping up with PRs?
06:21 And let's look at CPython over there.
06:23 And they have 429 tickets currently awaiting review over on GitHub.
06:29 I think it's in GitHub.
06:30 It says the oldest PR awaiting review hasn't been touched since February 2nd, 2018.
06:36 It's almost 500 days old.
06:38 But when you look at it, the PRs, there's 25 PRs that are out on address or whatever.
06:46 14 were about the standard library and 10 were about CPython.
06:49 So, why are the core devs having to deal with this stuff when there's typically a replacement?
06:54 Like, there is a built-in HTTP library, but people just use requests or AIOHTP or whatever, right?
07:00 Like, there should be a way to maybe create this essence of it and then bring more in.
07:05 What do you think?
07:06 I definitely think there's an idea there.
07:08 Like you said, there's kind of like a Venn diagram.
07:12 There's a common set that most people need or you'll need for lots of different domains.
07:17 But then for a web domain, for web stuff, you're going to need different stuff than for, like, working with audio files or working with text files.
07:28 Or the different problem domains are going to use different bits and you don't need everything else.
07:33 Yeah.
07:33 Interesting idea.
07:34 The install, the how do beginners install stuff is an interesting, how do you deal with that, though?
07:42 Yeah, absolutely.
07:43 And he does address that.
07:44 And I do think it is a challenge.
07:47 He says, look, probably the stuff you go get when you download off python.org or you brew install Python, that probably should just be everything, right?
07:57 But it doesn't mean that it can't be comprised of smaller things that potentially ship on a different schedule.
08:04 If you're going to install, like, Visual Studio or something like that, you always have options of, do you want to install this stuff and this other stuff also?
08:11 Yeah.
08:11 You can opt out.
08:12 And we could do something similar to that with Python of, like, do you want to install the web stuff?
08:18 Do you want to install the audio stuff and whatever?
08:21 Right.
08:21 You could have these full distributions that you install.
08:24 But if you look at, say, Linux, for example, if you go to an empty Ubuntu machine and you try to create a virtual environment, depending on the version you have, it may not work.
08:33 You may get an error that says, you need to apt install Python 3-venv.
08:39 It's like, wait, that part of Python wasn't shipped?
08:42 Okay, well, we'll do that.
08:43 Or if you try to even pip install something, it might say, you might have to apt install Python 3-pip, right?
08:49 So they've already done this on Linux.
08:51 There's other examples as well.
08:53 For example, the .NET Core in the Microsoft space basically is like this, right?
08:59 Like, you use their package management system to bring in, like, significant parts of what is their standard library.
09:06 Yeah.
09:06 I do think it's a problem for beginners.
09:08 I think it makes it harder, right?
09:10 It's like saying, well, we just run JavaScript over in Node and it's easy.
09:14 But then you see all this require.js and all these, like, patterns.
09:17 You're like, why is this so hard?
09:19 What happened to print hello world?
09:20 You know, like, I do think there's a danger.
09:22 But if the standard way that people get Python is they get this big bundle, but maybe those bundles are not all maintained by the same team, which is the core developers, right?
09:34 And then, like, what can we hack out of the system?
09:50 Could we hack out ColorSys?
09:52 Yes or no?
09:52 Let's talk about that.
09:53 Well, right.
09:53 And also, just there's some stuff, like ColorSys, it's surprising that it needs to be there.
09:58 And then there's stuff that's not in the core or in the standard library that, like, why is that not there?
10:03 Like, set up tools and wheel.
10:05 I'm always surprised that I have to pip install wheel to create a wheel.
10:09 Yeah, and speaking of pip, Cliff did mention that when you get Python, it comes with pip.
10:14 Like, installing Python lets you type pip install a thing.
10:17 But pip is actually maintained by a different group and shipped on a different cycle, right?
10:22 That's PyPA, not the core developers, for example.
10:25 So, it's like that a little bit.
10:26 But if it was more like that, you could make a change.
10:29 You could join the team for, I don't know, the networking or ColorSys or whatever you want, work on that, and maybe push changes more rapidly than the core CPython runtime.
10:40 Right.
10:40 We could do something like the PyPA, but do, like, the Python standard library authority or something like that.
10:46 Yeah, exactly.
10:46 It's a pretty interesting idea, and it definitely seems better than, seems more like the outcome will be better than trying to just hack away at a few dead batteries.
10:54 If you will.
10:55 Yep.
10:55 Cool.
10:56 This next one that you're talking about, I recently ran into this as an error.
11:00 I'm like, wait, what did I type wrong?
11:01 And then I realized, this might be a cool feature.
11:03 Why don't you tell people about this?
11:05 Like, for instance, with pytest, it comes as a standalone script.
11:09 You can say, you can just write pytest on the command line.
11:12 But you can also say Python-M pytest.
11:16 And a lot of pip installable things, you can do that.
11:19 You can say –M, the thing name, and it works.
11:23 I didn't know how to do this, actually.
11:25 I never really thought, how do I do this, and how do I figure it out?
11:28 And all it is to put a Dunder main file in your project.
11:32 I didn't know it was that easy.
11:34 So I'm linking to an article that pretty much says, we use the convention of if Dunder name equals Dunder main, then run the main program or something.
11:44 But you can use the Dunder main.py file itself in your project.
11:49 And that dash M thing just works.
11:52 And that's pretty simple, right?
11:53 I'm like, it can't really be that easy.
11:55 So this morning, I did a little flip project, a flip-based project.
11:59 And then threw a Dunder main in there with just a print statement and installed it and went somewhere else.
12:06 And sure enough, it works just awesome.
12:08 So neat.
12:09 Yeah, that's super cool.
12:10 Yeah, I ran across this by accidentally saying Python and saying run a directory instead of a file.
12:18 I'm like, oh, it said it couldn't find Dunder main.
12:21 I'm like, .py.
12:22 I'm like, wait, it was looking for it?
12:24 That's pretty cool.
12:25 Maybe there's something to be done here.
12:26 Yeah, that's great.
12:27 I'm glad you pointed it out.
12:27 If you have a Dunder main in there, you can just say Python and the directory name and it works?
12:33 I have not verified that, but it seems like the error message would indicate that it might work.
12:39 Yeah, I mean, it was like a full path.
12:40 It wasn't just a standard directory either.
12:42 Okay.
12:43 Yeah, so pretty cool.
12:44 Neat.
12:44 I don't know how useful it is to people, but I'll run across it every once in a while.
12:48 Yeah, that and entry points always really nice.
12:51 Now, speaking of nice, Diddy Dog is supporting our show and they got some nice products.
12:55 So let me tell you about them really quickly.
12:56 And so they're a cloud scale monitoring platform that unifies metrics, logs, traces, all that kind of stuff.
13:03 Monitors your Python apps in real time.
13:06 Helps you find bottlenecks with detailed flame graphs, trace requests as they cross over service boundaries.
13:13 All right.
13:14 So if you have microservices, you're talking to database or queuing, things like that.
13:17 Plus, it also does automatic instrumentation for popular frameworks like Django, AsyncIO, and Flask.
13:25 So you can quickly get started without too much setup.
13:27 So get started today.
13:29 There's a 14-day free trial at pythonbytes.fm/datadog.
13:33 And you get a cool Datadog t-shirt, which is always fun.
13:36 Thanks for that, Dom.
13:37 Mine's a nice purple color.
13:38 And my kids always comment when I wear it.
13:40 They like the shirt.
13:41 Yeah, I love it.
13:42 So this next one I want to talk about, the name might sound a little derogatory, but it's not really meant that way.
13:47 So maybe simplistic sounds better.
13:50 But the thing I want to talk about is this article by Chris Wellens entitled, The CPython Byte Compiler is Dumb.
13:56 Simplistic is maybe better.
13:59 But what you might not know, depending on how much you dig into it, is there's excruciatingly small amounts of optimization when CPython runs your code.
14:11 So there's a compilation step, actually, right?
14:14 The bytecode and compiler talks about some kind of compilation.
14:16 So when you run your code, you probably see the Dunder PyCache folders.
14:20 And in there you have the PYC files.
14:22 So that's taking your source code, turn it into bytecode, and put it there.
14:25 But then instead of, say, compiling that onto machine instructions, the interpreter takes that, feeds it through this ginormous switch statement that's like 3,000 lines long in the CPython runtime.
14:37 And it just goes, well, what case is this?
14:39 We're jumping to that, right?
14:40 It's pretty wild.
14:41 There's a file called cval.c.
14:43 Check it out.
14:43 However, there's very little optimization that happens here.
14:48 So Chris decided to compare this against Lua and one other similar, maybe Ruby.
14:53 I can't remember what the other one that he compared it against was.
14:55 But he talked about, you know, like, if I write this code, what happens to it?
15:00 So there are optimizations like what are called peephole optimizations and a few memory allocation optimizations in CPython.
15:07 But they're pretty limited.
15:10 So if you look at some examples, like let's take an example where we have a function.
15:16 It's called foo.
15:17 Defines two variables.
15:18 X equals zero.
15:19 Y equals one.
15:21 Return X.
15:22 That seems simple, right, Brian?
15:23 Yeah.
15:24 Except for Y is not needed.
15:25 But yeah, sure.
15:26 Exactly.
15:26 So when you see that, if Y is unused and this is not making any change, it's just literally creating a variable which is effectively an entry in, you know, like a module name lookup or a locals lookup, right?
15:38 Like, why does that need to be done?
15:41 Doesn't seem like a whole lot's happening.
15:43 So for example, the CPython bytecode compiler could just go, well, forget that line.
15:48 And it could say, well, X never changes its value.
15:51 So why don't we just inline that to say, basically, the whole function is return zero, right?
15:58 Inline the X, drop the Y.
16:00 It's good to go.
16:01 But if you go and throw that into the disassembler, you'll see that, no, that's not what happens.
16:07 It literally just takes it step by step by step.
16:10 Okay.
16:10 Wild, right?
16:11 So it loads the constant.
16:12 It stores it into a field called X.
16:14 It loads the constant.
16:15 It stores into a field called Y.
16:16 Then it loads the constant again, the value for X again.
16:20 And then it calls return val as the bytecode instructions, right?
16:23 Instead of just load constant zero, return value, right?
16:26 Like, it could be a lot quicker.
16:28 So I find that this is, it's honestly a little bit surprising.
16:32 I mean, Python is 25 years old and it doesn't take steps like this.
16:37 Now, Darius Beacon did point out that Guido himself said Python is about having the simplest,
16:44 dumbest compiler imaginable.
16:46 And there's some links to that.
16:47 So some references there if you want to go check that out.
16:50 So I think, you know, maybe it's by design to keep it simple.
16:53 It's easy for people to contribute to.
16:56 But it certainly seems like there could be a layer, like, between parsing the bytecode and executing the bytecode that says,
17:04 we're not running into debugger or something like that.
17:07 So let's go crazy and, like, just, you know, convert stuff like that to return zero.
17:12 There's also a bunch of other interesting examples in there.
17:15 This is just one that's really obvious that's good for talking that I pulled out.
17:18 And optimization levels is something that CS people have been doing with compilers for a long time.
17:24 So it's not like we'd have to invent it ourselves.
17:26 Right.
17:27 Yeah, yeah.
17:28 C has had plenty of it.
17:30 C#, the JIT compiled languages, their JIT compiler is a place where a lot of that happens.
17:35 Things like this, right?
17:36 Did you say that there was a comparison to other languages?
17:39 Do other languages do more optimization?
17:42 No, not really.
17:43 They're all pretty much the same.
17:46 For better or worse, they're all the same.
17:49 So there's an interesting point that he makes that I do want to, like, just comment on real quick.
17:53 It says, so the consensus seems to be that if you want or need better performance, don't use Python.
18:00 Go use another language.
18:02 I'm like, dude, no, you were, like, so close.
18:04 You were so close as well.
18:05 You could use, maybe don't use CPython, right?
18:08 Maybe use PyPy, P-Y-P-Y.
18:10 But the most obvious optimization to me that just can change the game is Cython.
18:17 Yeah.
18:17 You could write, like, one or two slow functions in Cython, and boom, it goes to machine instructions, and it's, you know, it nears the speed of C.
18:24 So I like the article.
18:26 I don't like that it says, oh, if things are a little bit slow, just run away.
18:30 Like, no, there's probably a package that has a C extension that already works better.
18:33 Or, you know, there's a data structure you should be using that would be better.
18:37 Or there's Cython or, you know, on and on.
18:40 There's a lot of improvements before Python's not the answer.
18:43 Or be aware that this is doing this and do your own optimization.
18:47 And for the most part, use a profiler and really tell where the optimization needs to be.
18:53 Exactly.
18:53 Like, only 10% of your code needs to be fast at all, if that much, most of the time, right?
18:58 It's usually, like, one little bit, like, oh, if this were faster, it would change the game.
19:03 Yeah.
19:03 I mean, I learned assembly in college, and I'm glad I've never had to use it.
19:08 For sure.
19:11 So, final comment here.
19:13 Brett Cannon, when I interviewed him recently, you know, he's on the steering council, core developer, and so on.
19:19 He did talk about, you know, how would adoption of Python 3 change?
19:24 How would adoption of Python in general change if we could make Python two or four times faster than it is today?
19:31 Like, most of the time, it doesn't matter.
19:32 But if it could be faster in some interesting ways, what would that mean, right?
19:37 In terms of upgrading more quickly to the new versions and just general, like, people not saying, oh, I have to use Go because I need AsyncIO or something like this.
19:45 So, it seems like if the compiler is this absent, if optimizations are this absent from the compiler, like, there's some low-hanging fruit to, like, do some simple CS compiler optimizations and make stuff faster, right?
20:00 I mean, you could make this silly foo method, like, probably three times as fast, right?
20:05 Because you could drop most of the bytecode operations.
20:07 Yeah, definitely.
20:09 It's worth looking at.
20:10 It's interesting that there is some people thinking about performance.
20:14 Yeah.
20:15 I mean, we had that conversation around the idea of Rust and maybe what if we used Rust instead of C in certain situations.
20:22 But, like, this seems like low-hanging fruit already right here.
20:25 And regardless of whether it lands in Rust or C, when it's executed, not executing code is a lot faster than executing it.
20:32 Yeah.
20:32 Cool.
20:32 What's the next one?
20:33 EdgeDB is something that came up on my radar a couple years ago.
20:38 I saw the EdgeDB people had a booth at one of the PyCons, and they were talking about it, but at the time, it wasn't around for people to actually play with.
20:48 So the other day, I saw an article called A Path to a 10x Database put out by the EdgeDB people.
20:55 One, there was a download link, which I was happy for.
20:59 There's an alpha one available.
21:01 And people that are following along and are kind of excited about what they're doing, they've published a roadmap of the features they have done, what they're working on.
21:10 And it's kind of cool.
21:12 I'm looking forward to being able to play with it more.
21:15 So people that don't know what it is, they call it a next generation relational database.
21:19 It's based on Postgres.
21:22 I don't know what that means if they're using Postgres or if they're used the design of Postgres as a base.
21:28 I haven't dug that far.
21:29 But it features a different kind of data model and an advanced query language.
21:35 And there are a whole bunch of features built into it already, and I'm pretty excited about a lot of it.
21:40 But the thing that really excites me is that they completely replaced SQL, the query language.
21:45 It's a different kind of language, and it looks more natural to me.
21:49 I mean, people aren't really writing SQL a lot of times because they're using SQLAlchemy or something like that.
21:59 And partly, those things exist because people don't want to write SQL.
22:03 But maybe if we had a better query language, we wouldn't need the middle layer so much.
22:08 Yeah, it definitely looks interesting.
22:09 I don't have a real good sense of how it compares to both of those.
22:14 The query syntax does look nice.
22:16 The joins look super cool, or the subqueries possibly is more like an analogy.
22:23 But yeah, it looks really neat.
22:25 It sort of sells itself as a hybrid between document databases like Mongo and relational ones like Postgres.
22:32 So yeah, it's cool to see innovation there for sure.
22:35 Outside of Mongo, seeing some innovation on the SQL side or the relational side is nice.
22:41 We'll see if it's really a 10x improvement.
22:45 But yeah, we can't just stick around for nothing.
22:47 I did actually try to play with it because I'm like, I want to play with this because it's got Python bindings.
22:51 But I couldn't get it to install on my Mac.
22:54 So yeah.
22:55 Yeah, well, would you have to suffer for being out on the cutting edge, Brian?
22:59 Price you pay.
23:00 Yep.
23:01 All right.
23:02 So this last one is going to be just a quick roundup of some stuff.
23:05 Then maybe this combo will help some folks.
23:07 This guy, Wakwas Jonas, worked for a software, sorry, healthcare startup in the US.
23:16 And he wrote this cool blog post called 16 Python Libraries that Helped a Healthcare Startup Grow.
23:22 Oh, neat.
23:23 Yeah.
23:23 So it's just like a paragraph or two about different packages or even modules that they use to kind of solve some problem within their startup.
23:32 So we have Paramiko, which lets you basically issue commands over SSH to other servers.
23:39 So like on my computer, I could like use Python and talk over SSH to run processes or copy files, stuff between servers.
23:48 Anything I can SSH to.
23:49 That's pretty cool.
23:50 The built-in CSV module.
23:52 You know, that's always good for parsing CSV files.
23:56 Really nice.
23:57 You mentioned SQLAlchemy.
23:58 So they use SQLAlchemy as well, requests and beautiful soup for APIs and web scraping.
24:04 I like to say that every website is an API, even if it doesn't know it.
24:09 So if it doesn't have an API, it has data and you just have to do the right request to it.
24:14 Now it's an API.
24:15 Here's one for you, Brian.
24:16 Test scenarios, which is a PyUnit extension for dependency injection.
24:21 So that's kind of cool.
24:23 Dependency injection is not that huge of a thing that people make use of in Python, but, you know, it has its place, I guess.
24:30 Yeah.
24:30 HL7.
24:30 So a simple library for parsing health level 7 files into Python objects.
24:37 That's cool.
24:38 I suppose like doing that yourself probably is not fun.
24:41 So having a library that does it is great.
24:43 Python phone numbers, which is a library for parsing, formatting, and validating international phone numbers.
24:49 That's pretty sweet.
24:50 It's based on a Google library.
24:51 It's like a Python port of it.
24:53 G event for networking and asynchronous code.
24:56 Python dash date util for parsing date times.
25:00 Like anytime I have to work with date times, I'm like, okay, this project now requires Python dash date util because parsing date time sucks without it, right?
25:09 But this one you just say pars and like that right answer just seems to always come out as great.
25:13 So Matt Plotlev for graphs.
25:15 Python magic.
25:16 Have you heard of Python magic?
25:18 I don't know.
25:19 I hadn't.
25:20 And so what you can do is you can give it a file, some random binary file or even text file, and it'll tell you what file type it is.
25:27 Oh, neat.
25:27 So like suppose somebody gives you an image and they've named it .jpg, but it's really a PNG.
25:32 Like you could feed it something to something like Python magic.
25:36 It would say PNG.
25:36 So you can give it like PDFs or zip files, and it'll tell you like what file it is.
25:42 Okay.
25:43 But magic?
25:44 That seems like a bad name for it.
25:46 But yeah.
25:47 It's Python magic.
25:48 Well, I mean, the reason is it's based on a thing called lib magic.
25:51 But yeah.
25:52 It's just like the criticism just transitively follows to lib magic, I guess.
25:56 All right.
25:58 Another one.
25:59 Django.
25:59 Obviously, that doesn't need a lot of introduction, but yeah, they must use Django.
26:02 Bodo, which is the API for interacting with all things AWS.
26:06 So if you're doing anything with that, that's super cool.
26:09 Like I use Bodo for automatic transcoding, like re-encoding in different formats, videos for my courses, or downloading, say, MP3s to a caching server, stuff like that.
26:21 And then finally, Mailgun for sending email, and Twilio's Python API for sending, both of those were sending reminders, one over email, one over text.
26:28 But it's kind of a cool combo of things, right?
26:31 Mailgun's just a great name.
26:33 We've been starting to use Paramount at work, too, but for the SSH features.
26:38 It's good.
26:39 Oh, yeah.
26:39 Nice.
26:40 Yeah, I feel like this, you know, you don't necessarily have to pick what he picked, but it's cool to see how those all fit together and think of like, well, what packages run this company, basically.
26:50 Articles like this are neat of different people solving different problems.
26:54 What are they using from Python?
26:56 Yeah, exactly.
26:57 Like it.
26:57 All right.
26:58 So that's it for our main items.
26:59 Got any extras you want to share with us?
27:01 No.
27:02 Do you?
27:03 I thought I didn't, but I'm going to share one thing with you all.
27:05 I just recorded an episode with the United States Digital Service for Talk Python.
27:11 Okay.
27:12 What is that?
27:13 I hadn't heard of that either.
27:14 But this is like a little stealth startup type thing inside the government.
27:18 President Obama set it up and it was basically the tech team brought in to solve the healthcare.gov crashing problems like that whole big fail to launch for the Obamacare stuff.
27:29 There was a group of people brought in to fix it and then they did.
27:32 They're like, well, why can't we just apply this to all the other broken things in the government?
27:35 So it's a really cool service where like you can go do like a three month tour of duty at the U.S. Digital Service and like not even have to leave your job.
27:45 Just take a like unpaid leave to go fix something in the government or whatever.
27:48 It's pretty cool.
27:49 I have an episode coming out, but I hadn't heard of it and I thought that was kind of cool.
27:52 So I thought I'd throw it out there.
27:53 Yeah, this is neat.
27:54 It is for sure.
27:56 I have a, it's almost a joke.
27:58 It's not exactly a joke.
27:59 It's more maybe mocking, but how can you tell the difference between machine learning and AI, Brian?
28:06 I don't know.
28:07 If it's written in Python, it's probably machine learning.
28:11 If it's written in PowerPoint, it's probably AI.
28:13 What?
28:14 Written in PowerPoint?
28:17 Like as in it's just like a presentation with ideas, but no code and no implementation yet.
28:22 Oh, okay.
28:23 Yeah.
28:23 Okay.
28:24 Got it.
28:24 So basically if it's real, it's machine learning.
28:27 If it's, if it's like, we're going to use magic, computer magic to solve this problem, it's AI and it's in PowerPoint.
28:34 That's funny.
28:34 I have a question for you when I, it's not a joke, but way back in the dark ages when I was going to college, all the AI work was done in like Lisp.
28:43 Yes, it was.
28:44 Are there still people doing AI in Lisp or is that not a thing anymore?
28:47 Do you know?
28:48 I think people are still doing it.
28:50 I think people are still doing it, but I don't think the neural network people have stayed there.
28:55 Right.
28:55 I think the neural network people mostly have moved to Python and things like TensorFlow and the other GP based things.
29:02 But I'm sure that there's like different kinds of AI.
29:07 Yeah.
29:07 Yeah.
29:07 Because you're right.
29:08 It was all, you had to be a Lisp programmer if you wanted to do anything with AI.
29:12 And AI was always this like amorphous, weird thing.
29:15 Like you don't really know what it is, but probably if we can like set up a blind chat with it over IRC, then it might seem like it's alive and then it'll be AI.
29:24 Right.
29:24 Like that, you know, the whole Turing test and all that, that stuff.
29:28 And now it's like, that's cute.
29:30 Car, drive here.
29:32 The car will go out.
29:34 You know, like that's with Python and like TensorFlow and the Lisp one that's doing the chat.
29:41 Right.
29:42 Like I feel like that's kind of where it is, but I'm sure people are still doing cool stuff with Lisp that I don't know or really want to read the code for.
29:48 Okay.
29:49 I'm glad there's probably not any Lisp programmers that listen to this.
29:52 No, but we're probably going to be posted in a negative way on some Lisp forum.
29:55 Sorry about that.
29:56 Sorry.
29:57 All right.
29:58 Well, thanks for being here, Brian.
30:00 And thanks for sharing everything.
30:01 Thank you.
30:01 You bet.
30:02 Bye, everyone.
30:02 Bye.
30:03 Thank you for listening to Python Bytes.
30:04 Follow the show on Twitter via at Python Bytes.
30:07 That's Python Bytes as in B-Y-T-E-S.
30:10 And get the full show notes at pythonbytes.fm.
30:13 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.
30:17 We're always on the lookout for sharing something cool.
30:20 On behalf of myself and Brian Okken, this is Michael Kennedy.
30:23 Thank you for listening and sharing this podcast with your friends and colleagues.