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


Transcript #303: This title is required or is it optional?

Return to episode page view on github
Recorded on Wednesday, Sep 28, 2022.

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

00:05 This is episode 303, recorded September 27th, 2022.

00:10 And I am Brian Okken.

00:12 And I'm Michael Kennedy.

00:13 We've got a lot of great stuff to talk about today, and it's a wonderful September day.

00:18 It's finally kind of not feeling like the blazing summer, but it's still too hot.

00:22 It's that lovely fall before it rains for 120 days straight.

00:27 It's like the pre-fake fall, yeah.

00:29 Exactly.

00:30 Exactly.

00:30 All right, well, the Python news still flows in the fall.

00:35 Yes.

00:36 All sorts of good stuff.

00:37 Yeah.

00:37 But what I got on deck for us is a bit of a follow-up.

00:41 So I got this message from Michael Honkala, who sent over this repo that he put together.

00:49 It says, you spoke about Humre, H-U-M-R-E, H-U-M-R-E.

00:55 And I said, you know what?

00:57 There's a bunch of these projects that I'd really like to kind of get my head around them.

01:00 And so he went to all the trouble to do a whole research project and a categorization or a taxonomy of these different libraries, which is really fantastic.

01:12 So I'm linking to his GitHub repository that is basically a readme.

01:16 I mean, GitHub's kind of the new blog for code analysis, isn't it?

01:21 And it says, R-E for humans, regular expressions for humans.

01:26 And it says, there's a bunch of different options.

01:29 This list could be useful to help you decide.

01:31 You know, if you're looking for a tool, you'll just know what's out there.

01:35 You'll get a quick look and feel of how each library's API is.

01:39 Or if you're thinking about building a tool, you can check out the alternative approaches and either contribute to an existing package or see if your thing is truly unique.

01:47 And if you're building a tool or already have one, you can communicate your differences compared to the other libraries.

01:53 Okay.

01:54 So there's a bunch of packages listed here with some code examples.

01:59 So the first one Mikio calls flow style regular expression generators.

02:05 I would call them fluent style.

02:07 But where you say, you know, function call dot function call dot function call dot function call.

02:12 Basically, the result of working with a library or calling a function, it returns the same thing again and again.

02:19 And you can kind of build it up.

02:20 Like ORMs are a lot like this.

02:22 You know, you say like objects dot filter dot order by dot limit dot sort like that kind of model.

02:30 Okay.

02:31 So these include Python verbal expressions, edify, mre, regularize, and re underscore patterns.

02:40 And they all are similar but not the same.

02:43 So I'll just, I'll read something off the top one, the Python verbal expressions.

02:48 You would say ver x for version expression dot anything dot then space dot then left bracket dot or parenthesis.

02:59 So square bracket or, you know, open square bracket, open parenthesis, then dot anything.

03:02 And that'll generate a regular expression that would then go and, you know, match basically like star and then space and then either square bracket or parenthesis open.

03:14 What do you think?

03:14 I don't know if we're getting better than actual regular expressions at this point.

03:19 All right.

03:20 Well, let's go to the next category then.

03:22 These are categorized as plus style regular expression generators.

03:27 I would call them ones that like overload operators, right?

03:31 They override what plus means and the pipe what that means.

03:35 And it's a little bit like what PathLab does for forward slash or time delta, right?

03:42 Yeah.

03:42 So here I could say, you know, this includes the humorex.

03:45 That's the one from Alstor Weigert.

03:47 So this, the, let's see, which one of these do I, I think that I like the best.

03:52 I'll probably go with this, this first one here.

03:54 So you could say capture one or more of anything uppercase plus the empty string or the string of the space rather,

04:01 plus either the open parenthesis or the open square bracket.

04:05 Is that one, do you like this style better?

04:09 Well, I'm probably a bad one to ask because I actually, I don't have a problem with regular expressions.

04:14 Sure.

04:15 Well, neither of these two are my favorite style either.

04:17 I actually think I would use the format strings and the reason, which is the third category.

04:24 And the reason I say that is it's really different than regular expressions where these are kind of like a semantic wrapper on regular expressions.

04:32 You know, there's like a way, like I call functions, I give a name to the thing instead of just the symbol, like plus versus, you know, plus star dot star.

04:43 It could be anything or you could say, you know, anything.

04:45 Also with, with all of these, they have a special syntax that they use.

04:49 So you don't have to learn regular expressions exactly, but you still have to learn their syntax.

04:55 Yeah, that's true.

04:55 So when I might use one of these libraries is when it's like not enough to go do full on regular expressions, but, you know, find is not sufficient or index, things like that.

05:08 And that's these string format styles.

05:11 So if you knew I had like a log file or something and it said power colon, some number, a percent, a string, and then a temperature, then another number.

05:21 You could just say power.

05:24 This is the scan F library, power colon, percent F bracket, percent, percent S comma, and then temp.

05:32 So you, you would basically, the, the format string you would use to generate this thing can now be used to parse it in reverse.

05:40 And so it'll say, you have to have the word power colon and then a floating point number.

05:44 And then, and so on.

05:45 That's the older, that's, that's the Python two style, I suppose.

05:50 Then you have pars and simple match, which are both much more F string style.

05:58 So you, so they have a.

06:00 These are great.

06:01 So like, I'm looking at parse and that looks.

06:04 Yeah.

06:04 That looks pretty cool.

06:05 So here, yeah.

06:06 Parse the, it says, here's the regular expression pattern thing you would make.

06:11 You would say just as a string to get curly bracket amount, colon D item, colon W comma, meet me at curly time.

06:20 Right.

06:20 And it just goes and finds the amount, the time and the item as a beautiful, you know, it just like is a, basically it's a reverse F string is what it is.

06:29 So if you can express what you're looking for as an F string, then all of a sudden you can get it back.

06:34 And so for those kinds of matches, I think this is really, this is a, it's pretty different than a regular expression.

06:40 It is, but it's, it's especially those ones where you're, you're not just trying to match a string, but you're trying to pull data out.

06:48 Yes.

06:48 Where the regular expressions really get ugly.

06:50 They do.

06:51 You got like, I got to have a capture group and all this stuff.

06:54 And you're like, oh, geez, like how do I do that again?

06:56 Exactly.

06:57 And the, and the capture groups and it's guaranteed to confuse somebody on your team, but something like this, I think it's pretty neat.

07:03 Yeah.

07:04 It does mean the data has to be more structured, but if it's highly unstructured, go crazy with regular expressions.

07:09 If you just need more than, like I said, a little more than find or index, this is pretty cool.

07:14 Yeah.

07:14 Yeah.

07:15 There's some wacky things that really you need to jump into regular expressions or, or the, the, the other kinds.

07:22 Indeed.

07:23 All right.

07:24 Well, Mikkel put his thoughts on which ones to pick and when, and then a little bit more diving into each of these and some, some comparisons and whatnot.

07:33 So you can check this out.

07:36 It's really good work.

07:36 If you know of other ones, maybe contribute to them or add some more explanations, but there you have it.

07:42 This is really nice.

07:43 Yeah.

07:43 Yeah.

07:43 This is real nice.

07:44 I'm going to start.

07:45 I looks like I may have already started.

07:46 So let's go.

07:47 Cool.

07:48 Thanks Mikkel for sending that in and creating it.

07:50 Well, what do I got?

07:52 I got, it's just some sort of news ish sort of things.

07:55 So I've been playing with a Pydantic and FastAPI and a lot.

08:03 And with that, you've got types.

08:06 So you're, you're intentionally adding types, not just because you want my pie to pass, but you're adding types

08:13 types because it helps you.

08:14 You can't have to for FastAPI and stuff and Pydantic.

08:18 So one of the things I, one of the things I was curious about is the whole, the optional part, because somebody actually caught me on this.

08:29 I tend to say, I tend to say, like, int x equals none.

08:35 Or no, x of type int equals none.

08:38 And that means it's supposed to be an integer or it's supposed to be a string or something, but it doesn't have anything yet.

08:46 So the default value is none.

08:47 But none is obviously not a string or an integer.

08:50 So what do you do?

08:53 And so there's like a bunch of options.

08:56 One, you could just say, well, the language allows it.

08:58 So I'm going to do it anyway.

08:59 But I don't recommend that.

09:01 The other, the other is one option is to use optional, but there's some issues with that.

09:07 We'll talk about those in a sec.

09:08 And then another is just to union or in.

09:13 So you can use, you use like int or int bar none or union of int and none, and then assign it to none.

09:21 And, and so I, for a while, like when I, I, I'm like the language allows it just go find.

09:30 Cause what I really mean, my intent is I expect somebody to pass in, in this case, an integer.

09:37 But if, if the, if nobody passed, if they don't pass anything in, I want to, I want the, the function to handle that case also.

09:44 And so that's what the none is for.

09:46 The union is a little weird because it says you can pass in a none.

09:50 And, and I, that would be weird for somebody to pass in none, but that's what our language is also.

09:57 It like, that's the default.

09:59 So I put out this, I put out a little survey, the, the recommendation that of the 630 votes,

10:06 the, was either use the union or optional.

10:09 It's kind of, people are kind of on the fence about with that.

10:11 but, so Adam Johnson says, replied to just the other day said, well, my pie just released and they,

10:21 they don't deprecate this yet, but there's going to be a future deprecation of implicit optional types.

10:27 So you kind of can't use the old style.

10:29 If you're using my pie also, you should.

10:32 The old style being int equals none.

10:34 Yeah.

10:35 of just like ignore the type.

10:38 Yeah.

10:38 Yeah.

10:38 For the default value.

10:40 so, my pie, the my pie 0.9, 0.981.

10:47 I don't know why we're not where it's zero version still, but, whatever.

10:51 but it has, it talks about implicit optional types.

10:55 So this, yeah, of saying it's a string, but the default value is none.

11:01 That's, that's bad.

11:02 we don't want that anymore.

11:03 What we want is, optional.

11:07 We'll say we'll work and it'll say, you know, what, then this is the weird part.

11:12 So the weird part is optional, isn't optional.

11:15 So what, what I'd like to use as optional, like in, in, in FastAPI, it looks nice to say this, this variable is optional,

11:24 but it, what really optional means is, is just that it optional just translates to the type or none.

11:32 Yeah.

11:32 That's it.

11:33 Those are the types.

11:34 It doesn't say it's actually optional.

11:36 It's only optional.

11:37 If you, if you have a default value, the default value makes a right option.

11:42 Yeah.

11:42 You can have a thing that explicitly says this type is optional, but it's a required parameter, which is a little odd, right?

11:48 Yeah.

11:49 What's up with that?

11:51 Yeah.

11:51 So a required optional.

11:53 so anyway, the third parameter named such and such of this type is required, like, but it's literally of type optional.

12:00 Yeah.

12:01 I hear you.

12:01 Okay.

12:01 That makes sense.

12:02 So the, the basic just is you have to pick, you got to pick either optional, use an optional and then assign it to none or use, use a union.

12:12 But another, you know, another, option is just to actually assign something other than none.

12:18 So if it's a string, you could have a, a flag value to say like sentinel.

12:23 Yeah.

12:23 Yeah.

12:23 That means like an empty string, like a, a, a great one for a string is empty string.

12:27 Yeah.

12:28 The problem is with numbers like a floating point or an integer number.

12:31 There aren't any sentils, sentinels.

12:33 I mean, I guess you could use Nan, not a number, but it's weird.

12:38 anyway, wanted to reference typing.

12:42 So just to say my proof that optional is really just the union of the type or none, it doesn't say anything.

12:48 And there, and they, they explicitly say in the Python documentation that you can, you basically, you don't have to use option, the, the keyword option or you could just put a default value that makes it optional.

13:01 But yeah, it's only a type anyway.

13:04 but the other thing, the last bit I wanted to talk about with this is the best introduction.

13:09 If you're confused, like I still am apparently about this, the best discussion that I've found is in the FastAPI docs, and go to, there's a Python types intro.

13:21 And, like at the top part way down, it says possibly none.

13:26 and it discusses all of this and the FastAPI recommendation is, is to use union instead of optional.

13:34 And I think I've finally gotten there that I think I prefer just the either union or if you're in the bar thing.

13:41 So you can say type or like type bar none.

13:45 And that that's, if you're only in, if you're Python three 10, that works.

13:49 But, if you're, the, on the others, I would use union.

13:53 So, ah, there's a bit of a, a voting and the audience.

13:59 Alvaro says int or none, which is a voting for that one.

14:03 Anthony says, I prefer optional of int equals none myself.

14:07 I also concur with Anthony, but I still very much would love to see some language syntax.

14:16 It's a little bit cleaner, like in C# in Swift, they just have question mark at the end to say it's either can be none or it can be its value.

14:27 And it's just such a common thing to set something to none.

14:30 And then, or alternatively have its value that I would just, I would love to see some kind of simpler syntax there than, than we see now.

14:39 But yeah, or some other, some other Sentinel that like, like SQL doesn't SQL have like null or something like that.

14:46 That's just, that's not a legitimate value for anything.

14:49 yeah.

14:51 And also if we use, by the way, one more reason, I think people would want the question mark or something.

14:57 I think it would be cool is, is it gives you this tonal inflection, right?

15:02 Like this function takes an int boom, hard, hard stop.

15:06 Like that means it has to be an int where it's like a, an int.

15:09 Well, then you're not sure it's optional.

15:10 Or you're not sure what type it is.

15:12 Yeah.

15:13 I think it's an int.

15:14 Yeah.

15:16 So in question mark, come on.

15:17 It's in all, it's in a lot of the other languages that have this, like things that can't be nullable unless you express their null.

15:23 You say they can possibly take on their value or null.

15:26 Anyway, I, I know this has been discussed and, and shot down, but yeah, we make it happen.

15:32 And I was pretty sure you could do this.

15:34 Thank you.

15:34 Alvaro mentioned that you can use, you can use from future important annotations to use the bar for everything on three, eight and above.

15:43 So that that's good.

15:45 And, but like, like for, like if I'm doing a FastAPI, the optional is really what I mean.

15:51 And that, that I mean it's optional, but it's frustrating that the type optional doesn't actually fill in anything.

15:58 Yeah.

15:59 Yeah.

15:59 So a bit of a mismatch there.

16:01 Okay.

16:03 That's enough.

16:04 That is enough.

16:05 Enough on that.

16:06 It's, it is so good though.

16:08 Good, good stuff that those types are there.

16:10 Brian, you want to tell us about our sponsor for the week?

16:12 Sure.

16:13 so Microsoft start Microsoft for startups founders hub.

16:18 It's, it's very cool.

16:20 So Microsoft, this episode of Python bites is brought to you for micro by Microsoft for startups and the Microsoft for startups founders hub provides all founders at any stage with free resources to help you solve startup challenges, challenges.

16:36 and it, it's a platform.

16:39 The platform provides technology benefits, access to expert guidance and skill resources, mentorship and networking connections, and so much more.

16:47 and those skilled resources and the one-on-ones and the networking, it's so valuable.

16:54 So unlike others in the industry, Microsoft for Startup Founders Hub doesn't require startups to

17:00 be investor backed or third party validated to participate. It's truly open and you don't have

17:06 to live in San Francisco. So what do you get? You get free access to GitHub and Microsoft Cloud with

17:12 the ability to unlock credits over time. And they also have partnered with innovative companies like

17:17 OpenAI, a global leader in AI research and deployment to provide exclusive benefits and

17:23 discounts. Through the Founders Hub, becoming a founder is no longer about who you know. You'll

17:30 have access to their mentorship network, giving you access to a pool of hundreds of mentors across a

17:36 range of disciplines, across areas like validation, fundraising, management, and coaching, sales and

17:41 marketing, as well as specific technical stress points. And you know that there's at least one or

17:46 two of those fields that you need help in. You'll be able to book a one-on-one meeting with the

17:51 mentors, many of whom were former founders themselves. Make your ideas a reality today with

17:56 the critical support you'll get from the Founders Hub. To join the program, visit pythonbytes.fm

18:02 slash foundershub 2022. And of course, the link is in our show notes.

18:07 Absolutely. Thank you, Microsoft. All right. Let's talk about linters. I know you're a fan of

18:12 linting code and making it look good, as am I. But if you did Cython, you might not be able to get

18:19 great information about it. So Marco Gorelli sent in this project that he's just getting started called

18:28 Cython Lint. So have you done much Cython? I know you do C and you do Python, but you live in this weird

18:34 middle ground. I don't, but I want to. Or maybe I don't. I don't know.

18:39 It's, I think it's pretty neat. You know, there's, there's a bit of a build, like a bit of a build

18:45 step you got to go through to get code that will run. But the ability to just say, I wrote Python,

18:50 it has type in. It's like, oh, let's just do a little bit different code. And now it runs at C speed

18:54 for just like a function or two. I think that's a pretty appealing idea. And, you know, Cython is

18:58 definitely a good way to do that. So Cython Lint, we'll go through and, you know, just pip install

19:05 it and then run it as a command line, give it your files, or you can even install it as a pre-commit

19:11 hook. And then, you know, it'll just, whenever you commit, it'll obviously run as well. Just like the,

19:17 the no QA and flake eight, there's a hash new Cython Lint to turn off the lines. And it right now,

19:24 mostly checks things around variables, but he's working on more and hopefully other people out

19:29 there are interested in this and can add some ideas too. This is really cool. And I'm, I hope that he

19:35 does get people helping out and adding to this. It's a, definitely it was something needed.

19:40 Yeah. He said he ran it on pandas, numpy, scikit learn, and Qpy and found ways in which all those

19:48 libraries could be cleaned up. So pretty neat. And all those libraries are notable because they're

19:53 really highly, highly used and have been around for a long time. So if this is finding issues with

19:59 them, then, you know, maybe it points out that something like this should exist. Yeah, definitely.

20:03 Yeah. Cool. So not a whole lot more to say about it. You know, Cython's cool. Having some more tools

20:08 to support it. Also cool. Yeah. I've got another sort of possibly short topic. I found out about

20:15 this cool diff tool called diff tastic. Have you seen this before? Diff tastic? I don't think so.

20:22 So I'm always looking for a better diff tool. I'm never really content with my diff tools. I use one

20:26 called beyond compare. It looks like it's coding edge out of the early nineties.

20:30 It's useful, but boy.

20:34 So, I found, I'm finding that also, so I use diff a lot, but I also use it a lot within it with it,

20:41 with respect, like within, with get. So I do, you know, you're doing a get diff of, of older

20:48 versions or something. So diff tastic is, the, what's what, how it stands out against other diff

20:55 tools is it's not line based. So it's a, it's a structural diff tool that understands syntax.

21:02 So what it does is it evaluates, the language and tries to determine what language the file is in.

21:08 And then, if it like, and it's got a ton of languages and if you, it figures out like it's

21:14 Python for instance, or any other language, it creates an abstract abstract syntax tree of the

21:19 files and then checks the differences of those. So, in the past, like one of the things that

21:26 messes things up is just spacing problems. Like in, in, in something like C or C++,

21:32 where spacing doesn't matter. You can just say, well, ignore white space, but in Python,

21:36 you really can't say ignore white space because white space is significant, but with a diff tastic,

21:42 the diffs, we'll, we'll know you can, if it's significant white space, it'll tell you.

21:48 So, I tried this out this morning and it's, it's pretty amazing. So, I tried it. So the,

21:56 the thing I tried was, replacing with the diff tool. So there's a, with get, so in get,

22:02 you can, you can say, and I just tried this single line thing to just temporarily say,

22:07 I want to try get diff. It has, is diff T instead of, instead of get diff. so, what this

22:16 does is it does a diff and you, and there's ways on in the, in the documentation that where you can

22:22 permanently turn it on, but it's colorized. So you've got like syntax highlighted files side by side,

22:29 and it'll show you what's different and it highlights the difference. Well, I got a little

22:33 bit confused. because the syntax, there's syntax highlighting and highlighting to show you the

22:39 difference. So, there's a flag and I, I'm not sure where it is in the documentation, but basically

22:44 you just turn off, you say --syntax highlight equals off. So it turned, it turns off the file

22:52 syntax, but it shows, so all the highlights are just diffs. and so like, if you, if you normally

22:58 say get diff just without anything, it'll say what's different about my, my file versus the last version

23:04 or the working directory or whatever, like what, what it usually does the right thing. And, and then,

23:12 but it's like on top of each other, it's not side by side. So having it side by side, it's cool.

23:17 And having it highlight. So I had a, some code where I changed stuff and I've been working

23:23 at a month ago or so, and I forgot what I did and get diff show me just tons of changes, but diff

23:29 tastic showed me that I was just changing some, some minor things like adding types, a couple types here

23:36 and there or changing, double quotes or single quotes, double quotes. So I apparently ran black on

23:42 it at one point. And, and there was like, Oh, sin AST wise, there's really nothing different. So I can

23:48 just commit this and be done with it. so it was really helpful. It is a pretty interesting idea,

23:54 right? Sometimes you really care about those little formatting differences and you want to make sure they

23:58 get merged and committed. And other times you want to know what is the essence of the change. And this

24:03 sounds like that'll answer that. That's pretty cool. And it showed me a bunch of stuff that get

24:08 says change. There were file changes, but get, but diff tastic said there's no, there's no syntax

24:14 change. So I, I apparently had changed some, you know, light, some formatting or something or ran black

24:20 on it, but there was nothing significant change. So interesting on that. and apparently this was

24:27 a huge pain in the butt to make, and, and there's a, we're going to link to a blog or blog

24:33 article called, diff tastic, the fantastic diff, by, Wilfred Hughes, who wrote it that

24:40 basically said he thought this was going to be sort of a minor thing to build. And it was a big thing to

24:45 build. so six months later. Yeah. I'm not sure how long he spent on it, but yeah, but yeah. And

24:53 here's a, here's a image of the little different highlighting the colors and changes and stuff.

24:57 So anyway, it's nice. Yeah. Looks like a great tool. I've never heard of it. Thanks for,

25:01 thanks for finding it. Alvaro out there says code --diff. I'm guessing that's VS Code diff.

25:08 I've never, never done anything. I've never used that for my command line. I should try that.

25:13 Yeah, perhaps. okay. also one that I've been looking at, I haven't gone into uses this one

25:19 called kaleidoscope. That's just for Mac only, but it looks, it looks pretty interesting. It's

25:24 supposed to work on code, but also on like, directories, but you know, images and other

25:30 documents as well. So I don't know, maybe someday the only challenge, it looks beautiful. The only

25:37 problem is a problem. It's the thing that has held me back is it's $150. So it better be darn good.

25:42 At least there's a free trial. Maybe I'll try it someday.

25:45 I volunteer you to try it out and get back to us. Exactly. Let me know how that goes.

25:50 Yeah. All right. Well, that's our items, right? I got, I got an extra. If you're ready.

25:57 Yeah. Let's go to extras. So this is not a Python thing, but a thing that

26:01 developers may be interested in. Have you heard of next DNS? No. So one of the things that's a big

26:08 hassle is spyware tracking, you know, all sorts of trackers like finger printers and, you know,

26:17 Facebook cookies and all these different things that are trackers, which is not lovely. but also

26:25 malware as well. And a lot of those are being served off of third party domains. So there's this product

26:32 called next DNS and I'd never heard of it, but apparently it more or less acts like a firewall by

26:39 not allowing malicious or unwanted things to resolve over DNS. Wow. So what you do is you just,

26:46 you set it up and you just set your DNS server to be, you know, one, seven, two, four, or whatever their

26:52 DNS server number is. And then it goes, everything goes through there. And if it says, Hey, we're trying

26:58 to go to double click, you know, like, no, we don't know what double click is. It's not on the

27:01 internet. I'm sorry. And just, there's no more ads. So it blocks a lot of the ads and trackers.

27:06 And because it's a DNS service and not like, an ad blocker in your browser, it works on whole

27:13 devices. So you could set it up on say your router and then everything, including your television and

27:18 the mobile apps and everything on, they would all get this blocking, which I think is pretty cool.

27:24 Pretty interesting. Yeah. I'm definitely going to check this out.

27:27 I'm not quite ready to set it up on my, my router yet because every now and then you,

27:34 you basically are forced to turn off your ad blocker for some small weird website. Or do I

27:42 want to impose this on my wife? Maybe, maybe not. Do I want the tech support that like, so I'm on the

27:49 fence, but I think it's a neat idea and I might play with it as well. You can always get it and just

27:53 set it on your, your computer. Right. But if you wanted to like every device I have automatically gets

27:58 malware and ad tracker blocking to put it on your router. Yeah. So, so one of the things, oh, do you

28:05 have any other extras? No, that's it. Okay. So one of the things I've been trying, to block ads and

28:11 stuff is, is I found out about this, a VPN called mall that mall VAD, I don't even know how to

28:17 pronounce that. but it's pretty, it's been pretty good. it, it blocks a whole bunch of

28:24 stuff. of course, switching to Vivaldi helps, you can turn, you can have a Vivaldi block stuff,

28:29 but mall VAD is so, so, like, into security that it doesn't even ask for a password

28:39 or, or an email account or anything. So what you do is when you sign up, it gives you an account number

28:44 and you just have to write that down and use that. and to pay for things you can use there. They

28:51 encourage you to use cryptocurrency or something, but you can use cards or whatever, but that potentially

28:56 could tie you to them. Right. So they also allow you to, just put money in a, in an envelope

29:03 with your account number and just mail it to them. That's awesome. They'll add money to your account.

29:09 So anyway, that's pretty neat. I've done a massive amount of research on VPNs and there's a really

29:16 whole bunch of shady ones out there, but mall VAD and Nord VPN, those two come out really, really good.

29:23 And so I've heard of great stuff from all that I use Nord VPN. And the reason I'm not using next DNS or

29:29 something like it is I just run Nord VPN and everything and check the block, all the ads

29:33 over that as well. So it's very, very similar. So yeah, this, I've, I think this is a great solution

29:39 and basically do the same thing. I also want, I wanted to remind everybody that, the current,

29:44 this is a little bit old news, but the current Python 311 is, Python 311 0 RC2 definitely

29:52 worth people trying out. And definitely if you've got a module that you're, it should have been doing

29:57 this already. Shame on you. But if you've got a package out there on pipe PI and people are using

30:01 it, it, you should be updating your testing to make sure that it's testing, the latest Python 311,

30:06 to make sure it continues to work. the last extra I wanted to bring up is I saw this

30:13 the other day called, Oh my get. And so this ends up being what it is, is it's a little game

30:20 and it's a little weird. but I tried it out, downloaded and tried it out. And so you've

30:27 got most of it's like this sort of a view. And so you got a, like a, there's a workspace area in the

30:33 middle, there's cards at the bottom and the cards are skills that you get, but it's in the, and on the

30:39 right, there's a description of what you want to do. And you have to like, learn the get commands to do

30:45 something, like, rebasing or merging or whatever. And, the, I, I started out at the,

30:53 trying out at the very beginning, the basic stuff. And it actually was, the introduction was pretty cool.

30:59 And then, but what I really like is that you can just go to the course, the, the, the available,

31:07 available lessons. You don't have to do it in order. You can jump out of order and just hop ahead to

31:13 something else that you're having problems with and sort of have a visual introduction to,

31:18 to get. So it's kind of neat. That's weird and kind of wonderful.

31:24 It is a little weird too. Yeah. Yeah.

31:27 But wonderful. Yeah. Very cool. All right. one more, a quick follow-up, wagon race

31:33 out there says, I know, but we don't add, but ads are the reason most stuff is free. Or do you want

31:37 to make a donate or, you know, do you make donations to sites that you block ads from?

31:42 I just want to comment on that real quick. I understand that there's a lot of services

31:46 that do need support. I mean, I was just listening to an interview with the guys from the verge.

31:50 They have a hundred person team at the verge working on stuff. And yet there is so much like

31:57 collection and triangulation, triangulation of who you are and what you are by these ad networks

32:04 through like data brokers and behind the scenes stuff that is just, it is a plague on society.

32:10 I mean, think about, the 2016 election and, the, the Facebook stuff. God, what is that name

32:18 of that company? Do you remember Brian?

32:19 But don't, but yeah. So they were using all those things to basically that kind of information

32:25 collected from those ad networks to target and manipulate people. So it's not just about like,

32:31 do I not really want to see this ad for a new program programming book, whatever it's, it's not,

32:38 it's the fact that they're using these terrible third-party networks to deliver it. So for example,

32:43 Brian, check this out, pythonbytes.fm, right? If we go here and we go to our episodes and let's just

32:50 pick one here. I got to zoom it back out a little bit. There we go. Look, this one right here. It has an

32:55 ad that's being, there's an ad blocker on my VPN on the network and there's an ad block blocker in my

33:01 browser. And right here we have an ad with no blocking. It shows up just fine. Do you know why?

33:06 Because we're not using an evil third-party network. There's no tracking. There's no retargeting.

33:11 We show you things from people who support us. We, we ask you to please check them out and at least

33:19 consider it to support our show. And yet there's as much ad blocking here as there is on somewhere like

33:26 CNN or, you know, you pick your spot. These places have like 30, 40 different tracking networks on you,

33:34 triangulating stuff and reselling it. And it is a plague on society. And if CNN wanted to show you

33:39 ads, they could do just what we do. I'm sure they have better relationships with advertisers than we

33:43 do. So Cambridge Analytica, thank you for letting me know. Yeah. So I'm not against ads. I mean,

33:50 to a large degree, we are ad supported. I'm against people building behind the scenes information and

33:56 using it to manipulate society. Bit of a rant. Sorry. Sorry, Brian, if I went too far there.

34:01 No, they had, and some people just don't realize that, that the ads are not just,

34:05 there's a product that we think that you might like based on the content of this page. That totally

34:11 makes sense. Like this, the people that are listening to Python bites, they might be interested

34:16 in Python for, or Microsoft for starters, founder or something. Magazines used to be like this all the

34:21 time, right? So you buy a magazine. It's not tracking you that whether or not you looked at something or

34:26 looked up somebody's website because of a magazine ad. there's it, there's just stuff collected

34:33 about you that I don't think is necessary. And I think, like for instance, read the docs has like

34:38 the ethical ads that, they don't do, yeah, they don't do tracking. So yeah, exactly.

34:45 And neither do we on purpose. It probably we've had to turn down sponsors. People said,

34:51 we want to sponsor you, but we need you to install this tracking thing for your MP3 downloads. We need

34:56 to install this Facebook pixel and these other things are like, you know what? We don't want your

34:59 money. Like, no, we're happy to sell your product because it's irrelevant, but we're not going

35:05 to spy on our users. So thanks for no thanks. All right. And, wagon race, just quick follow-up

35:12 says, thanks for the explanation. I do understand you better. And I'm glad you guys are big enough

35:15 to direct, to have direct sponsors without trackers. so are we. Thank you. Okay. With all that,

35:22 let's flip the table and make something, close out with a joke. What do you think, Brian?

35:26 Yeah, I'm ready for something funny.

35:28 All right. So this one comes from somebody who had to go through this online multiple choice

35:34 prove to me, you know, JavaScript test to be hired. Okay. And it says, so I got this wrong

35:40 because the person who typed in the question made a mistake. So here, check this out. The,

35:45 it's one of these multi-choice question things that says, what is the result of the function call

35:50 shown below? And it's just super simple JavaScript. It's, creating, one of these little Lambda

35:57 expressions here. And it has, the equivalent of an F string and a interpolated string is really

36:04 the essence of it. And it says console.log open parenthesis. This is important as you would

36:10 open parenthesis quote. Hi, my name is, you know, dollar curly first name close off the curly. And then

36:17 it closes out console log instead of with the closing parenthesis with a closing curly brace.

36:24 And so the options are like, hi, my name is John. I'm logged into the console. Hi, my name is

36:29 undefined. I'm logged into the console. And this, what the machine thought was a correct answer is,

36:34 hi, my name is John Jr. I'm, cause that's the name of the, the, the variable or the value variable.

36:40 I'm logged into the console and they, you answered uncaught syntax errors logged a console.

36:46 Like no wrong. It was supposed to say John Jr. No wrong. You typed it in wrong.

36:52 Wouldn't that be frustrating if you're trying to apply for a job and they put syntax errors in there

36:59 and you're like, nope, because they may be checking whether or not you're finding that closing curly

37:04 brace, right? That's a legitimate test, I guess, but no. Yeah. And it, I think it's fine that you don't

37:11 get to work for them because they're probably not someplace you want to work for. They've got syntax

37:15 errors in their onboarding. Exactly. In their application process, but. Exactly. Oh, well,

37:23 anyway, I thought that was pretty funny and I'm sure people have been through the, like, there's all

37:27 these sort of weird go home and write this test or take this thing to prove, you know, how to write

37:33 code sort of things. I'm sure people have been through, so they'll probably get a laugh out of

37:36 this. Yeah, that's pretty funny. All right. It was. Well, should we wrap it up? Let's. Cool. So,

37:45 thanks everybody for coming and watching the show and also everybody that listens. We love all of you

37:51 and thanks, Michael. Indeed. Thank you, everyone. Thank you, Brian. Yeah. See you next week.

Back to show page