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


Transcript #230: PyMars? Yes! FLoC? No!

Return to episode page view on github
Recorded on Wednesday, Apr 21, 2021.

00:00 Hey all, Michael here. Thank you so much for listening to this episode. Before we jump right into it, I just want to make a quick announcement. I'm sure you've noticed that we've talked about certain people being on the live stream or the live chat. And I want to make sure you know how to get to that if you're interested in being part of the show.

00:15 So if you just go to PythonBytes.fm, up in the menu, there's a live stream link, click on that, it'll take you over to our YouTube channel where you can subscribe and get notified about upcoming live streams. Most people just listen to the audio and that's fantastic, but it's really cool to be able to interact with some of the audience to get that broader perspective. So hopefully we can see you on the live stream recording sometime. Either way, so happy to have you here. Enjoy the show. Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds. This is episode 230 recorded April 21st, one day before Earth Day, I guess, Earth Day Eve, Brian, 2021. I'm Michael Kennedy.

00:54 I'm Brian Okken. Hi, and I'm Peter Kozarnoff.

00:57 - Hey Peter, welcome to the show.

00:59 So good to have you here.

01:00 - Yeah, thanks so much for having me.

01:02 So I work as an instructor at Portland Community College and I teach engineering and I also blog at Python for Undergrad Engineers and I'm a book author too.

01:14 So if you're interested in like that NumPy, Jupyter kind of Matplotlib sort of stuff, that's the kind of stuff that I'm into.

01:22 - Yeah, fantastic.

01:23 You do like engineering work at a local university, right?

01:26 - Yeah, at the local community college.

01:28 And that includes teaching Python in our engineering programming class.

01:32 - Yeah, awesome.

01:33 Well, you've spoken at the Python, Portland Python meetup.

01:37 You've been on Talk Python to me.

01:39 Now here on Python Bytes, you're making the rounds.

01:42 - Awesome, I'm excited to be here.

01:44 Thanks for having me.

01:45 - Yeah, you bet.

01:45 Well, Brian, are you feeling calm today?

01:47 Feeling a little chill?

01:49 - Keep calm and programming Python, right?

01:52 - Right.

01:53 >> This was suggested by Rens Demendal.

01:57 Something like that. Cool name.

01:59 This is a site, but we've covered some of Vincent's stuff before.

02:04 This is a site by Vincent Wormerdam called comcode.io.

02:09 What he's got is he's got a whole bunch of tutorial videos on software topics.

02:16 There are little tutorials to go with them.

02:19 I checked out that there's a whole bunch of stuff.

02:22 There's a Pytest, there's Rich Dataset and others.

02:25 I was checking out Dataset this morning and I got hooked, and I watched the entire series because it took 20 minutes or something like that.

02:33 I watched all of them. It was pretty quick.

02:37 I like the minimalist style.

02:41 It seems to be a balance of not just overview and not a deep dive, but somewhere in between.

02:49 It's a nice place to be.

02:52 I was blown away at how much he did with Dataset just really quickly.

02:57 The Dataset one, I started with a CSV file with a bunch of data in it, turned that into a SQLite database with a tool that he pip installed, used Dataset to open that, and that opens a server on your own computer, and then you use that to explore the data, and then used a plugin to visualize the data with plots and charts and stuff, and then showed us how to actually just use raw SQL, see what the exploration is in raw SQL and see what that looks like.

03:30 One of the things is it's a little service, so you could share that in your internal network with somebody else to look at it.

03:43 but the question of its raw SQL should really let raw SQL be run.

03:48 He said, "Yeah, it's fine because what Dataset does is open up the SQL database in a read-only mode so you can't write anything.

03:56 You're safe there, you can't delete anything or anything." >> Yeah, this is interesting in that it's really intended to be a 100 percent shared data and like you said, it's read-only.

04:06 Little Bobby cables won't be a problem.

04:08 >> Exactly. Then there's a couple of buttons that are like JSON or CSV, but they actually open up, they just open up queries and you can use those as an API into the data and you essentially have just with the dataset have an API that you can use directly for something else then.

04:30 Then he's like, "Okay, well, what this is good enough, could you stick it out on the Cloud?" Apparently, dataset has a tool to do that and you can just go ahead and create a Docker around it with a couple of commands and stick it on a cloud service.

04:45 I was just blown away at how much you can do with Dataset.

04:48 And just watching somebody play with it is good.

04:50 And like I said, it's not a complete Dataset tutorial.

04:53 It's just a scratching the surface, a little bit more than scratching the surface, seeing what kicking the tires sort of video.

05:00 So it's neat.

05:01 - Yeah, cool.

05:02 Yeah, it seems really neat.

05:03 And there's a ton of small little tools and things you can go explore there.

05:07 So yeah, nice.

05:08 Nice, nice.

05:09 Peter, what do you think about this?

05:11 - Well, I loved it.

05:12 I think this is a great resource for students too, 'cause they're all free.

05:16 And the one I really liked was the one on SymPy, which is doing symbolic math with Python.

05:23 And that's kind of a confusing topic, 'cause there's like a difference between using the regular square root function that'll give you a float as an output compared to like the SymPy function that is a symbolic math representation of a square root.

05:39 And I was hoping maybe it would be so like the ASMR videos that there would be very calming music while you were doing it.

05:48 But there wasn't.

05:51 The instruction though is really calming and really, really good.

05:54 So I'd love to share this with students.

05:57 Yeah, very cool.

05:58 Nice. All right, on to the next one.

06:01 This one comes to us from Brian Skin.

06:04 I've pointed out that here's a cool thing that I don't believe we've spoken about yet.

06:09 - All right, so Brian, thank you for telling us about natural sort or nat sort.

06:14 Have you guys heard of this one?

06:16 - No, I've never seen this before.

06:17 - So one of the things that can be frustrating is if you sort with something that is really strings, but it has some other meaning like version numbers.

06:27 Like if I have a bunch of strings and they'll have version numbers and I say sort that, of course it's gonna go, you know, like 2.0, then 12, then 100, you know, or maybe 100, then 12.

06:39 I guess the way it sorts will just be, I guess, lexicographically.

06:43 It would be nice if I could just go to certain things and say, sort it, and it automatically understood, oh, there's separators, and there's like meaning between these.

06:53 And if they're numbers, you know, look at the number part and then sort based on the size of the number, not the, whether it starts with a one or a two, but if it's a two or a 10, right?

07:04 And so that's what this simple little library does, is it's simple, natural sorting in Python.

07:10 So one cool example, this one actually might be interesting for you, Peter, for your students, is if I had a list of strings like, quote, two feet, seven inches, one foot, five inches, five feet, two inches, and so on, if I sort it, it's just gonna go one foot, 10 feet, two feet, two feet, seven feet, right?

07:30 You know, the lexicographical version.

07:32 But if you natural sort, it does exactly what humans would do.

07:35 (laughing)

07:36 One foot five inches, two foot seven inches, two foot 11 inches, seven feet six inches and so on.

07:41 So that's pretty cool, right?

07:42 You can just go and basically use NAT sorted instead of sorted, right?

07:47 The sorted built-in, just NAT sorted.

07:49 You could also import NAT sorted as sorted if you wanted to go off the hook and just, you know, kind of globally replace that on a file there.

07:57 So there's different things that you can do, you know, not just that one.

08:00 You can sort versions, You can sort file paths, real numbers, like scientific numbers, 1.72 times 10 to the 20th or whatever, that kind of stuff.

08:13 You do locale-aware sorting, like basically case and sensitive sorting.

08:17 You can customize it, you can sort custom types, but then if you select a key out of the, like say a class or an object, a bunch of the instances of that class, then that key would then be naturally sorted as if this thing does.

08:31 So here's an example with versions, like version-1.9, version-2, version-111.

08:37 And of course it sorts the way humans would sort it, right?

08:40 19, 110, 111, then 20 and so on.

08:44 That's pretty cool.

08:45 You can get sorted directories.

08:47 Now, some of these come from not the same NAT sorted, but like, for example, there's an OS sorted and there's for the real numbers, there's an real sorted and so on.

08:59 There's ways to customize it.

09:01 There's ways to build like custom sorters.

09:02 Like I created an algorithm, which is like real or, and locale, and ignoring case, and all of these things, right?

09:09 Like throw them all together with like the or, bitwise or operator and so on.

09:14 Yeah, and I think that pretty much covers it, but it's pretty neat.

09:18 It has like some cool debugging stuff.

09:21 ZDocs is asking if it, NatSort handles non-ASCII Unicode.

09:26 I think so.

09:28 There is some talk about that actually working with bytes directly, but I think it sorts on strings itself.

09:37 So I don't know why it would necessarily be different.

09:40 I mean, unless you try to treat the Unicode as binary, then that might be something else.

09:43 But yeah, thanks for that.

09:45 One other thing that's interesting, just looking through here, I'm like, okay, this is neat.

09:48 Kind of cool, here's how you customize it, da, da, da.

09:50 Oh, wait, there's this thing called fast numbers.

09:53 Most efficient, the most efficient sorting can be done if you install the fast numbers package, which apparently, you know, it has nothing to do with this, right?

10:02 But it's something that it uses.

10:04 And what fast numbers does is it allows you to have different behaviors for like float and int and stuff, parsing strings into floats and integers.

10:13 And apparently it does it faster as well.

10:15 So for example, instead of saying float of a string, that is a floating point number, you can say fast float of that.

10:21 And of course you could go crazy and import as and wipe that out, right?

10:26 but you can do things kind of like the dictionary that get, so you can say, fast float, try to parse this, but instead of throwing a value error, whatever type of exception it is, you can say the default that I'm gonna get if I can't parse it is zero for bad input, or what number will I treat as not a number and all sorts of interesting stuff.

10:43 So if you're doing parsing of numbers, fast numbers is kind of cool.

10:47 - Yeah, I gotta check this out.

10:49 I do that all the time.

10:50 - Yeah, yeah, that's cool.

10:52 So I think this is just, that's not the main topic, but I do think it's a neat one there.

10:57 So anyway, yeah, people who do sorting of strings and stuff, they should check it out.

11:01 And ZDocs is talking about like sorting, like a umlaut over a, I don't know the name of the, like little circle above a vowel, but there's the locale aware sorting.

11:13 And so you can give it, you can give it like the Swedish locale.

11:19 And I bet it does sort it okay, but I don't know for sure.

11:21 I haven't actually tested the Swedish locale, But it does seem to have something that addresses that.

11:27 >> Nice.

11:27 >> Yeah.

11:28 >> For me, the use case is always the one versus zero one.

11:33 If I've got something that's 10 and something that's one, the way that that automatically gets sorted, and then I don't always like putting the zeros in front.

11:42 It seems really useful.

11:44 >> Right. You don't have to left pad it type of thing.

11:46 >> Yeah.

11:47 >> Absolutely.

11:48 >> Well, how about Mars? Peter?

11:51 >> How about Mars?

11:52 So this is something I'm super excited about, the Mars Perseverance Rover.

11:58 And the rover landed on Mars in February, but just a couple of days before this recording, on March 19th, the Mars helicopter, which is called Ingenuity, lifted off for the first time.

12:15 And so this was the first power-controlled flight on another planet, which is so cool.

12:22 And you can go to the NASA website and take a look at the Mars helicopter like lifting off for the first time.

12:29 It's kind of got two counter-rotating rotors and a little solar panel up at the top and a little antenna up at the top.

12:39 And the cool thing about this is that some of the software that's running the Mars helicopter is built with Python.

12:50 It's also totally open source.

12:54 So on GitHub, there's this package for something called fprime.

13:01 And NASA writes it f apostrophe.

13:04 And fprime is the flight control software that Mars Helicopter uses.

13:11 And if you look at the GitHub repo, you'll notice in the installation instructions that you have to make sure that you have Python 3 and pip installed in order to install fprime, the Mars helicopter software. So I just think that that's super, super neat that Python's being used as part of the Mars mission and that open source to make this fprime flight software was used in in order to make this happen.

13:46 So Brian, you excited about space and the Mars rover?

13:50 - Yeah, and also one of the things that happened with this is GitHub put a bunch of achievement awards on it, a whole bunch of people's GitHub accounts to anybody that contributed to a project that was used by fPrime.

14:06 And it may have been other packages too, but at the very least with this.

14:12 And so a bunch of us got these like, you know, you contributed to the Mars, helicopter Mars mission thing.

14:18 So.

14:19 - Yeah, I felt cool being an Arctic code vault contributor.

14:22 And now that's just out of this world, man.

14:25 It's awesome.

14:26 - Yeah.

14:27 - Yeah, I love it in that post how they showed like a screen capture for Marietta, one of the core devs and showed like her little shield.

14:38 So I thought that that was awesome.

14:39 Yeah.

14:40 - Yeah, that's really cool.

14:41 Sam Morley also called that out that she got a badge for contributing to the helicopter.

14:45 - Yeah, and apparently I got one for contributing to pytest, which is cool.

14:50 So I didn't know pytest was used by this, but that's neat.

14:54 - No kidding, you have one of these badges?

14:56 - Yeah, let me pull it up.

14:58 - Oh my gosh.

14:59 - Oh, that is so awesome.

15:01 - That is super cool.

15:03 Yeah, and while you're pulling it up, ZDocs says, "Super amazing, great work by NASA.

15:06 "Crazy that Python is considered stable enough "to be used by them." I totally agree.

15:10 Oh, where is it?

15:11 There it is.

15:12 - Oh my gosh, you have the badge.

15:14 Dude, I am so jealous.

15:16 - It's pretty cool.

15:18 - Yeah, that's really cool.

15:19 So one of the things I was going to talk about is some extra, extra, extra stuff, but two of those have to do a little bit with like what we're talking about now.

15:26 So I'll mention them in a moment.

15:28 So Aram mentions on Twitter that points out for us, there's this quote from Dustin Ingram, who runs the API along with some other folks, and says Python packaging sucks and sort of quotes, but now it sucks on multiple planets, which is pretty awesome.

15:45 And then it goes off on this long, like this, he goes for a long thread of like how it's being used, what it's being used with, and I linked to this in the show notes.

15:52 There's like a ton of stuff you can follow along there.

15:55 And then also a lot of work points to an article over here that talks about this badge that you were referring to, Brian, and the various people were getting in, the repositories that qualified for it.

16:07 So Linux, F prime, CPython, Boto3, BotoCore, see what else jumps out at me that's Python, a matplotlib, NumPy, OpenCV, Python, Python dateutil, requests, yeah, so I can have writes saying how humble he was to see that, S3 transfer, which I use.

16:25 I mean, the list is like, this is a list on GitHub, but this is actually like a list of many of the big hitters of Python.

16:31 And it talks just about, I mean, hints at how important Python is for this whole mission is awesome.

16:37 - Yeah, that's great.

16:38 Cool.

16:39 - Yeah, yeah, absolutely.

16:40 Absolutely.

16:41 Super cool.

16:42 All right.

16:43 I guess real quick before we move on to the next thing, just point out that this episode is brought to you by us.

16:49 So if you wanna support us, check out the things that we're doing, like check out the Talk Python Training courses, check out Python, Brian's high test book and things like that.

16:58 And yeah, Anthony Lister gives you a little shout out there.

17:01 Well done, Brian.

17:02 You're basically an astronaut.

17:06 >> I'm almost embarrassed though because I contributed one test to a defect report and then wrote the test to show the defect.

17:20 That was my contribution to pytest.

17:21 >> All right. That's all good.

17:24 >> It's all good. Cool.

17:26 >> All right. Take us back to Earth.

17:30 >> There's a lot of cool projects in Python.

17:34 One of the cool projects is FastAPI, and that's built on Pydantic.

17:38 Pydantic is used by itself for lots of stuff.

17:41 Anyway, why am I talking about this?

17:44 Well, one, it's cool, but we've talked about it before.

17:46 But this topic was, we've been following it anyway, but I got to give a shout out to the person's name that mentioned it to us.

17:54 Somebody named Angry Dwarf said we should cover it, and I just love that he had his name in his email was Angry Dwarf.

18:01 So cool. Thanks, Angry Dwarf.

18:03 Anyway, it's been a bit of an emotional roller coaster, but the punchline is, Pydantic, FastAPI, and Typer will work just fine in 3.10, and they'll work in 3.11, and they'll always work.

18:15 They're going to work forever.

18:16 I mean, I don't know that for sure, but that's my guess.

18:20 So why am I saying that people should calm down and it's going to be fine?

18:24 Because people were freaking out last week.

18:27 So people were freaking out that maybe FastAPI and Pydantic weren't going to work in 3.10.

18:33 - Including the creator of Pydantic, not just random people on the internet.

18:37 Like people involved in the projects.

18:39 Yeah, yeah.

18:40 They were like, this is going to be not good.

18:42 - Okay, so this starts, okay, I'll jump into a little bit of the details.

18:49 There was a, there's a PEP 563 that was titled postponed evaluation of annotations.

18:56 There was a little bit in there and this went into Python 3.7.

19:01 It went into 3.7, but there was a clause in there that said, in Python 3.10, the functions and variable annotations will no longer be evaluated.

19:14 At definition time, they'll be lazy evaluated later, or something like that.

19:20 I didn't read it that closely.

19:22 But that's the bit that makes people scared about 3.10, and 3.10 is coming out really pretty soon.

19:29 Does that mean that Pydantic and FastAPI, they rely on this and are they not going to work in 3.10?

19:38 It turns out there was some corner cases, at least that's my understanding of it.

19:44 Sebastian Ramirez, who did FastAPI, he wrote, There's been some incorrect conclusions that FastAPI and Pydantic can't be used with 3.10.

19:56 Let's clear that up.

19:57 The worst-case scenario, which hasn't been decided, is that some corner cases would not work and require small refactors.

20:06 Then he goes on to show the refactors.

20:08 The refactors really are just there that if you define your types within a function, you won't be able to do that.

20:18 You got to pull the types out of the function and put it at a top level or something like that.

20:24 Even if you're stressed about this, you can try it out by saying in the code you have, you can say from Dunder future import annotations, and that will show you what the future implementation is.

20:37 You can try it out and see if there's any problem.

20:39 But then we got, and I don't have a link to this, but we had a notice from, Who is it from? I'm missing the name.

20:48 Anyway, I've noticed just the other day that basically said they're not going to do it for 3.10.

20:54 Basically, they're putting the brakes on 5.63, the switch over in 3.10 for 3.10.

21:01 They're going to push that to 3.11 so that they all have time to figure out what to do about it and how to figure it out.

21:07 We got another year to figure out what's or approximately.

21:12 As users, I have another year to not worry about it.

21:15 But the steering council, they know what they're doing.

21:20 They're aware of this, they're aware of this issue.

21:22 They're aware that everybody loves FastAPI and Pydantic and things that are built on that.

21:30 There's going to be a solution and I think people should just trust the people involved that things are going to be okay.

21:37 Anyway, yeah, it's there's a really, what's the right word?

21:45 Energetic, energetic conversation over on the identic issue tracker, and it just closed a little bit, just a little bit, you know, last six days just recently closed, which is good, but it was basically important at 563649 in the future of identic.

22:06 I just had Samuel Colvin, who is the creator and maintainer of Pydanic on Talk Python.

22:12 That episode should be out this week actually.

22:14 But on there he talked about how some things looked very bad for how things work, but then they've talked it through and it looks like some of the changes are not gonna be super significant.

22:23 Basically the problem was a lot of the type annotation evaluation is no longer concrete types, like a Python type you can go to and say, give me your type, what are you?

22:33 It was converting those to strings so that they could be evaluated more quickly.

22:38 But then in doing so, if I have a string called customer, that's very different than having the actual customer class that I can then use for type information.

22:46 So then how does Pydantic go back and find the customer class, like throughout all the things?

22:51 What if there's two of them and so on?

22:53 So that was the concern, and it sounds like things are looking better, so that's all good.

22:58 - So Brian, what's kind of the take home message of this?

23:02 - Well, one of the things, I don't know.

23:04 My take-home message is the people involved, like Samuel and Sebastian and the steering council, they're talking with each other.

23:13 They know what's going on.

23:15 And occasionally, stress happens as to what's gonna, you know, I don't know how to fix this.

23:21 But they're talking with it.

23:23 I'm gonna try, as a bystander, I'm not gonna jump on the bandwagon and try to, like, one of the things that came out was people, some people started sending a bunch of emails and jumping on the threads saying, you have to fix this, you have to fix this.

23:37 And that doesn't help, it just adds noise and adds work to the steering council.

23:41 So making, I think it's fine to make sure that it's addressed, but it's gonna be addressed.

23:47 And I don't know, I actually was one of the people 'cause I use FastAPI, I use Typer, and I was like, do I need to be worried about this?

23:56 And especially somebody using it, just take a deep breath and realize that something as large as FastAPI or Pydantic, is somebody's gonna figure out how to fix it, hopefully.

24:09 I mean, it's possible that something might break.

24:11 I mean, it is the dynamic language.

24:14 I just don't, there's enough people paying attention that I don't know.

24:18 That's probably a long-winded takeaway.

24:19 It's probably, it's like a repeat of what I just said, but anyway.

24:23 - So if you're using FastAPI right now, there's not a whole lot to be worried about.

24:28 - Nothing to be worried at all.

24:30 And if you are worried about it at all, you can use this future import thing to try out your code to see what it'll be like in the change.

24:38 And even if that breaks, they'll probably fix it by 3.11.

24:42 - Yep, and then Nick Harvey threw out that you can't test this from future, Dunder future right now, so that's cool.

24:48 - Yep, cool.

24:49 - All right, Brian, I tried to keep it down to just a couple of things, but then they started piling up in my extra section to where I didn't know we wouldn't be getting through it in a reasonable amount of time.

24:58 So welcome to another section of extra, extra, extra, extra here all about it, but minus one extra because I already told you about the one with the package list and so on.

25:09 All right, so let me take you through a couple of things.

25:12 First here, did you know we're live streaming right now by the way?

25:16 On PythonBytes.fm.

25:18 - Hello.

25:19 - On PythonBytes.fm, I say that 'cause there's a huge banner on the site I pulled up.

25:24 We had something that would let us get some real time analytics and sort of know people coming from, you know, advertisers sometimes ask for that.

25:31 But what I've noticed is a lot of the new browsers, a lot of the good ones anyway, are very much blocking those things, right?

25:38 So for example, Firefox automatically blocks our analytics anyway.

25:43 Brave automatically blocks our analytics anyway.

25:45 So we're not getting a lot of information back and we're getting, I don't know, my theory is about 40% of the traffic is being measured, which gives you some stuff like what countries people are coming from and whatnot.

25:55 But I decided, you know what?

25:57 We already have our ads, like in our ads, we do no tracking, no retargeting, no cookie setting, and so on. So why don't we just do that with our analytics? Like, how much do we really need that anyway? We got downloads and so on. So if you go over here and you click on the little shield, we now have a perfect privacy score on Python Bytes.

26:15 Oh, very cool.

26:16 Check this out. Tracking content, none detected. No social media, no cross site, no fingerprinters, no crypto miners, nothing.

26:23 And same by the way for TalkBython training and TalkBython itself and so on.

26:28 No known trackers to Firefox were detected on this page.

26:31 Cool, huh?

26:32 - Yeah, I didn't know about that little badge thing.

26:35 - Yeah, it's like a security score.

26:37 Like how much is blocked?

26:37 How bad is it?

26:38 And so on.

26:40 But because so many of them are blocking them by default, I'm like, you know, like let's just take this stuff off.

26:44 Right?

26:45 It's somewhat useful, but not that useful.

26:46 Related to that, have you heard of this FLOC?

26:48 Federated Learning of Cohorts?

26:50 Have either you heard of this?

26:51 No, no, I'm worried that joke is coming now.

26:56 No, this is this is just Orwellian business right here.

26:59 Like it has this eye looking at you.

27:02 So there's an article on Ars Technica.

27:04 Everybody hates flock Google's tracking plan for Chrome ads.

27:08 The EFF has a beautiful article that you really should read if you at all care about the future of the web, the future of tracking the future of privacy called Google's flock is a terrible idea from the EFF.

27:22 And they've got some pretty insane quotes in there.

27:25 For example, one of them from the EFF is, "Google's pitch to privacy advocates," I'll tell you what flock is in just a second, "But Google's pitch to privacy advocates "is a world with flock, "is that the world with flock will be better "than a world that we have today "where data brokers and ad tech giants "can track and profile with impunity.

27:45 "But that framing is based on a false premise "that we have to choose between old tracking and new tracking, it's not either or, we can reinvent the world where we're not being tracked in every way and sliced and diced and so on.

27:58 And I totally concur with that statement.

28:01 So yeah, check this thing out, this Google's block is a terrible idea.

28:04 The idea is instead of having third-party cookies, which so if I go to cnn.com, you know, we can try that.

28:11 It probably won't show up here because I have it blocked at like a higher level.

28:15 So now it's not showing up here, how many things get blocked.

28:17 But anyway, if you would go there, very likely they would set a cookie from say DoubleClick that you saw this ad, not this ad that you saw this article.

28:26 Then you go over to, I don't know, your dentist or your psychologist or whatever.

28:32 And then they also can have this thing.

28:34 So they actually were just reading this article basically.

28:36 Right?

28:37 Like they can profile what type of person you are very, very fine grained through these cookies.

28:42 So Flock, you know, basically Google said they're gonna get rid of these cookies because as I already pointed out, everyone's blocking these third-party cookies, Firefox, Brave, VPNs and so on.

28:51 So what do you do to keep the ad retargeting happy and the like the super analysis of what everyone's doing happy?

28:58 You come up with a new idea.

29:00 The idea is your browser is gonna use machine learning to put you into these cohorts.

29:04 Like, are you a young female lesbian?

29:08 Are you a divorcee woman in her 40s?

29:11 Like what group are you in?

29:12 And then every advertiser that you visit can basically receive like, oh, what kind of person?

29:18 Oh, this is a divorcee who's coming, even if they've never been to your site or anything, right?

29:23 They, you sort of get your flock advertised to you, your group.

29:28 It's not private data, but it's pretty private, right?

29:30 It's like this group, it means a lot.

29:33 Anyway, I thought that this was a pretty big deal on the web and people should check it out.

29:36 So I put that out there for you all to consider.

29:39 What do you all think?

29:40 - I think tracking is a terrible idea and it's mean too.

29:43 I don't have the link to it, but I was reading an article recently about how somebody had, I don't know, they were expecting a baby, so they were looking up all sorts of baby stuff.

29:53 And then they lost the baby with the miscarriage, and they still got tracked for that.

29:58 And so they get stuff, and then somebody, a couple of stores figured out what their address was and figured out when the due date probably was, and then they get like, they keep getting these things, like, your child's probably about four now, maybe they need a bike.

30:14 And they're just, that's terrible.

30:16 Yeah.

30:17 So.

30:18 - Yeah, yeah.

30:19 But here's part of the thing, like all this is not so good, right?

30:22 Like, I mean, they're both not good, but how do you clear your flock, right?

30:25 Like I can hit command shift, delete, and clear my cookies.

30:30 How do you clear out your flock?

30:31 Like you're just, no, you're just a divorcee and it's re-computed every week.

30:34 So like it goes, like you could actually track like the stages of somebody's life, the different groups they've been.

30:40 It's super bad news.

30:41 So anyway, I think--

30:42 - We don't need this.

30:43 We don't need it at all.

30:44 - We don't, yeah, we don't need it at all.

30:46 - People did advertising in magazines and newspapers for a really long time with no tracking.

30:51 - Yep, yep.

30:52 And as I've already pointed out, so do we.

30:54 Not in the newspapers, but nonetheless.

30:56 (laughing)

30:57 Yeah, so anyway, people should check this out.

30:59 That's worth pointing out.

31:00 And then also kind of related to that, I recently started using NordVPN, and this is not an ad.

31:05 I know they sponsor a lot of podcasts, but this is not that.

31:08 I just started using it.

31:09 It's super cool.

31:10 You can set this up to automatically, Like when you log in, just join your VPN.

31:15 Like I go to Seattle right now.

31:17 And it also, it does all that cookie blocking and all those different kinds of things like automatically at the network level.

31:25 So now for example, it automatically does that when I turn on my iPhone, it's just always on the VPN.

31:29 And if I fire up an app that doesn't allow ad blocking, that app is already blocking ads 'cause the ads are blocked at the network level.

31:35 So for example, I've used like Flipboard or like Apple News, like the ads are blocked.

31:40 So anyway, that's worth throwing out there.

31:42 And yeah, that's all my extras, but kind of a privacy intensive one, but I thought they'd all kind of go together well.

31:48 So I ended up making that a thing.

31:50 And then Alexander Siminov says, I believe that human classifier trackers will backfire.

31:58 Yeah, I think there's a lot, I agree with you, Alexander.

32:00 And I think there's a lot of negative effects.

32:02 Like for example, you can tag target and disadvantage marginalized groups.

32:07 And Google actually talks about like, when they detect that enough marginalized groups have been harmed, they'll recompute the flock.

32:14 It's like...

32:15 Enough?

32:16 Yes. Yeah, exactly. It's really Orwellian. I'm not trying to be hyperbolic when I say that.

32:23 It actually is. So people should check that out and just be aware. And yeah.

32:29 Peter, you want to talk about your last item here? JupyterBook?

32:32 Yeah, I'd love to talk about Jupiter book.

32:35 So there are a lot of static site generators for Python as well as for other languages.

32:43 So this is like a good party game.

32:45 How many static site generators can you list?

32:48 Like Sphinx, Pelican, MK docs.

32:50 Do you have any other ones off the top of your head, Michael?

32:53 Oh, I think probably is ghost one.

32:55 I think ghost might be one.

32:58 Like Hugo, all of all of those.

33:02 But I do a lot of my work in Jupyter notebooks, and when I'm working with students, a lot of our notes are in Jupyter notebooks.

33:11 And this package called Jupyter-book is a Python package that allows you to take Jupyter notebooks and build static sites out of them.

33:24 And primarily it's designed so that you can --

33:26 >> That's cool.

33:27 You can build free online books based on Jupyter notebooks, but also Markdown files.

33:35 I've got a little book going.

33:38 >> You could almost put a little scientific website that has some analysis and various things.

33:43 You could put that together as a series of notebooks and publish it, right?

33:47 >> Yeah. You can even do it with interactivity too.

33:51 This is part of the executable books project.

33:55 And kind of the idea is that you'll be able to interact with things like plots if you make them with Bokeh or Altair.

34:05 And the code output that you see in the Jupyter Notebook, that actually came from the code that was written in the Jupyter Notebook.

34:13 And I think that's pretty neat as well.

34:16 And on the docs, there is this way that you can automatically deploy your book to GitHub pages for free, which I think is really nice.

34:27 And then there's also a GitHub so that you can hook into GitHub and then automatically, every time that you push, your book gets republished.

34:44 So every time you change that notebook and you push up to GitHub, now your book gets republished with all of your new content.

34:52 and I think that that's really, really neat.

34:54 Allows you to make like revisions and publish super easily.

34:57 So the--

34:59 - That's cool.

35:00 And you could probably put it on a specific branch, right?

35:03 So if you like, you make all your changes and then you're like ready to push out the next version of the book, you could like push to the main deploy branch or whatever.

35:12 - Yeah, yeah.

35:13 I mean, in your GitHub action, you could set whichever branch you want is the one that kicks off the action that builds your book.

35:22 One thing I'm kind of interested in is could we make a GitHub action that would kick off a build of the PDF of your book?

35:29 And then you could have like a releases page where it would be like the PDF if people wanted to print it out or kind of have more of a hard copy of it.

35:40 I think that's pretty cool.

35:42 And like the book gallery that they have, they've got some awesome titles that they have listed like geographic data science with Python.

35:52 That sounds interesting.

35:53 Quantitative economics with Python.

35:56 The UW data visualization curriculums from the University of Washington.

36:02 How to use a lot of Python plotting tools.

36:05 - Oh yeah, this looks super like it came out of Jupyter, but it's a legit website.

36:10 It has a read the docs type of feel.

36:12 - Yeah, yeah, definitely.

36:14 And up in the right-hand corner of these, You've got these buttons that you could download a PDF or download the notebook.

36:23 You can launch a Bender instance so that you could run that Jupyter notebook.

36:29 And you can have a default button that'll automatically take you to GitHub where that notebook is hosted.

36:36 So it's pretty slick, I think.

36:38 - Yeah, this is super cool.

36:40 Brian, as a book author, what do you think?

36:42 - Well, it's one of the things that confused me when I was thinking about this is, and it did with Jupyter Notebook in the first place is, what does a book mean if it's not a book?

36:53 This idea of a book is not a book anymore, it's something else.

36:59 I never really got it why Jupyter Notebooks went to the, I don't get the tie-in between book and book, but maybe somebody can explain it to me.

37:09 >> Yeah. It's blurring that release line, that it's officially version one of the book and version two of the book.

37:18 If you do it, every single push is a new version, then it's sort of like just rolling like CICD book release, which I think is kind of neat.

37:28 But in my area of teaching engineering, textbook costs are huge.

37:34 Textbooks can cost hundreds of dollars for college students.

37:37 So if there's a way that we can make a lot of open education resources books, I think that would be great for college students.

37:46 >> I really like the design of having the table of contents on the left of the book, and then on the right, there's the contents of the individual page.

37:55 So you can jump to it. That's a really cool idea.

37:58 I actually was joking a little bit.

38:00 I really think that would be cool if maybe it already does this, but if there's a way to turn one of these into a into an e-book or a PDF from this.

38:13 >> Where's the Kindle version of this?

38:15 >> Exactly. I'm not even joking.

38:19 I think a lot of these sorts of things would be great to be able to throw onto a Kindle to be able to walk around and read.

38:26 >> Yeah. You can definitely output PDFs and LaTeX documents with it, but I don't know about Kindle e-book format.

38:37 Maybe somebody can like write that in and give him a contribution.

38:42 That'd be cool.

38:42 >> Yeah.

38:43 >> Yeah, for sure. Sam Morley says, "Having free interactive coding textbooks would be a real game changer for a lot of people, particularly somebody figures out how to make this portable to mobile devices." Yeah, for sure. A couple other comments also from Sam.

38:59 He says, "Congrats, Brian, about your badge." Nice to know that NASA does test their software.

39:05 I bet they test the heck out of that software.

39:07 (laughing)

39:09 Before you set it up, it's gotta get tested.

39:12 Maybe to a fault, I don't know, but it's gotta get really, really tested.

39:16 And then also just while I'm in the comments, James Abel, hey James, says, and Mike will be presenting at the Python meetup tonight.

39:23 Yeah, I didn't necessarily think to cover this 'cause it's so close to, you know, it's like six hours from when I'll be presenting.

39:28 But yeah, I will be doing a memory deep dive sort of live coding type of thing over there.

39:34 the Python meetup in San Francisco, virtually because that's the world we live in.

39:39 But yeah.

39:39 >> Nice.

39:40 >> Very cool. Then John Sheehan says, "It's a short hop from LaTeX to EPUB with Pandoc." Yeah, you may all be right there.

39:51 Well, I did my extra section already.

39:53 Brian, you got anything else you want to do a quick shout out to?

39:55 >> Yeah. Speaking of virtual, Python, The PyCon ZA, the South African PyCon is coming up.

40:04 I want to shout out to them.

40:06 I don't have a link to them up here, but it's a conference that's going to be on the 7th and 8th of October.

40:14 It'll be entirely online.

40:16 I was just curious because it sounds like I was curious about the whole virtualness.

40:22 It's a little bit early in the morning for us, but they are, so I had a little bit of an email exchange.

40:29 they are going to be able to have some prerecorded.

40:33 You can prerecord your talk if you want to.

40:35 If you're afraid of doing it live in the middle of the night, don't worry about that, but you can submit anyway.

40:43 But they'd like to have the author be live while it's playing so they can answer questions and stuff, and that seems fair. The second update is, last week we covered dead dependency.

40:56 Or dead dependency?

40:57 I don't know how to say that.

40:59 >> Dedependencies? I don't know.

41:02 >> One of the things we said was, it's too bad that it doesn't do PyProject.toml, and within a day, it was supporting it.

41:13 There was an update the very next day that it supports both Flit and Poetry with PyProject.toml.

41:23 Since it's doing PyProject.toml, I imagine it'll do setup tools as well.

41:28 if you're doing pyproject.toml setup tools.

41:31 >> That's so awesome. Well done, folks about updating that straightaway.

41:34 I mean, isn't it amazing, Brian?

41:36 We'll talk about random things like this is cool, but and then like the next day, we get the dead dependencies folks, fix, added pyproject.toml support.

41:46 I talked about being as though it needs a way to have indexes next episode.

41:49 Here, they heard us and they added indexing features and so on.

41:54 >> Part of it's the podcast and also part of it is, since I'm doing research for the podcast, I just reach out to people more often and say, "This is a cool project, but it doesn't do this.

42:05 Is there plans to do that?" Project owners love to hear back from people.

42:11 Even if I wasn't, I think other people should do that more often.

42:15 Don't just complain about something, ask somebody if it's going to be supported or if you can help out.

42:19 >> Yeah, absolutely. Peter, anything you want to throw out there?

42:22 Any little extras, tell people how they can find your book or something like that?

42:26 Yeah, if you search for problem solving with Python on Amazon, or there's a free open education resources version online too. And one little shout out I got is our community college is looking into how to integrate artificial intelligence into curriculum. So if anybody's in the Portland area that does AI stuff, reach out to me. And I'd love to talk to you about how we can and integrate AI into community colleges.

42:55 - Oh yeah, that'd be really cool.

42:56 - Yeah, it's a super fun project.

42:59 - Awesome, it does sound fun.

43:00 You all ready for a joke?

43:01 This is a team effort here.

43:03 - Yeah.

43:04 - I'm gonna close the other tabs.

43:06 There we go.

43:06 So, that's a little large.

43:08 This is again, one of these funny code comments.

43:11 I guess I'll go last.

43:12 Brian, you wanna do, oh, let's have Peter go do the first one.

43:16 So these are from comments that were found in RealCode supposedly.

43:22 And then they're just kind of funny.

43:24 Peter, you want to do a first comment?

43:25 Or just a few lines?

43:26 >> All right, our first comment is, "Dear future me, please forgive me.

43:31 "I can't even begin to express how sorry I am." (laughing)

43:37 >> And here we go.

43:39 >> That's great.

43:40 >> All right, Brian, this is one that, I don't know, is here to take on the optimist.

43:44 I don't know, what would you, I'm not sure how you put this, but it's a exception handling block.

43:47 What do we got?

43:49 >> Okay, so yeah, a try block with a catch SQL exception, and a comment that says, basically, without saying too much, you're screwed.

43:58 Rightly and totally.

43:59 >> [LAUGH] >> And then another catch exception, like a raw exception, says, if you thought you were screwed before, boy, have I got news for you.

44:11 >> [LAUGH] >> That was my favorite, that was so good.

44:15 >> [LAUGH] >> And I'll just close it out with one of these ones where you just kind of have to accept life, I guess.

44:21 And it says, "This code is crap. This is a crap code, but it's 3am and I need to get it working." [laughter]

44:29 Yeah.

44:30 Oh, boy.

44:31 Okay. I wanted to share one more.

44:33 So, because I was talking with my coworkers the other day and we were talking, somebody actually mentioned how hard that we had a problem with cache invalidation.

44:44 It reminded me of that old joke of there's only two hard things in computer science, cache and validation and naming things.

44:51 So I went to look it up and then I found this other joke.

44:56 There's two hard problems in computer science.

44:59 We only have one joke and it's not funny.

45:01 [LAUGHTER]

45:06 >> That's great. I love it.

45:09 We'll round it out with Nick Harvey here.

45:11 versus exceptions while handling exceptions are just the best.

45:14 Indeed they are.

45:15 - Yes.

45:16 - Indeed they are.

45:18 All right.

45:19 Well, Brian, it's great to chat with you and talk about things as always.

45:23 - Good to talk to you.

45:24 - Yeah, and Peter, thanks for joining us this time.

45:26 - Thanks for having me.

45:27 - Yeah, great to have you on the show.

45:28 Bye everyone.

Back to show page