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


Transcript #202: Jupyter is back in black!

Return to episode page view on github
Recorded on Wednesday, Sep 30, 2020.

00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 202 recorded September 30th 2020. I'm Brian Okken.

00:11 And I'm Michael Kennedy.

00:12 Yeah and this episode is brought to you by Datadog. So thanks Datadog.

00:16 Yeah thank you Datadog. It's good to have you back Brian.

00:19 It's good to be back.

00:19 We missed you.

00:20 Yeah I had a little bit of a heart scare but I'm all better now.

00:23 So that's good to hear.

00:24 We're recording this September 30th, but by the time this comes out, we might have a new Python.

00:30 So did you know that?

00:32 I did not know that, but I'm very excited that you're covering that first. Yeah. So usually there's about a week delay and that's about when Python 3.9 should be, right?

00:40 Yeah. So Python 3.9, there is a, the RC2 or Release Candidate 2 was released September 17th.

00:47 The final is scheduled for release October 5th. Of course, you know, it's software, so things can come up, but we're looking forward to starting using 3.9 right away.

00:57 We're linking to the changelog. There's a lot of different lists for what is in 3.9, but I wanted to highlight a few features that I pulled out from the changelog. The first couple, I think I'm most excited about, there's a dictionary merge and update operators. So the merge operator is just the bar, so you can have two dictionaries and do a bar to merge them them together and the bar equal for the update.

01:25 The update means it doesn't mean append, it means if there's new stuff added to the other dictionary, but if there's changes, change it.

01:34 I think this is just when I first read about this, I thought, why don't we already have this?

01:39 This just seems obvious.

01:40 I'm glad to have a merge operator.

01:43 >> Yeah, I thought there's already a way to accomplish this with the curly bracket star star dictionary, star star dictionary, star star dictionary, which has the same effect.

01:53 It's a little bit longer.

01:54 I think this is for consistency with other container objects like sets that have a pipe behavior.

02:00 So it's like, oh, you can just do it to dictionaries.

02:02 I think.

02:03 - That's nice.

02:04 I had to read a little bit.

02:05 The next one is a remove prefix and remove suffix has been added to strings and also added to bytes, byte array and collections user string, which is cool.

02:15 - I'm most excited about this one.

02:16 - Are you?

02:16 - Yeah.

02:17 - Because this actually, the workarounds to do something the other workarounds are ugly if you just want to it's just I have like this string that might be at the beginning of my of another string I want to remove it like if just this prepended stuff that happens all the time so like spaces or things like that what would you use it for well yeah the same thing there's a lot of times there's like oh there's this string that always starts at the beginning of this line and I just don't want it. Right? But the trim, trim start, trim end, trim, if you give it characters, it doesn't mean remove that string, it means remove, like take each one of those characters and remove all of them until you don't run into any more of those characters. And so if one of the characters of your string happens to be the first character of the stuff that's left, it'll also get ripped.

03:02 Yeah, you just want a specific string to get removed. A set of strings. Right, if I'm like, I want this substring off the front, you know, if it exists, but not if it doesn't, right? You don't do the test and anyway it's just it cleans it up and makes it a little more predictable. Okay, yeah. Next thing is type annotations have a change that you can now use the built-in collection types such as list and dict as generic types instead of having to import typing or from typing import capital list or capital dict. I'm really excited about this. Wait, I didn't get back. I'm more excited about this than removed. Yes, because I'm always - I'm always annoyed when I have to like, 'cause I'm starting to use type hinting for interfaces, and you don't need to import anything to do that, except for if you have a list or a dictionary or a set or something like that.

03:51 And now you don't have to do that anymore, and I'm very happy.

03:54 - I'm still waiting for the optional operator, the question mark or something, rather than capital O optional.

04:01 - Oh, yeah, that'd be good.

04:03 Should add that.

04:04 - Yeah.

04:05 - We've talked about the PEG parser before, but the three nine is where the new peg parser comes in.

04:10 I don't know if it'll affect anybody, but it's neat.

04:12 - Yeah, it's supposed to make extending the language with more complicated behaviors and more nuanced syntax easier, but it won't affect you or me probably writing code day to day, I'm not gonna touch that thing.

04:24 - Yeah, I'm not.

04:26 I was intrigued by this.

04:27 Any valid expression can now be used as a decorator.

04:30 This is pep614.

04:32 I haven't quite wrapped my head around it, But I think this will change the way we use decorators.

04:37 But I think we need a few tutorials to be written for people to figure out how to use this.

04:42 - So maybe we should just make decorators like a lambda expression?

04:45 'Cause I know you have later in the show some really cool uses of lambda expressions.

04:48 So we can come back to that.

04:49 - Oh my gosh, a huge lambda expression could be a decorator.

04:53 Yeah, that'd be cool.

04:55 Or really bad.

04:56 Anyway, the other thing, last thing I wanted to mention, zone info is a new module that comes in, which is cool.

05:04 It has IA, NA time zone databases support.

05:08 That's part of the standard library now.

05:10 And there's a whole bunch of other stuff too.

05:11 So we're going to link to the change log and people should check that out.

05:14 - Yeah, very cool.

05:15 Exciting.

05:15 We're going to have a new Python and Python comes faster now.

05:18 - It does.

05:18 - I think they changed the release cycle to 12 months.

05:20 - Oh yeah.

05:21 - So three, 10 or whatever the next thing is should be out soon.

05:26 - Yeah, we'll just put it on our calendar.

05:27 First week in October, we should expect a new Python.

05:29 - That's right.

05:30 What happens in October?

05:31 Halloween and Python.

05:33 - And black, black cats.

05:34 - Black, yeah, 'cause you wanna go out into your costumes and your scary costumes at night when it's dark.

05:41 It's no fun to do Halloween in the day 'cause it looks fake.

05:45 Or maybe you just have a Jupyter Notebook and you're a fan of black, but you would like to format it.

05:49 - Yeah.

05:50 - So Mary Hong sent over a cool recommendation based on some stuff we had over on Talk Python.

05:58 So in Talk Python, I did a auto racing episode with Kane Replical and his pick for a PyPI package recommendation was Black Cell Magic, which I think we covered on the show as well.

06:11 I'm pretty sure.

06:12 She said you should check out Jupyter Black.

06:14 And Jupyter Black is kind of like the same thing, but instead of having to type into the cells, you can just press, it gives you a toolbar button you can press and off it goes.

06:25 So that looks really cool.

06:26 Gives you a toolbar button and a couple of hotkey shortcuts, keyboard shortcuts, to format single cells and format all the cells.

06:34 - Okay, that was gonna be my question.

06:35 Can you just have it do the whole shebang at once?

06:38 - Exactly, and that's what was, it also, you can also just run, instead of running black in your CI, you can run JBlack or as a pre-commit hook or something like that.

06:47 - Okay.

06:48 - So I believe with the one, the Black Cell Magic that I called, talked about previously, you had to like type it into the notebook and it would do it, which is cool, but this is more of a, and I talked about there being an extension would kind of do it for the whole notebook, but it was, it had a huge message, like this is no longer supported.

07:03 So like, I'm not so sure.

07:05 So this gives you both a CLI and hotkeys for the whole.

07:09 For the whole notebook, which seems cool.

07:11 Yeah, it does seem neat.

07:12 Definitely need to check that out.

07:13 Yeah, absolutely.

07:14 Quick and simple.

07:15 But to me, that's one of the huge shortcomings of Jupyter.

07:19 A multiple levels.

07:20 I think the auto formatting, like Jupyter should format that code as I type, I I shouldn't have to run command line things against it to get formatted code like Visual Studio Code, PyCharm.

07:32 It gives you that support as you go.

07:34 You're not spacing around, tabbing around.

07:36 The other I really wish Jupyter did better was Autocomplete.

07:40 Yes, if you hit dot, nothing happens, but if you hit tab, it will come up.

07:46 I think there's a lot of, compare that to the other modern editors.

07:49 There's a lot of room to make improvements on those areas.

07:52 But this, at least having a keyboard shortcut like reformat document, you know, command shift B or whatever, control shift B, that seems really like a good start.

08:00 Do you know if JupyterLab has any different support?

08:03 I don't think so. I think JupyterLab just has more other UI elements, like you have an ability to get to the terminal and do other stuff. It's not just the notebook.

08:12 But I don't think the fundamental editor experience changed.

08:16 I could be wrong, I don't compare them that often, but I don't think so.

08:19 I mean, if they get to that point, it wouldn't be an IDE, a JD, right? Jupyter development. That's right, a JD. Exactly. Good one. All right. Another cool thing is Datadog. This episode of Python Bytes is brought to you by Datadog. Let me ask you a question. Do you have an app in production that is slower than you like? Is its performance all over the place? Sometimes fast, sometimes slow. Now here's an important question. Do you know why?

08:45 With Datadog you will. You can troubleshoot your app's performance with Datadog's end-to-end tracing. Use the detailed flame graphs to identify bottlenecks and latency in that finicky app of yours. Be the hero that got the app back on track for your company. Get started today with a free trial at pythonbytes.fm/datadog. Awesome. Thank you, Datadog. You know what's not awesome? DDoS.

09:08 Denial of service against your web app. Yeah. So this is a couple of things I've got are listeners suggestions and Unfortunately since I've kind of been out of commission for a week. I forgot who suggested this So my apologies to the listener who brought this to their attention There's an article written by Jacob Kaplan Moss called understanding and preventing denial of service on web applications I saw it but I Kind of dismissed it right away because I thought it was just another like about all languages But this one is focused on Python and has some specifics on Django.

09:45 So I think it's it starts off with a good discussion of what denial service is, and then sort of what to do about it and how to prevent it from happening and fix things on your with your application.

09:57 But it kind of led me down a rabbit hole and I kind of enjoyed it.

10:01 Anyway, there's one example that it lists as a hadn't I think I've heard of.

10:06 I don't remember if we've talked about it on the show, which is called a redos, which is a regular expression denial of service.

10:12 We talked about this, do you know?

10:14 I don't think so.

10:15 But yeah, there's certain types of computationally expensive things that are not going to match or useless or whatever you can send over to regular expressions that'll cause all sorts of trouble.

10:25 What's interesting, so it says redos bugs occur when certain types of strings can cause improperly crafted regular expressions to perform poorly.

10:36 And I'm talking like really poorly.

10:38 What's interesting is they're not even complicated regular expressions.

10:42 They're just like, for instance, a match, a set containing like one or more characters, or zero or more characters, followed by another zero or more characters, followed by a B, or something like that. And there's like a little graphic on one of the links on this page that shows how slow this is.

11:02 It has to match all these different things and it's bad.

11:06 Anyway, some languages have stuff put in place to try to work this sort of a thing, but Python does not.

11:13 But we have a solution.

11:15 So this article links to another article called "Finding Python Redos Bugs at Scale Using DLint," which I was like, "DLint, what's that?" So I went and looked there.

11:28 DLint is a Flake 8 plugin, so you can check for denial of service vulnerabilities when you're checking everything else with Flake.

11:36 - Oh, that's interesting.

11:37 I'd never heard of that one.

11:39 - Yeah, so this, I was thinking it's a security plugin, a sort of linter for Python.

11:45 Man, I was thinking, is there a difference between that and Bandit?

11:48 And the authors of DLint were expecting that.

11:51 So the first FAQ is, what about Bandit?

11:55 So there's a discussion about whether or not to use Bandit, but the TLDR is, it checks for different things than Bandit so you can run both of them and they run perfectly fine on the same code base.

12:06 - Yeah, super cool.

12:07 DDoS is no fun.

12:09 Distributed DDoS, a whole lot less fun.

12:11 So having to deal with that, I've had to deal with that before and managed to get ahead of it.

12:18 But if there's thousands of computers trying to do bad stuff to your website all at the same time from different locations, it's not easy.

12:26 - You've had to do that for maybe Talk Python or something?

12:30 - For Talk Python Training, yeah.

12:31 People, thousands of computers We're trying to do all sorts of stuff at the same time.

12:37 So even things like, let's just block this IP address, or let's put in checks that if this IP address does five bad actions, we're going to block it for an hour, or a day, or permanently.

12:49 None of that would work, because it was so many different computers, or devices, or whatever.

12:53 Anyway, not fun.

12:55 It'll definitely get your attention.

12:57 Another thing that'll get your attention is pictures.

13:00 We love pictures.

13:01 So, Shomik Chowdhury sent over a project that he's working on that I think is pretty cool, so I decided to cover it.

13:09 It reminds me of something I'd worked on a long time ago.

13:12 So he works with computer vision.

13:14 And now this is not just about, I think this is useful beyond computer vision, which is why I'm covering it, but especially for computer vision.

13:21 What he has to work with a lot is there's an image and you're trying to find all the people and maybe the bicycle or all the cars and the things the car needs to worry about if it's a self-driving car, right?

13:32 Crosswalks, lights, whatever.

13:35 You want to put little pictures around it, say, the computer vision and the ML algorithm said, this is a car, where's that duck over there?

13:42 That's not a car, right?

13:43 So you want to label them visually.

13:46 So often what they do is they put boxes around them and they put some text to say, this is a person, this is a car, this is a duck.

13:53 And drawing those boxes with the picture, with the label lined up just right or affixed to the edge of the box or sort of an arrow pointing down to it or things like that, you know, kind of tedious.

14:03 So he wrote a thing called Bbox Visualizer, which lets you just say, here's an image file, like a PNG, and here is the coordinates of this box and the label I want you to put on it, and boom, it draws like a nice, fancy little box around the object that you talk about and puts a well-oriented label on it.

14:25 So if you're doing any sort of science stuff or image analysis where you want to put, like, here's what the computer thought is over here, and here's what we're calling it, you know, for all sorts of analysis.

14:37 This is a handy little library.

14:39 - Yeah, this is cool.

14:40 - Yeah.

14:40 You know, not everyone's going to need it.

14:41 You don't need it for like a fancy web app or whatever, but I think if you're trying to do this kind of work, here's a super simple, like, two or three lines of code, put a nice bunch of bounding boxes on top of things and pictures with nice labels.

14:54 That seems cool.

14:55 - Yeah, I can also see, like, lots of different, like student projects where they're using, working with images and algorithms around it to be able to highlight a particular area that they're working on or something like that, I think uses--

15:08 - For sure.

15:08 I can see a lot of science that are doing it.

15:10 Like we detected this as a star here.

15:13 This is a star.

15:14 Here's the name of the star or whatever.

15:15 - Yeah, and to just sort of lump all of the drawing the box stuff into a library.

15:20 This is cool.

15:21 I like it.

15:21 - Yeah, for sure.

15:22 You've got some nice fancy code examples, like taking your Pythonic code to the next level.

15:27 Tell us about it.

15:28 >> To the next level.

15:28 I was debating as to what, I've got a devilish streak in me, I think, as to why I'm bringing this in.

15:34 This also was another listener's suggestion.

15:37 My apologies to whoever sent it.

15:38 I forget. I think it's a gist.

15:41 GitHub gist, I'm pretty sure.

15:42 It's how to never use lambdas.

15:46 I'm just chuckling even at the name.

15:50 It starts off with a brief example showing how to rewrite a power function as a lambda.

15:57 And anybody sort of familiar with lambdas, that's kind of a common use case is, I've got a little single one or two argument function that I need to pass in as an expression instead, and I can't pass in functions, so I pass in a lambda, says it's kind of a bound function sort of thing.

16:16 - Right, I wanna do a sort on a list, and I wanna sort by all users, I wanna sort by their login date.

16:22 So, yeah, lambda u goes to u.loginDate, or something super simple like that, right?

16:27 That seems good.

16:28 - And anybody scared of lambdas, if you look at the initial example, that's a good simple thing.

16:33 They're not scary, they're just basically functions without names.

16:36 But they have to be expressions.

16:38 So first one, no problem.

16:40 But then he jumps right into some crazy code.

16:43 I'm saying he, I don't know who wrote it.

16:45 But the crazy code right away is some code with import statements.

16:50 So how do you get around import statements?

16:52 Well, you somehow it's using a dunder import and referencing the library you want to import as an expression, has to as in the value of that past as an argument to another Lambda.

17:04 And these are nested Lambdas.

17:06 So right off the bat, first bad example is horrible.

17:10 So don't do that.

17:11 - This is almost like a decorator Lambda thing.

17:16 It's so weird.

17:17 - Starts off frightening.

17:18 And then shows an example of a class definition and then how to lambify a class definition as, yeah, so you can have a Lambda expression be an entire class definition, weird.

17:32 And then the last example, which is my favorite, is an entire working Flask application as a single Lambda expression.

17:41 It's truly horrible stuff.

17:43 You should not do this, but it's amusing to read about.

17:45 - Well, if your goal is to have fewer lines of code, like one line for an entire Flask application, that's impressive.

17:52 I think it has two routes, not just one.

17:55 Impressive.

17:56 - Yeah, yeah, it's great.

17:59 - Cool.

18:00 Sometimes these, like, let's see these ideas taken to extreme are pretty interesting, and definitely that's the Lambda equivalent there.

18:06 - Now, one good use case of this, I think, maybe I might get struck by lightning by suggesting this, but if you're in, if you're a CS student and you're doing really good, you've got like 110% in the class, maybe turn in a homework assignment that's just entirely lambda expressions.

18:24 (laughing)

18:26 - Or if you're just feeling really mischievous and you get some homework assignment you're super frustrated with, you're like, "You know what?

18:35 "You're gonna ask me to do something silly." And you said, "As long as it works, it counts.

18:39 "You're getting this back." (laughing)

18:41 - Anyway, yeah, I'll probably get--

18:43 - Yeah, don't do that, that's mean.

18:44 get hate mail for that. What's not mean is contributing to open source generally.

18:49 Yeah, that's not mean. That's nice. Yeah. So Alexander, one of the listeners sent over an article or blog post by Vincent Wonderman, and it's called uncommon contributions, making an impact without touching the core of a library.

19:02 I think this is one of the challenges, paradoxes that you might run into is like, you find these libraries that are very popular and you love them and you want to contribute to to them, like I love Django, so I want to contribute to it.

19:15 I love Flask, I want to contribute to it.

19:17 I love requests, I want to contribute to it.

19:19 Well, guess what?

19:20 All of those things are highly polished and they have a lot of different use cases.

19:24 It's very hard to make changes to them because any little change will have a potentially huge effect on a lot of software, right?

19:30 - Yeah, and it's also just intimidating to touch the code for a large project too, so.

19:35 - Yeah, exactly.

19:36 So here are a bunch of ideas of things that are low danger, low stress.

19:41 probably a lot of people haven't taken advantage of them.

19:44 I'll just go through a couple that Vincent works through.

19:48 One of them is just providing better information.

19:51 So he contributed to this project called Rasa.

19:54 And I don't know what Rasa does, I forgot to check out.

19:56 So it has a CLI, you say Rasa, you can say Rasa --version.

20:02 And what it would say would be like 1.2.7.

20:05 Okay, that seems totally legit, like that feature is implemented, right?

20:09 But then, and by the way, if you look at this article, if you open up the actual article, Brian, you'll see like each one of these has like a beautiful like XKCD style picture talking about the story.

20:22 So for like the info one, it says to debug this, like somebody says, hey, Ross is not working.

20:26 They're like, all right, well, in order for me to debug this, you gotta give me your Python version, your operating system, all the versions of the packages that you have, like are you running out of a virtual environment, et cetera, et cetera.

20:37 So what he did was that, All right, when you say --version, now you're gonna get the version of Python, the path to your virtual environment, the version of related packages that Rasa depends upon, things like that.

20:48 - Nice. - That's easy to do.

20:49 That's not a challenging, you know, too difficult sort of implementation there.

20:54 The next one is to set up a cron job to run tests checking that dependencies haven't affected a package.

21:05 So I know you know about continuous integration, - Yeah. - Right?

21:09 Check in, changes come, gonna rerun your unit tests.

21:13 That's great, right?

21:15 But what happens if an underlying package has an underlying dependency, so the dependency of the dependency, is that a grand dependency?

21:25 I don't know.

21:26 An underlying dependency has a change that potentially makes something operate differently.

21:32 What is gonna trigger your CI if you don't make any changes to your code there?

21:36 - Yeah. - Right?

21:38 So he actually ran into this, scikit-lego is a package that Vincent works on.

21:45 And he discovered that it wasn't working for some reason because scikit-learn introduced a minor but breaking change.

21:52 So what he set up was a cron job with GitHub Actions to just run that once a day to say, hey, just in case something which we don't know about or directly affects our repo, we still wanna run those tests again just to make sure like, yeah, things are still good.

22:07 What do you think about that? - That's good.

22:08 And I also wonder if the breaking change was that they changed what the version output produced.

22:16 - Yeah, I did think about that actually.

22:18 If somewhere in there, there's like a test, someone has something that just test that calling that on the command line.

22:25 All right, spell check.

22:26 Spell check is easy.

22:27 - Yeah, there's always spelling errors in code.

22:30 - Always, yeah.

22:31 'Cause a lot of times the symbols we use are not proper words.

22:34 But I do really appreciate things like PyCharm that will find misspellings inside of various things.

22:42 Right, like if you've got a function, check login and I and enter switch, it'll say login is misspelled.

22:50 But you know, it's still--

22:51 - Or grammar checks, grammar checking people's doc strings or comments in code and stuff like that.

22:57 - Exactly.

22:57 So there's a nice example in there about looking for a country I think where it was Spain, but Spain was misspelled as a docstring example.

23:07 So that's definitely something easy to do, just run a spell checker on the docstring.

23:11 One that I'm a real big proponent of is having better error messages.

23:15 - Oh yeah.

23:16 - So it's so frustrating.

23:18 Like just today, yesterday?

23:21 I don't know, I was asleep.

23:21 I was not sure exactly when I got this.

23:24 But I got a message from a student taking the Excel course says, "Hey, I tried to run cookie cutter," 'cause during the Excel course, we talk about setting up like a cookie cutter template that gets everyone started.

23:36 It says, I tried to run cookie cutter and it didn't work.

23:40 Here's the message.

23:41 And it just says something about the Git clone that cookie cutter internally tries to use failed.

23:46 And it doesn't say anything about, you know, is Git not installed?

23:50 Did Git, what was the error from Git?

23:53 Like it just, nope, it failed, right?

23:56 You know, just like a random, like this command failed.

23:58 Like great.

23:59 So if there was a better error message, like we tried to do that, but you don't have permission to write where you tried to clone this thing to, or Git is not installed or something like that.

24:07 They could have gone, oh, I need to install Git, right?

24:10 They would have been a much better op.

24:12 So error messages.

24:12 So they work on, I mean, it works on something called whatlies, and it allows for optional dependencies.

24:19 Like it has some of its functionality, but you might have to pip install whatlies bracket something else like here's tf.hub, right?

24:27 And in order to use a certain part of that that depends on that optional dependency, you have to have that installed, but you don't have to install it to use the library, right?

24:35 So you could run into this problem where you try to use a feature that doesn't have a dependency.

24:39 So instead of just going, none object has no attribute whatever, right?

24:44 Or whatever's gonna happen there, or no library such and such, it's now the error is, in order to use convert language, you'll need to install pip install whatlies bracket tfhub, see installation guide here, and there's the URL, like that is a proper error message.

25:01 - Yeah, that's great.

25:02 Telling people how to fix the error, yeah.

25:04 - Yeah, and you know, it's just, it's not that much work, but just finding these problems, like how many times does this appear on Stack Overflow, rather than just like let him go find it on Stack Overflow and give the message.

25:15 So I recently added something like this to FluentCheck.

25:17 Remember when we talked, I think you brought this up, talked about using raise from on an exception.

25:24 So you can say raise an exception, but if you do that in a catch block, you get weird other issues, right?

25:31 So by default, it would say something like, during the handling of the above exception, another exception occurred.

25:38 And that sounds like one thing broke another.

25:41 But like in this library, it's supposed to find errors and then report them to you.

25:47 So if you use raiseFrom, it'll say the above exception was a direct cause of the following exception, which makes it sound like, okay, this is the source of the error, right?

25:58 So just simple changes like that are really nice, get better error messages, failing unit tests.

26:03 And I'm not talking about going around and finding projects that have failing unit tests, but rather, if you wanna make a contribution, or rather you find a bug, rather than just submitting a bug on a GitHub issue tracker saying, this doesn't work, I tried it, and then having a long conversation about it, submit along with it a failing, create a PR that has a failing unit test for that issue.

26:25 - Oh, that's awesome.

26:26 - Yeah, right.

26:27 It's supposed to do this, this fails.

26:29 If you make this pass, I'm happy, right?

26:31 And then they can fold that into the unit test suite and so on.

26:34 And then also, finally, there are some packages that might have names that result in import statements that are very confusing.

26:43 So for example, if you've got a package and in the package, there's a file.py, lowercase f, and within file.py, there's a capital file class that those would be totally reasonable.

26:54 What you call the file is file.py, create a class in it.

26:57 depending on how the package is set up, you could end up with something like from package import lowercase file and from package import uppercase file would both work, but obviously don't mean the same thing.

27:08 So in that case, they recommend renaming certain files that are really meant to be used internally as an option.

27:15 - Yeah, like in the example, I don't even get what's different.

27:19 - I know, I just stared at it for a while as well.

27:22 That's it for all those recommendations.

27:23 But I think there's definitely some good ones in there.

27:25 I like the error messages a lot.

27:27 I like the failing unit tests as well.

27:29 Those are my two faves.

27:30 - Yeah, I was just even thinking about all this stuff.

27:33 The, did it talk about documentation?

27:35 - Not about creating documentation, just about the spell checking within documentation.

27:40 - Okay, well I would probably--

27:41 - Well, I guess that's doc strings.

27:43 That's pretty limited.

27:44 - I add documentation to this because projects always are lacking, or sometimes behind.

27:50 So the documentation might be great.

27:51 Somebody was really gung-ho about it for a while, and then there's been improvements, but the new features just haven't made it into the documentation all over the place yet.

28:00 Yeah, or tutorials.

28:01 There's no good tutorials showing this part of code.

28:05 There might be a quick start, but then the advanced hard stuff, there's no examples.

28:09 Yeah, definitely.

28:11 These are good.

28:13 What extra you got for us?

28:14 Well, I just learned about this this morning, so I was going to just not give a whole big thing, but just let people know.

28:20 I saw somebody on Twitter, of course, obviously being really bad about referencing people, but sorry.

28:27 A new thing, there's a, as of September, early in September, there was a a collaboration between the people in Wonder Woman and the Smithsonian Learning Lab and NASA and Microsoft.

28:39 So, there's a, we're linking to an article that's learned to code with Wonder Woman, Smithsonian and NASA.

28:46 And so there's a whole bunch of, the idea is that there's There's one, there's a lot of schools that don't offer computer science education.

28:53 And also with COVID and everything, some people have kind of, that's kind of dropped off a little bit.

28:59 And people are focusing on core classes, which is probably fair.

29:03 But if you still want to have your kid learn programming, this might be a way to do it.

29:09 And this is pretty cool and looks pretty neat.

29:12 There's some Wonder Woman adventure stuff and NASA exploration.

29:18 and there's even a little bit of Minecraft in there.

29:22 It looks really fun.

29:23 And at least some of the tutorials are in Python.

29:25 I haven't checked out to see if all of them are Python or not, but there's a lot of Python in there.

29:30 Some of them use Blocky, but some of them, like the super quiz from Wonder Woman uses Python.

29:36 And then some of the NASA ones, which Cecil actually called out the NASA Microsoft partner ones last time, but not this Wonder Woman one.

29:45 So yeah, it's a mix, but very cool.

29:47 It's neat.

29:47 Plus, I can't wait to see 1984.

29:51 I'm looking forward to it.

29:53 Yeah, definitely.

29:54 I have a quick thing as well.

29:56 I'm going to be doing a presentation at IndiePi.

29:59 So virtual online, obviously.

30:01 When is this?

30:02 This is coming up on October 13th.

30:06 So there I'm going to be doing a Python memory deep dive, both understanding some of the internals of Python memory as well as some optimizations that you can make to go faster and use less memory.

30:17 So you all can sign up for that and check it out if you like.

30:20 - Cool, a memory talk and you forgot the date.

30:21 That's funny.

30:23 - Yeah, I know.

30:24 Maybe we should just have another joke, finish it off.

30:28 - You know, I think we actually may have covered this a long time ago when it came out, but I'm not sure.

30:33 - I don't remember covering it.

30:34 - So it was suggested by Tim Jacobson, Kelsey Hightower's project, NoCode.

30:40 This is a hilarious repo, but you kind of have to go look at it.

30:44 So the tagline is no code is the best way to write secure and reliable applications.

30:48 Write nothing, deploy nowhere.

30:51 And you highlighted that the style guide was good, so I went and looked at that.

30:55 It says no code style guide.

30:57 All no code programs are the same, regardless of use case.

31:00 Any code you write is a liability.

31:02 So-- - Yeah.

31:03 And the style, this is beautiful.

31:05 The style guide talks about file extensions.

31:08 It says no code is not stored in files, But if you must, use the .no file extension.

31:15 Like example, main.no.

31:17 There are linters built right into your POSIX-based system, your Linux systems.

31:22 So for example, you can check by saying du-h main.no, and if it outputs zero, then you have no code.

31:32 - What is du, do you know?

31:34 - It's like a line count, count the number of lines of text in this file.

31:38 And then they have code reviews.

31:41 The no code community has adopted the following conventions for reviewing code changes.

31:46 When the code changes contains no code additions or modifications, LGTM, looks good to me.

31:52 When the code changes include code additions or modifications, C-I-A-L, code is a liability.

31:58 They should be, that code change should be rejected immediately.

32:02 And then the final kicker for me on this one is that there's 43,000 stars, 4,000 forks of it, which are funny.

32:10 But the thing that made me laugh is there's 368 people watching for changes in the no code repository where there's supposed to be no changes.

32:19 - That's funny.

32:23 And there's three, three point.

32:24 - Oh, it adds Docker support as well.

32:25 - There's 3.2 thousand issues filed against it.

32:28 - Oh my God, there are, what are they here for?

32:30 Oh yeah.

32:33 Suspended Arctic code vault, contributional reconstruction, Aviator chain generator keys, all right.

32:40 No water in the water cooler is one of the issues.

32:42 - This is, and then the contributing, at the end of the read me, it says contributing.

32:47 You don't.

32:47 (laughing)

32:49 - Sweet.

32:50 All right, well, that's a good one, Tim, and Kelsey, nice job on that project.

32:55 - Well, thanks a lot again for a lovely podcast.

32:59 Thank you for listening to Python Bytes.

33:00 Follow the show on Twitter @pythonbytes.

33:03 That's Python Bytes as in B-Y-T-E-S.

33:06 And get the full show notes at pythonbytes.fm.

33:09 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

33:14 We're always on the lookout for sharing something cool.

33:16 This is Brian Okken, and on behalf of myself and Michael Kennedy, thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page