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

« Return to show page

Transcript for Episode #251:
A 95% complete episode (wait for it)

Recorded on Wednesday, Sep 22, 2021.

00:00 Hey there. Thanks for listening. Before we jump into this episode, I just want to remind you that this episode is brought to you by us over at talk Python training, and Brian through his pi test book. So if you want to get hands on and learn something with Python, be sure to consider our courses over at talk Python training, visit them via Python bytes FM slash courses. And if you're looking to do testing and get better with PI tests, check out Brian's book at Python slash pi test. Enjoy the episode.

00:29 Hello, and welcome to Python bytes where we deliver Python news and headlines directly to your earbuds. This is Episode 251. Recorded September 22 2021. I am Brian Aachen.

00:41 I'm Michael Kennedy.

00:42 I'm Brett cannon.

00:43 So do we need to introduce Brett I mean, thanks for being on the show for it.

00:48 I'll come back and introduce my cat Gidget for all those on the live stream because she's in frame at the moment just lounging around in a nice comfy blanket. Actually from Google from when I won an open source peer bonus. One year, way more information than anyone probably cared. But there you go.

01:05 Nice. Yeah, my dog is around here somewhere but probably won't show up on screen.

01:09 Well, um, let's just get started. I think people don't know Brett. They need to get out from under a rock. So

01:15 yeah, absolutely. Live Chat real quick. Brandon brainer. Thanks. Give you a cat.

01:23 No, the the there's a long story about how we got Gidget. But no cat did not come with a blanket.

01:31 So the first thing that I want to talk about comes to us from this is both recommended and created by Daan Luttik. So Daan, nice work. I love these little tools that you can run against your code that will just reformat them to be better. You know, one of the probably the most popular and well known one is black, right? We've all heard of black, which is great. But there's other ones like Flint, FL y and t is one of my favorites that converts all the various string formattings to F strings, which is great, too. Here's another one around typing called auto-optional. And Brett I think people maybe are using optional a little bit wrong in the typing space in Python, what do you think? Or when they should be?

02:14 Yeah, that's definitely a thing that was actually think discussed early on about do we even need to have the concept of optional represent, hey, this thing can be whatever the type is, or none?

02:27 And yeah, what was the thinking there because you know, languages like C sharp, Java, c++, you can have a thing. And then it can be no, in C sharp, there's value types. But generally, most things are pointers. And they can be set to No, and you don't have to have some kind of a special type to say it's either a user or it's not to say it's a user. And because it could be a reference type, it also could be null or nil or whatever. But swift and Python have this concept of you must explicitly say that it could not have a value. So

02:55 explicit is better than implicit, as we all know. The other thing is obviously heavy non actively sneaking when you don't want it. As you mentioned, Michael swift specifically does not let you have no you can't have no references. You have to either declare that it will accept knowing you have to check or it won't take it at all. And to somewhere thing here. No one likes it when they actually find out Oh, the note types, not callable because you accidentally pass

03:20 none is the most common exception type is attribute or type attribute. None has no attribute, whatever the thing is, you're trying to access, right, that thing. Yeah, I'm

03:30 willing to bet Yeah, that attribute error alone is probably makes up like a huge portion of people's exceptions. So that's why you had to be explicit, like you need if you're going to be running a type checker. Let's be very explicit about what you do and don't expect.

03:42 Yeah, cool. I agree with that. I think it's nice. It did surprise me at first, but then I'm like, oh, okay, well, that's a that's an interesting choice. But now that I know, I should use optional. So here's a case of a function, and it's just some FUBAR example, but they have a bar parameter, and they say colon ster equals none. So they're giving it a default value. And saying it can be a string. Well, obviously, that is, like in three, three words, patently wrong, right? It can't both be a string and be set to be none because it you know, strings and types ism can't be none. They have to it has to be optional, right? And so that's it for

04:17 all of us know what that means. I know we all know that. Well, so funny

04:21 enough, you know what it means? But if you didn't write that, do you know what they actually meant? Right? Like if Michael type that and you saw it, would you go Michael men for that to actually be optional? And that's nullable in terms of what how other languages write it? Or was that on purpose? And that's why that's not allowed is because you don't know who screwed up? If anyone was that accidentally written that way. And it really was meant to be optional, or was it on purpose, and thus, it's listed that way? Because you don't know intent of someone else who wrote it. This is why we went with the explicit where you have to label something as optional.

04:57 And this is why it's awesome to have core developers on the show. So, so the idea of this is it's a thing you install, but then you pip install it, but then you just run it on the COI like Flint, and you just pointed out a directory, and it will go through and it'll find all of these default values that are none, but don't have optional in there type information. And then it'll just add optional, which is pretty straightforward. But you know, it's so easy to use, right? It's like, Oh, I have this one 1000 lines of Python code, and I really wish they were f strings like Flint, that folder. It's done. So same thing here, right? It's, I've, I've got this huge bunch of code, and nobody really thought about optional, let's just quick fix that. It doesn't fix it everywhere, right? Like, I could say, thing takes a string without a default value for the parameter. And then maybe somewhere else is getting in on and it's not like that advanced, it just looks if you're having default values that don't match the type make them match.

05:50 Yeah. Um, so I like it. One of the questions I have is, so if I do optional string equals nine, does that mean I still can pass none to the, to the function?

06:02 Yes. Because it is normal. Okay,

06:06 but when that'd be the same as saying that I can pass a stir or none? Yes.

06:10 Yes. And also, that's what? On the livestream Wilma, Google, hey, well says, Do you need to optional now that we can have food pipe? None as an alternative to optional a foo? No. But this is sort of more backwards compatible, right. Like, Bret, when did that come out? Is that 393 10? I think 310 Yeah. So so

06:31 it's not even out yet, officially next month? Yeah. So give it give it a little over a week.

06:36 Right on. That's exciting. But you know, how much backwards compatibility do you want? Right? So I think soon, but maybe I don't know if I would go yet. And then Chris may says, oops, opened in PI charm to add option to my last project. Before you go to the work to write it, just run this against it on the CI on the command line and just see how it works. All right. So

06:56 yeah, should also work in VS code.

06:58 Although xe docs does say back in three, seven, you can use from Dunder future import annotations, and then get that to work. I don't know about that, personally, Brent

07:07 was so what Xerox is suggesting here is if you use the from the near future, import annotations, what that does is it turns all your annotations, technically into strings to Python. And so it's actually not executed. Because before that, what actually happened was is that code in your annotation actually got run and the resulting object cut bound to the code object, what that future import does is just as No, no, we don't want to pay that overhead. On your import, you might have performance reasons, don't do that. And it will actually just become a string. And then we have some stuff to try to resolve that at runtime. This is the whole thing that came up in Python 310 that you all covered in previous episode of pedantic going, Oh, god, there's a change coming in 310 that might break guts. And there's a whole kerfuffle. And anyway, that's what that's all resolving. So technically, you're right, that you could write it back. But it would break complete expectations of everyone who ever tried to use your code when you tried to run that somewhere else. So I would advise against it unless you know, you're gonna be working in 310. Because for instance, someone might write code for Python 3.7 or three, eight, tell my PI, it's python 3.9. And then it would error out saying, well, that like that syntax makes no sense.

08:21 Right. Okay. Interesting. quite well. Yeah. Pretty good. One, good one. Super easy to use. Not a whole lot to it. But I think it's because it's so easy to adopt. It's kind of a nice one.

08:32 Yeah, well, I want to talk about something that's not easy. It's not easy to write good documentation. So there's a article from Daniel stenberg. And this doesn't apply to just Python stuff, as opposed to every software, all software stuff. There's an article called Making world class Doc's takes effort. I think it's an understatement. It takes a lot of effort. But there's this is a nice little dog, project or article talks about, he's got some gold goat things that he looks for to get a gold star, you must have these six items in your documentation. So let's just talk about what what he's looking for. First of all, the documentation should be in the repositories, the code. I've got mixed feelings about this. But in general, I'm on the side of this is a good idea just to keep the code and the docs together. The only reason why I sometimes find it difficult is when is I'm updating my documentation, possibly way more than I'm updating my code. And it looks like there's a lot of turn on the code when there's not so um, but generally, I think that's a good idea.

09:39 Most, most projects have the reverse, right, like the documentations. were edited. That was edited two years ago, but there's been changes continuously, right. Like, I don't even know if they still apply. But

09:48 yeah, yeah, but it is good to try to keep these together. Also, you can make a pull request or merge request be with both the documentation and the code together and, and so that's a good reason for that. Next up is that your Doc's are not extracted from code. And I know there's a lot of tools out there that can try to do this. But the comment is just think about your favorite project documentation. Is any of it generated from code? And odds are not. So yeah, I agree with this,

10:18 you can usually spot it because it'll be like method, login user, and then the the method, the comment will be logged in user.

10:27 on it. Honestly, I've seen the reverse to where people have docstrings that are extremely verbose and take up pages in your terminal just to scroll through. And because he just use that to spit out your docs, in which case, it's not as convenient as when you just want help from a repple to just grow like I was do, again, where the target was, like, I need a really clear point pointed thing directly at a developer who's just trying to double check something versus a whole x exposition of here all the examples of how to use it seems like, I don't need that level of detail. Just remember one little

10:57 right, right? Yeah, it's it's a range, is it inclusive, or exclusive of the bound? Or something like that, right.

11:03 One thing, the one place where I'm working out, I've got a project to try to use auto generated documentation is I've got a really large test suite on a project.

11:13 I'm shocked, shocked, Brian, that I would really

11:17 like to have docstrings encouraged developers to put doc strings in there for the reason why the test exists, and what feature it's really testing. And to be able to have an auto generated light like website with just all of our tests. That'd be cool. But I'm not there yet. That makes sense. The next thing is your Doc's feature examples. And I love this, because that's what people want to know, if I if I want to do this, how do I do it? And so the comment is really just use examples. If you already have examples, add more, you probably can't have too many examples.

11:53 and test them.

11:54 Oh, yeah, test the examples, we cover in a tool called the make doc test that you could use to test your code within your documentation, use that. Next is your doc document, document every API call you provide. This one's a tough one to keep up on. But it's really important. Even some great projects like type route and stuff that I've used not to not to bash typer. But I think all projects have this problem, they'll add a new cool feature, and it's cool, I want to use it, and it's not in the docs yet. Um, so that's a tough one to keep up on. But please do. One thing

12:30 I'll say that is actually hard for Python is because it's so dynamic, it's hard to actually get a static list of all the API points. But one thing I will say, too, because Paul Everett says, I have to bring more rest of this podcast., which is auto generated documentation for anything uploaded to for rust tools will actually give you a percentage of covered public API's. So you can actually see how much coverage you have in your documentation. So

12:58 that's an interesting definition of code coverage. Yeah, it

13:01 is right. But it's like, I don't even know about it. And then I found it when I was just double checking everything built, okay, for a project I will mention later, and my extra is extra extras. And I noticed it was 100%. Like, I thought I covered everything. And I went back I was like, nope, there were actually a couple enon values that I didn't document. And so I was able to go back through that and make sure I had full 100% coverage on my stuff. So became handy. But yeah, it's it's tricky in Python, right? Whereas like, I could auto gin, my whole API and no way to know whether

13:29 at runtime and never have it hit disk. Yeah, yeah.

13:32 And last couple things. Doc, sir, should be easily accessible and browsed and hopefully, a search feature or something even if you attach Google search. That's cool. But I there was a comment in the in the text also to say, preferably be able to have that online. So offline, was what the comment is. So if it's an I'm on the fence on that, I'm usually attached the internet. So looking stuff up isn't a bad thing. and easy to contribute to the lastly. So yeah, yeah, documentation stuff I would. There's a lot of stuff. It's hard to get it right. I would, there's a lot of stuff I need to add if I was being more verbose, but I want to. The last thing I really want to add to this is don't slam projects that don't have good good documentation, because it's hard. If you want to have it be better than contribute. Fix it yourself.

14:25 Yeah. Brian, you're kind of blowing up the audience out here with comments. So I'll throw a few out that seem interesting. Sam out there says protip keep on top of your documentation, even if it's just a cursory doc string, some notes otherwise it quickly gets out of hand. It's Yeah, it's definitely one of those things that if you just sit down and write it all at once, it would be dreadful but if you can kind of do little bits as you go then for sure, right. Brandon brainer says your documentation update should be part of the ticket or even better your definition of done for the ticket, right? Like when you estimate how much work in your sprint or something. And then Chris has a great one bonus documentation. If bonus if your documentation includes animated gifts, or emojis, yes. Yeah. Those are also probably leave it there for that one. That's great. All right.

15:09 So one interesting thing you could actually do is if you really want to push this is if you keep your documentation in the same repositories your code, you could, I'm going to use this from GitHub. I'm sure GitHub has equivalents. But you could probably set up a GitHub action. Actually, I know you can, because I've written the GitHub action to do this, to actually have your checks their status checks on your PR fail, if there are no touch docks and have to have to opt out of that check. Right, I actually have a GitHub action I wrote called check for change files. And you can write a requirement saying if you change file, and file must be changed somewhere in the PR, and if it's not have to add like a skip Doc's label to make a pass. And otherwise let people know very explicitly, okay, we care about our dogs, you can just opt out of it. Please make sure everything's up to date. There are ways to really push this pretty far as if you really want to go for it.

16:06 Yeah. Have robots be mean? And say, No, you haven't finished your PR yet rather than the maintainers. Yeah. All right. Tell us. Tell us about this next one, Brett.

16:15 Yeah. So once again, more wrestling this podcast due to Paul ever demanding it. And I've noticed there's been a slight theme, the last couple episodes of talking about ways to kind of improve your shell and your general development flow as it were. And one thing I use here and partially because Michaels mentioned Oh, my posh multiple times, I believe, Brian is now much in Oh, my Z's, I thought I just mentioned what I use for all my prompts, which is starship. The thing I love about this is it's actually cross shell. So what you do is basically, you define, it comes with a lot of basically plugins for configuring built in. And what you do is you basically turn them on and off, configure one way or the other, and then there's a one line activation, you just put in your code. And that's it. configuration is done by a Tamil file, starts a tunnel, and then it just works. There's no mucking about it doesn't doesn't matter what shell you're on, and he just does his thing. And the reason I really appreciate that is I'm one of these people who likes to play with tools, right, which leads to me playing with different shells, right? Probably by the time Paul ever tries out fish, I would try out new shell. So because of that, I want to make sure that I can bring my shell with me very easily. And starship, for instance, has support for fish, NZ and bash and all of them and new shell. So I can very easily try out a different shell and not feel like I'm in a foreign country where the the prompting is jibberish, right like,

17:42 Oh, my z shell go on to z shell and oh, my posh go on to posh. And like, you're stuck on that specific one. Right?

17:51 Exactly. And there's all my fish, like pretty much every show has an OH MY something or other to tweak it out. But with this, at least from my prompt, which is actually what I see the most right? Like, I don't know about the rest of you. But my prompt is what to interact with more than anything in my shell not the extra fancy stuff I put in. It's this. And so this is why I really appreciate this project. I will I suppose Yeah, good. I did go for it. It's just

18:14 what I like is we're seeing on the screen here. If you go to the site, you can see like a little animated GIF, and props to them for putting that on there. That is fantastic. As we just learned, it's good documentation. Yes, there's a lot of stuff about if you're in a GitHub branch and what branch you're on, and versioning and things that have specific stuff for Python and Python virtual environments and versioning like that,

18:40 yes, because I don't use it. But there's built in pi m support. But if you use the Python launcher, I actually have an entry on it in the FAQ for the Python launcher to tell it how to use the Python launcher to automatically tell you what version of Python has been used. And then you can configure the Python configuration to say, what should I trigger on for to be considered a Python project and it has a default list. It's pretty good like pipe project, tunnel setup.pi CFG, the things you would expect any repo or workspace or whatever, to have to be a clear marker that there is Python that I care about here. And then the other thing is, is there's also a way to if you use PI, you can also have it set up to auto trigger, as long as you just have like a dot vim directory, for instance, that contains your virtual environment. And then if you happen to use the Python launcher to be the way to query for what version of Python it is, it all magically just tells you what version your virtual environment isn't. And so I actually use this with Python. Not sure because it will always tell me exactly what will happen if it just type pi. Nice. Yeah, yeah. Um, and I know nerd fonts have been mentioned previously on this podcast. You'll notice that it has nerd font support. So if you get that installed, there's extra little fancy bits to it. You don't have to have it installed. All of those things will either turn into Mojo vodka or you can just turn them off. Yeah. But there's all sorts of stuff that this thing does. There's even real nice little subtle details like if you use starship, the, if you're watching the live stream, you'll notice that the prompt is green when the command last command succeeded. But if it fails, it turns red. Like there's real nice little subtle touches. tool that I really appreciate.

20:19 Yeah, I really like it too. That's great.

20:21 I'm gonna try to check this out. Because I'm, I'm always using, I got some tools that I have to run from the the command prompt. And but most of the time I'm in bash, or something else.

20:32 Yeah, very nice. xe docs says using multi line shell prompts, and F ZF are to the better productivity improvements I've ever done. I want to highlight that specifically, because I really like these multi line prompts. It has all the details, and then the prompt is below it. But I can't bring myself to use them yet. I don't know why I've just it's, I'd rather have it more densely packed on one line. Where do you stand on this?

20:59 I used to be that way. Actually, I before I used to be zis user before I picked my fish user. And even before this, I used to use left prompt and write prompt and I had a consistent left prompt, which is basically just the greater than symbol. And then I have my current working directory as my write prompt, so that at least the cursor position never shifted. Like I don't know about the rest of you. But I always find that that drove me nuts. like where's the start of my prompt, now I've tried to change my directory. So having that as the right side was great. But then I saw this is like, okay, I've never loved this. But this is so nice and set up across the board for everything that I consistently use, like rust, Python, NPM, whatever. I was like, Okay, I'm gonna give it a shot. And I did it. And I've stuck with and I continued like it. So I totally hear where you're coming from in terms of the density level. But it's just turned out to be way too nice with starship for me to care about going back. Now, if I do go back, right, and I don't have Z's, I don't have it set up for this. I actually have like my dot files set up so that my default bash RC, and all that if I end up on a random machine, at least has that kind of prompting. But as soon as I'm on any machine where I know, I'm going to be a fully set up environment, I just starship, I just don't care. I basically I get it, but this was just too many benefits, and I just let it go. And now I just don't notice it. And I used to

22:23 Brian tick, I'm gonna

22:23 try to embrace it, just just run with it.

22:27 And honestly, the resolution on all our screens are so high now compared to what it used to be back when I picked up that habit that the lack of vertical density, maybe it's because my block user doesn't bother me so much anymore.

22:38 Yeah, that's true. I do have a 4k monitor, I suppose that like a 32 inch 4k monitor, I could probably fit a terminal on it.

22:44 I suspect. So

22:47 it's actually kind of nice to have the the like color stuff in your in the multi line prompt to be able to kind of scroll up and see where the beginning of your line your command started. Because

23:00 it's like an HR a horizontal rule. Or Yeah, final thing Jeremiah page out there and live stream says starship is great. But I think you need nerd fonts for some of the plugins Hold that thought we'll be back to more than advanced later.

23:13 But that is correct. Some of the things like if you're watching the live stream, the there's a nice little symbol for like a branch next to the get stuff. If you have the power monitoring one that tells you like your battery's low, it uses nerd fonts to show that but Michaels foreshadowing something coming later.

23:27 Yes, indeed. All right, let's talk about James path. Now Brian, one of the challenges we always have on the show is we have these acronyms for packages, and then we have to speak them. And we've never spoken to the person who created or named it. So we always I'm sure we rack the names of so many packages, and let's just do a blanket apology. But this one is called James path. And I know because it says j m s p a t h pronounced Jas path allows you to like yes, this is another new thing I'm starting to really like allows you to declare to declaratively specify how to extract elements from a JSON document. So instead of going through and sort of going, you know, parsing up something as JSON turned into a dictionary, and then traversing it with indexes and keys and such, there's a whole lot of interesting things you can do to quickly get at elements. So for example, you can just if you had the dictionary that had key foo, and then inside there, there was another dictionary that had a key bar, and then that had a value bass, you could just say foo dot bar, and it'll give you as, which is kind of nice. You can also do that with with arrays, although this is actually not doing anything. It's just giving you back the list, and then you're indexing into it. So whatever. But you can do things like Star on it. So for example, if you add foo bar and then bar was an array, you can say like foo dot bar, bracket, star, dot name, and it'll give you all Other names out of this sub thing, the sub dictionaries in the list that bar points out. So there's like these cool, like almost like SQL like things. You can also do negative indexing into it, which is pretty nice. You can do star like food dot star dot name for hashes, you get the values out of like a set or something. That's pretty nice. And yeah, it's pretty interesting. This one comes to us from Josh Thurston. So thanks for that. He said he was working with all these sort of arbitrary nested JSON documents. And I was really handy for that. So, you know, you look at this code, and I'm sure right, you're thinking that's not Python, right?

25:41 No, actually, I'm wondering if the query syntax is the same as Jq. And actually Jq is,

25:47 I don't know what Jq is. Yeah, interesting.

25:49 So Jq is good. So Jq is a command line tool. So literally, just Jq, Juliet, Quebec, that is designed to actually take in JSON, more or less use the same kind of syntax is the query selector and the browser for CSS selectors, and query your JSON, I think it's meant a lot for like tools. If you're using like HD pie, or curl whatever to query something like REST API, that's going to give you back JSON and then try to find something out of it. And it looks pretty similar. So I'm thinking that this is maybe kind of just a Python packaging approach to the same syntax, which is, which is neat, because it means if you know, one tool, hopefully it will work for you.

26:28 Yeah, right. Yeah, it could be. So it's, it's you should think of it not as syntax that you write but more almost like a regular expression. So you would import Jas path and then you say expression equals Jas path, compile, and then you give it a string, which is these things I've been describing. And then you can tell it to like search or execute queries against things. So a lot, a lot of neat stuff you can do there, you can even add custom functions that can become part of this query syntax. So if you create a class that derives from functions, that comes out that library, you can have things like unique letters, and what you could do in there, say, given a string, I would like to do a set on the string and then turn it back into a string. So it only shows you the letters involved, not necessarily, you know, with duplication, right. And so then if you create that, then you can do things like when you do your search, you can do fruit bar, pipe, unique letters, and you pass the parameters over. It'll give, you know, basically the result of those values, but then applying these transforms and stuff to it. Good. So yeah, pretty neat. You got a lot of traversing, dictionaries and stuff like that. And you kind of want to treat them like sequel. I feel like this is sort of along those lines. People can check that out. All right, Brian, over you.

27:43 Yeah, I was wanted to cover this was announced last week, I think there's a tool called pedal board. This is a library came from that comes from Spotify. In its it's a it's for manipulating audio files. But in the introductory article, it says the power and speed and sound of a dat da W and never knew how to pronounce that one either. Digital is a digital audio, sometimes station.

28:13 Yeah, digital audio workstation. DAW I think maybe a dot dos.

28:17 I don't know what so what do you use? I use a Logic Pro usually is so some something like that would be Yeah, I use Adobe Audition. Yeah. So, um, so there's a lot of stuff you can do that, that are just common things that you're going to do to all files. So it'd be kind of neat to automate that. So things I'm thinking about are things like a compressor, high pass filter, low pass filter, but this thing has a whole bunch of other transforms you can do like convolutions and chorus and some distortions and gain if you want to make it louder, some reverb, a high pass filter, and then suffer I don't even know what it is a ladder filter. I don't know what that is phaser phaser. That sounds neat. Um, but so I definitely want to try that out. And if you're working with audio files, I think it would be be kind of a fun thing. I'm also going we've linked to the the GitHub repo for it, which is nice. It's completely open source. It says it also uses some has some cool things like plugins for VST three and audio unit which I have no idea what those are. But also there's some one of the things with audio is it takes a while so there are speed speed enhancements in this so it says it really doesn't take that long to use it it takes advantage of your CPU cores, which is neat. Also linking to an article to introduce it and I gotta warn people, the there's a image at the top which totally messed with my head because I mean, it's just it triggers me with all the different flashing colors. So be careful with that. scroll past that quick but other than that, it's a good article on on, on what it is some graphics And they don't quite get. There's some graphics on how it works. And I don't quite get what the graphics mean. Like the noise gate really doesn't owe me much.

30:09 I love the noise gate. That's one of the that's one of the biggest tricks to sound good actually.

30:13 Yeah. So it's important enough for me that I've got a hardware noise gate in my studio. So nice. Anyway, cool, cool library.

30:23 Check it out. Yes, if you want to do audio transformation, if you want to basically write Python code that does like addition, or the one he said, Brian,

30:31 well, I mean, in, especially with automation. So if you've got like a whole bunch of files you're dealing with, and you want to make sure that they're all kind of the same level, it definitely want to automate that and not try to. And they know there's ways to automate with some of your other tools, too. But it's kind of cool to have this.

30:48 Yeah, definitely. The only thing I have to contribute is going back to Brian's previous link about good documentation. While you two were talking, I just submitted a PR to fix the trailing triple backticks accidentally left in the readme. So just to give feedback to people trying to fix documentation is always appreciated. And Susan's the thing you can do pretty quick, especially with either the pencil editor in GitHub, or just hitting the dots, use GitHub dot dev if you want, if you need a little bit fancier support, and just send that PR and I mean, most most maintainers appreciate it, that as we all know, it's awesome. It's hard to keep going straight.

31:24 If you submit an issue or send an email and say this part of your docs needs this, this misspelling fix or this link has an extra trailing slash that makes it not work. That's work if you submit a PR. That's joy, right? He's just saying I accept. Okay, you fix it. Thank you. I'll just carry on right right there. Oh, geez, I got another thing to do. So yeah, that's great.

31:45 Nice catch. It took me a while to see that.

31:48 Yeah. Well, I mean, some people ask me, like, how do you have so many contributions to so many repositories, that's how literally, if you just read Doc's, anytime you find anything a little off, just take the time to just submit that PR, and most of them get in not all of them do. But honestly, that's enough to just kind of help out. And honestly, you just suddenly end up contributing to I think I'm up to 160 something repos on GitHub at this point.

32:11 Wow, that's awesome.

32:14 Okay, so um, Michael said, It was nice sometimes EF core does, we'll see if this doesn't cause you to regret having core devs on the podcast. So I'm gonna use this as storytime and just kind of explain how processes work in terms of packaging peps. Starting about six months ago, I took it upon myself to try to come up with a lock file format for Python, it seemed like it was kind of a gap we had where every multiple tools were trying to solve the same problem. And that felt like something that we should try to avoid, if possible, coming from speaking as the dev manager for the Python extension for VS code, having each bespoke tool such as PIP in poetry requirements, that txt files, even through PIP tools, right? Having just work, each of those tools individually is a drag, right? Like it takes a lot of time and effort to figure out what to do for each tool. If the tools update suddenly, we break. So it's a bit tricky. making calls to see Li is kind of an annoyance too, because we got to make sure that they're you know how to use their API with the report out is consistent that they don't change it because not all tools considered their output or their c li part of their stable API that they maintain. Anyway, there's a lot of drawbacks. So I tried to say that to be silly, and take it upon myself to see if I can come up with a way to get all the tools to kind of rally around something. There's also needs for like cloud, right? Like, if you upload something to Azure Functions, they want to do the install for you, but you need to build tell them what you want install. So lock files. Good thing, right, just in general. So I spent six months talking behind the scenes with various people. Originally, it was me protune and Zhu ping from Pip. We came up with a lock file spec. And then we invited Sebastian and frost from poetry and PDM respectively. And they said, That's not gonna work for us. And we said why it's like, well, your lock file was defined very specifically for certain platform, right? Like think of wheel tags, right? It says what Python version? What AB what EBIT is abort, and what OS are you on? Right? That's a platform from what I'm speaking from. It's like, that's great. But we want platform agnostic. lockfile, right. Like, if you ever crack open, the lock files up, poetry spits out, they actually work no matter what OS you're on. And it was by design. Sebastian wanted to make it so that it didn't matter. And actually, I've heard a good example from protune, where it's like, if let's say you're doing pi week, right, and you're doing a game. If you're you might be developing on Linux, but if you want to give it to your teammates, who you're working with during pi week in their own Mac, you want a way to be consistent on what you work on. And then if the judges are on Linux, you're on a whole nother place or Windows or whatever, right. So there is a use case there for platform agnostic files. So we so we tried to add that back. We took this public to discuss the where all the packaging and discussions happened. And it led to 152 comments on a thread starting July 29. It's actually it's more like eight months ago. So this led a whole nother discussion writing about people going like okay to clarify, and it rains right all the way from the title is not clear enough to like real nitty gritty details. And it's now led to us going back having discussions with the same people plus some other people who who participated here who made good comments, to try to come back with another approach that's a bit more from the ground up covering everything versus what we had before it was just a platform specific log file, then we kind of bolted on the agnostic bit and try and design from scratch. But the key point here I want to make is you hear people sometimes go on about, oh, I really want log files, right. Like I've talked about this publicly. And I think I talked about this PI cascades, maybe I mentioned it during the steering Council, cam, or maybe with Python. And my wife Andrea, who said she might actually be in the livestream said oh my god, all the comments about when you mentioned lock files are so so positive, like Okay, cool. It's surprisingly hard to make this stuff work. Right. Like everyone thinks it's a snap your finger, someone has an idea, do you get just get it done. But there's a lot of use cases here, right. And especially with packaging, you constantly hear people go like, oh, packaging and Python so bad. Well, first of all, most people are out of date, Mike, Brian's been really great about having me and other people come on testing code, for instance, direct specifically designed by this past packaging stuff to keep people up to date. So there's a lot going on. But if you need to try to keep up, but on top of that, it's just hard to make any changes. Because there's so much legacy out there. Everyone's got their own workflow at this point, right, like 30 to 30 year old language that's had some form of packaging for like, over 20 of it. Everyone's got the way they want to work, and no one likes to have it changed on them. Right, especially your workflow, right? Like, try telling someone who's using VS code like, yeah, we don't think you're doing the right way, does not fly, right. It just does not work. Everyone wants to work the way they want to work, which is totally fine. But it also makes trying to come up with a standard really hard. So the point I'm trying to make here is try to be understanding when you work with patchy and Python Not only is Python challenging on its own, due to the amount of C code, Fortran code, all the crazy stuff that people used, thanks to us being the glue code, the glue language of the world. But on top of that, there's a lot of legacy. Everyone has something they asked for. And people are working very diligently to continue to try to improve it. But do understand that there's a lot of work going on to try to make it better. So please try to be understanding on Twitter, or wherever else you're you're going oh my god tagged me in Python. So bad

37:43 is like the places where outrage Really?

37:47 Yeah. So that's what really here so a lock files are hopefully coming, I am working on a v2 of this Pap, probably go public with that I'm

37:56 going to guess sometime next month. And these will be independent of things like poetry and PIP and Finn, and just PIP and stuff like that. Or if we're

38:04 lucky, right? Like the key point here is we can't met we can't require this. But the hope is whatever solution we come up with will be good enough for those tools to rally behind. Right. None of this is like an edict from on high to say like, all packaging tools, most users the idea with all this has to be what's the carrot for the tools, right? How are we making things better both for the community, but for the tools themselves? Now it can be we make it so great from the community that the tools feel pressured to support it. But when you're talking from this perspective, the first thing you're dealing with is the tool. So it's trying to make the tools happy, because then eventually the users also become happy. So we'll have something at worst, my suspicion is absolute worst, we'll have platform specific log files come out with this Pep. But my hope is being a platform agnostic and get all the other tools on board so that everyone gets what they want need. And we can service everyone's needs. Nice. But the key point here is it's being worked on. It's taken a long time, it's going to take even longer, so well. And so understand that when people say, Oh, why can't packaging get better, faster? It takes a long time, right? Like literally, I've been working on packaging as my focus for Python stuff for years now. Right? It's not a fast process, because there's a lot of people involved a lot of projects, everyone has their needs. So just people just need to be patient, but do understand things are getting better consistently. That ends my rant to hopefully not make you regret having me.

39:23 That's great. I love the insight. The

39:25 only thing with packaging that I want to bring up is I wish it didn't change all the time. Sorry, I couldn't resist. Um, no, I think things are getting better. And I like the direction. So But

39:41 yeah, I mean, the grant my grand unified goal when I got involved with packaging really was to try to drive everything towards standards and specs, right. Like I have a project called mouse bender after the clerk from the cheese sketch, right. If you don't know the Monty Python sketch, it's when One of them walks in and just sorts of ads for every cheese they can think of and they don't have a in the in the cheesemonger shot. So thing. Anyway, I created an outline of what does it take to go from, I want to install Django 3.2, point seven down to actually eating files on disk. And I figured out where there was a spec, and where there was a library back in that spec and where the gaps were and I just been trying to plug it in. This is probably the last one, right? Because more or less, this takes care of the PIP tools PIP m poetry kind of give me a set of lock things. And let me be able to reproduce my environment. After this. I think I'm more or less kind of, I'm personally probably going to be done with packaging after this is moving on to web assembly, which hopefully make Michael happy. Oh, yeah. And then probably that'll lead into Is there a way to potentially start to being like a self contained binary for Python, or just try to help with Python as a Python c Python interpreter distribution kind of solution?

40:53 So is the new Pep gonna be 666? Or is that already taken?

40:57 No. Actually, 666 is taken. Okay. It's been taken for over a decade, it, it was purposely done to be immediately rejected, because it said you should be mixed tabs and spaces. So that was written to bank people stop asking for that, and it got rejected immediately. Okay, okay. Um, but no, I'll just since this didn't get accepted, I'm just going to rewrite it in place, the goals are the same. There's no need to have to do yet another Pep. So since this draft, I'm just going to basically just get it and redo it. And since the goals the same, I'm just going to reduce the number.

41:31 Okay, nice. Well, thanks for working on this, because it definitely is important. Yeah.

41:35 Welcome. Hopefully, it will lead to something that otherwise I've had a lot of interesting conversations about how people do and don't want to lock things.

41:42 Brian, back to you. Back to me. Oh, at for extras. For extra? You got an extra?

41:48 Um, yeah, so we've got one up, throw it up. So, um, looks like, looks like pythons popular.

41:56 I've heard that it would be popular enough to have a podcast about it

42:01 with lots of power three, even.

42:04 So the there's an article on ZDZD. net. Python is on the verge of another big step forward. And the big step forward apparently is the Thai hum, I'm gonna get this wrong to be index. lists. C is the number one language but Python only needs 0.16% more to become the number one language according to this index. Anyway, so

42:29 are they arguing that if we got to the top of Thai ob that would cause another spike in usage?

42:34 I have no idea. No, like if another spike in your usage would cause this to happen? Maybe? I don't know.

42:39 I don't know. Yeah. Yeah. So I think historically, only C and Java have ever had that designation. And so it's kind of big news.

42:47 JavaScript never gotten nothing.

42:49 I don't think so. Oh,

42:51 one more thing. Brett mentioned the, the cheese sketch. And if you go to pi, and type a link to anything that's silly, you'll probably get a 404. And the 404 has the cheese sketch embedded in it.

43:05 Yes, the cheese shop sketches at home and piece of history. Pie was originally supposed to be named the cheese shop it was actually originally supposed to be it was actually originally cheese But people were too concerned that managers wouldn't take Python seriously if the package index was named after our Monty Python sketch. So it got its name change.

43:24 Yeah. Cool. All right. Looks like you got some extras as well.

43:29 Yeah, well, I mean, this is Python bytes. So we couldn't go on up. So without mentioning well, although I think wills out in the live stream. So this is also more of the Paul love fest on here. So Paul had well go on to an episode to talk all about textual and rich and how it's all structured, mainly textual, I believe will tweeted that he got a haircut for this and everything. I actually haven't watched it. But as I said, it's not Python by default doesn't get mentioned. So I just want to make sure well, it got called out. Um, I will also say that it has been 30 episodes since I was last on, which I thought was kind of a nice round number. But on that episode, I mentioned that I was working on the Python launcher for Unix and stuff since over the last 30 episodes, I've actually wanted to mention that I had launched version one. And thanks to Brian and Michael for feedback, because actually, one of their feature requests got into it. The one thing I didn't want to call it that actually did happen recently is the launcher is now actually in Fedora. So one of the first things that I contributed was someone actually put arch was actually burnout. Gabor of talks fame got into arch Veera EUR I don't know how arch does community versus not there's a whole thing but you can install it via arch, but just the other week managed. Some very nice folks from Fedora. were nice enough to get it in. So you can actually now use DNF to install the launcher on Fedora, and then all the previous tarballs are all there as well. So that's still available, but yeah, version one No bugs so far. So it seems nice and stable and meeting people's needs pretty much.

45:04 Awesome. Congratulations. Thank you work.

45:07 I'm one of the I'm planning on Michael extra extra extra extra at the end. I will say that my syntactic sugar series is still going on. When it's done, I'll probably have a wrap up thing. And this is probably going to be what my next set of talks will be all about. But they're still happening. One interesting thing actually just did to just in the last two days, there were short, actually, Oh, God, I didn't really they published three in a week. That's a lot for me. I did have one that didn't work. So famous and curious what happens when I can't unravel a piece of syntax, you can read that blog post to see how I put in all the effort to do it, and then realize the day after? Oh, yeah, that's not gonna work. I did enjoy that. Oh, good. Yeah, yeah. Assignment expressions continuously break me in various ways. So there's a bunch of syntax I can never undo. Because those are expressions. They're handy, by the way, I've used them since the month after we approve them. But they do make unraveling our stuff hard. And then for Brian, I just wanted to call out that in our last release for the Python, since for VS code, we completely redid our UI VS code now actually launches with a built in UI for testing. And we integrated directly into it. So now, consistent UI for testing,

46:24 like a test tree result type of navigation thing.

46:27 Yeah, well, and we had that before, actually. But it was bespoke to our extension. And so there was some wonkiness to it and all that. But now that this is actually built into VS code, if all the language, I suspect will move over to this. So by having that learning it for one tool, one language means it will work for another language. And there's some extra nice extra niceties to it as well, in terms of updates and all that it's really snappy. We'll probably, we are also going to rewrite all the code behind this and how it runs to make it a bit more performant. And more stable and all that. So if you've had UI problems before with testing with VS code for Python, please give another try. If you've had more discovery run problems, we are going to be working on that. So that's coming up as well. And then when that's all done, we'll be bugging Brian about this to make sure he gets the Brian Hawkins stamp of approval.

47:19 Yeah, you know, charge for that.

47:22 I thought I was just coming on the podcast was the fee.

47:26 No, I definitely. I tried this out. And I liked the changes. And I'm excited to see the discovery changes as well.

47:33 Yeah, well, we reached out to the PI test team directly, actually and asked them like what what would you want us to do? And they give us some feedback of how they think it should be done and all that. So we're hoping to incorporate that and use that as the basis of how we do pi tests. And then unit test. New test is going to test unfortunately had to break we had to drop no support to to this. But honestly, it was extremely low used anyway. But we did have let it go. But we still have unit test by test support.

47:58 People shouldn't use it anyway.

48:00 You heard it from Brian. Don't Don't send me the hate mail. But yeah, that's it.

48:05 Nice. That's really great ones. All right. I now have a banners to separate my sections. Oh, that's awesome. Nice. All right. I'll be quick. I do have a couple of things. I just want to go back and sort of talk more about nerd fonts a little bit at nerd fonts calm people can check this out. So it takes all these different things and puts them together like a bunch of font, awesome fonts, Dev icons, weather icons into a bunch of things. And then the ones that I really like, is the developer fonts, right? So you go over and check these out. They all a lot of them have font ligatures, Brett, I don't know how you feel about font ligatures, but I'm actually a fan, although they freak me out when I first saw them.

48:44 I'm definitely a fan. I'm actually a Fira code. Yeah, exactly. Yep. Um, although the new ligatures support for infinite arrow length throws me a bit sometimes to the point that I actually have turned it off. And I use Cascadia code. The nerd version for starship in my terminal. So I actually have a separate font for terminals. In here. Yeah, casket right there. Cascadia Cove, here is Cascadia code on the official. Um, so yeah, I use Cascadia for my terminal. And then I use Fira Fira code for my editing. Although I'm contemplating actually buying a font called mono Lisa, m o n o Li s. A and using that, but I haven't pulled the I'm not against buying fonts if they're amazing. Yeah, and otherwise, it's $100. Um, our Monroe Necker actually uses it that's personally how I came across it and someone else recommended it somewhere crucial does. He saw me tweeting about it, bought it and actually thanked me for using it. So multiple people I know use it and actually appreciate it. And it does have like shirt support.

49:52 Good. Yeah. Alright, so one more shell thing. So here is my power. My Microsoft terminal running. Oh my posh word. My Computer look out dreadful that looks right. That's because I that's because I'm not using nerd fonts if people are just listening, there's just tons of squares where there should be. There shouldn't be symbols and stuff it says like, you know username Square Square, folder name, Square Square get information. And but if you go and install the nerd fonts, pretty much any of them the terminal, or Oh, my posh, actually, I guess is what it is, is, is tested against all the nerd fonts to work. So if you install that, then you end up with beautiful terminal, right? So definitely something nice to look into. If you're just a goddess. She's whatever monto thing is built in. Yeah, the nerd funds are cool. All right. Let's see what's next. Oh, did a article interview this company in Russia interviewed me if people are interested, I want to give a quick shout out to that it was kind of fun to talk about some of the history of the podcast and stuff over there. More shall Henry Shriner, third said, shared with us. Here's my setup process for setting up a new Mac. And there's all these cool scripts and brew setups and all sorts of things, including all the fish shell and vim setups that you might need. So if you want to follow up, we talked a little bit about that last time, people can follow up with that.

51:17 I also say one convenient thing about committing all of your dot files, at least on GitHub is if you use code spaces, GitHub and you check a box, code spaces will automatically clone your dotfiles repo and load them up into your code spaces. Yes. And so I've actually published my files and done somewhat of a similar thing. The other nice thing is obviously, when your machine, I don't know if I've ever told the story in this podcast, but when your laptop accidently gets grabbed by someone else and ends up in Dubai, and it gets shipped to you to a core dev sprint in London later, and you feel the need to wipe it for security purposes. It's very convenient to have all your stuff in the cloud and have your files in a in a repo. So it's just a clone run. And you're done.

52:01 Yeah, I want to wipe it to someone had physical possession of your laptop for a while. Yeah. All right. A couple of things. Brian, last time, I said I was using the editor to just jump between projects and stuff. And I've one thing I didn't point out is like I'm on the terminal all the time as well. But I basically everything that I have some kind of terminal command for is I've almost entirely set up some kind of bash alias. So that actually uses the specific virtual environment as part of the command and the alias. So it doesn't matter what I have activated, or where I am or anything like that. So anyway, just a quick follow up on that. Cool. All right. All right. Well, I think that's it for extras.

52:41 Do you have a separator for a joke? Also,

52:43 I have a laugh. I was separated for the laughs Yes, of course.

52:47 Nice.

52:48 I hope this is not as funny as the joke. But you all you all will be the judge. Okay. Okay. All right. So this is going back to a solid solid place, geek and poke over at geek dash and dash poke calm. This one is called the last 5%. And Brett your comment was perfect about setting up a new computer or re installing everything right? So this is the last five or this is going for corporate it made easy. Make sure that the new developers notebooks or computers aren't only 95% percent provisioned. So there's a senior woman developer helping a new one who can't seem to compile the project her run headers of this as I had the same problem, but I barely remember somewhere in a wiki or on a file server, there was a certificate or something like that. And I had to copy it to some folder on my machine. It's just entitled The last 5%

53:38 Mm hmm. It's like anytime someone onboards onto your team right at work. Yes, exactly. Yeah, go read with the last person five years ago or two years ago, how often you get a new person? Yeah, did it and by the way, the process of old change. So yeah, chances are does not work.

53:52 Just scroll back two years in slack or teams and find that message when we talked about it?

53:56 Yeah. You just have to hire people more often. So they update the wiki at least every few years.

54:03 Yeah. But the question then becomes, is it because your headcount screener, because your turnover is so high in this, you're just a bad manager. And this everyone keeps putting the team? Yeah, I'd rather just have the stable number of people who by the way, told me they were going to be on the live stream. And I didn't see Michael, any other comments by so I wonder if they actually showed up. So hello to my team if they showed up? ahead. And if she did, I hope they did.

54:26 And Christina has a final parting thought for us. This comic hits too close to home or work or work from home. Yeah, definitely.

54:35 Definitely. Cool. Well, that's it. So thanks a lot, Brett for showing up. Of course, it's joy to have you.

54:40 Thank you to my cat for taking a nap during the entire podcast and let's not distracting me in the middle of it. We'll put

54:46 it on our calendar to make sure to invite you about every 30 episodes then.

54:52 Great to have you here. Yeah. Thanks. Thanks, everyone. Thanks, Brian. Thanks, guys. Thanks for listening to Python bytes. Follow the show on Twitter via at Python bytes that Python bytes as in BYT s, get the full show notes over at Python by sarafem. If you have a news item we should cover just visit by them by sarafem and click Submit in the nav bar, we're always on the lookout for sharing something cool. If you want to join us for the live recording, just visit the website and click live stream to get notified of when our next episode goes live. That's usually happening at noon Pacific on Wednesdays over at YouTube. On behalf of myself and Brian Aachen, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page