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


Transcript #341: Shhh - For Secrets and Shells

Return to episode page view on github
Recorded on Tuesday, Jun 20, 2023.

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

00:04 This is episode 341, recorded June 20th, 2023, and I am Brian Okken.

00:11 I'm Michael Kennedy.

00:12 This episode is sponsored by us.

00:14 If you want to support us, you can take one of the courses at Talk Python Training.

00:19 There's an excellent pytest course there.

00:21 And please check out Test & Code Podcast and a book about pytest if you're curious.

00:26 We also have Patreon supporters, so thank you Patreon supporters.

00:30 If you'd like to talk to us or suggest something, we've got a contact form at pythonbytes.fm, but you can also send us something on Mastodon.

00:42 We're all at fostodon.org,@mkennedy@bryanokken and @pythonbytes, and we check those regularly.

00:51 Let's hit it off. Michael, what do you got for us for the first topic?

00:54 I'm going to back up what you just said, Brian.

00:57 Okay.

00:57 The very first item comes to us from Mario Munoz.

01:00 Thank you, Mario.

01:01 Right on Mastodon.

01:02 Awesome.

01:03 Mario says the pedantic roadmap looks interesting.

01:06 I especially like the combination of analytics and observability.

01:10 Looking forward to what the team ends up building.

01:12 So the first thing I want to talk about is this thing that Mario referenced.

01:15 What did us at the identic 2.0 roadmap or more specifically, Pydantic Incorporated.

01:22 So recall Samuel Colvin, excellent guy, got to hang out, we both got to hang out both with Mario and Samuel at PyCon this year, which was fun.

01:29 And he announced Pydantic Incorporated, which is a company around building data tools, somewhat around Pydantic and Rust and those kinds of things for the Python and larger base, larger developer space.

01:45 So, but it didn't have a ton of details of exactly where they were going.

01:49 So this roadmap is two things.

01:51 It is a hint on what Identik Inc is going to be about, what kind of tools Samuel and team are going to offer.

01:58 There's also a call to action to help them choose the right direction so that when they go off building things, they might build something that you actually would want to use.

02:07 - Oh, cool.

02:07 - Yeah, right?

02:08 And so it says, look, in return for giving us honest feedback, you have the option to get early access, get inside the closed beta, all those things for the platform.

02:19 And if you're familiar with Pydantic, you know it's all about data exchange, data validation, strong schemas where there are none, and those kinds of things, right?

02:27 Bringing sanity to your data, as they say.

02:29 So there's two tacks here.

02:31 Samuel says, "Well, first, before going into "what we might build, I want to tell you "what we're not building.

02:36 "We're not building a new database or query engine.

02:38 "They're not going to be building "or pretending that non-developers or AI "can do the job of a developer." They want to accelerate developers' workflows.

02:47 For example, they're going to have CLIs before they have GUIs and they're not doing 314 integrations into every conceivable technology, right?

02:55 Think Zapier or something like that.

02:57 If this, then that, and finally, they're not going to have an SDK for every language.

03:02 They're just focusing on a few languages with Python right up front.

03:05 I'm sure.

03:05 So it says, how can you help?

03:07 Well, give us feedback on the five different things that they're considering.

03:11 Okay.

03:11 Okay.

03:12 Number one, this is the one, this is the one that Mario like.

03:16 Python Analytics and Observability, a logging and metrics platform with tight integration with Python and Pydantic, designed to make the data flowing through your application more readily usable for both engineering and business analytics.

03:31 If you're doing say, FastAPI, exchanging data over at Python Bytes, like all the stuff coming to you has come through Pydantic classes because we're using Beanie as the database access layer, which is based on Pydantic if you don't know.

03:45 Okay, so that's the analytics and observability.

03:48 Another one is a couple of angles here around data gateways for object stores.

03:53 So think S3, something, Azure Blob Storage, those kinds of things, Azure Ocean Spaces. So gateway for your object store.

04:02 So add validation, transformation, and cataloging in front of things like S3 with schemas defined and pedantic models and then validated by their REST service, or same idea but integrated into your existing data warehouse.

04:15 Number four is a schema catalog.

04:17 For many, Pydantic already holds the highest fidelity representation of data schemas.

04:23 If you had a schema catalog, it could take that to the next level, serving as an organization-wide single source of truth for those schemas.

04:30 If you've got a bunch of different apps or whatever, especially across language maybe, that languages that talk to certain data stores, certain APIs, might be some central store that says, "This is what it looks like, and here's how you maybe generate classes to talk to it.

04:46 Finally, dashboards and UIs powered by Pydantic models, a managed platform to deploy and control dashboards, auxiliary apps, and internal tools, where everything from UI components like forms and tables to database schema would be defined in Python using Pydantic models.

05:01 So, we go into a bunch of details with code samples of what they actually might look like if you were to go down one of these paths.

05:08 But I'm just going to leave it here and say, encourage everyone who cares about this to go participate in Samuel's survey so that they get the right feedback that they need.

05:17 >> Is all of the above an option?

05:19 Because that all sounds great.

05:20 >> Yeah, that sounds pretty good, doesn't it?

05:22 >> Yeah.

05:22 >> Some of these don't really apply to me like a schema catalog for the whole company.

05:27 It's me, sometimes me and another developer.

05:30 But if you were in a large organization, even a handful of people or a couple of software teams, it starts to get real valuable.

05:38 >> I think they all look great, but the data gateway for data warehouses and for object stores, it sounds really cool because I mean, that's actually they all look pretty good.

05:51 I was curious, so you use Bionic now, right?

05:55 I know one of the things it does is it filters out stuff, it sends an error code or something.

06:03 If you try to send data and it's not the right type or the right kind of data, Is that reported somewhere or is that part of the analytics and observability thing?

06:13 >> That would be analytics and observability because right now it just appears as an exception.

06:18 If you have integration with something like Sentry or one of them other things, then it would report it as an exception with some details.

06:24 But I don't think that's what they're thinking.

06:26 I think they're thinking much more, even possibly like success data going through.

06:31 >> Oh, yeah. Really see how people are using an API or using an entry point.

06:38 I think that looks pretty cool.

06:40 Yeah, it does look pretty cool.

06:42 Nice.

06:44 Over to you.

06:44 I'd like to talk about shells out of the web and into talking with your operating system, kind of.

06:53 So I want to highlight an article called the right way to run shell commands from Python.

06:59 So I guess it's not really necessarily shell commands, but kind of.

07:03 So when you're writing, some Python programs have to interact with the operating system for things like file system things or starting other applications and whatnot.

07:14 And there's various ways to do that, but one of the I guess, I guess that's kind of part of this article is talking about some of these tools.

07:22 So there's, it starts off with talking about natively into Python. So some things that you might not when you start having to think I have to interact with the shell, you might not have to actually.

07:35 Like there's pathlib that can do quite a bit for you.

07:39 And you can create temp files and stuff like that with a temp file package.

07:44 And there's shutil, which is, I guess, pretty good.

07:49 And I've never used syslog or signal, but those things are around.

07:53 Okay, so those are things built into Python.

07:56 So make sure you check out the things built into Python already.

07:59 But then there's a couple other different modules that might help.

08:04 The OS module, he's kind of going this backwards, is probably don't directly reach for the OS module.

08:13 But there's a few things in the OS module that are really great, like to get your get environment variables, like get the path variable or something, and use OS get, get env.

08:23 There's a few other things like getting username and stuff.

08:27 But I guess get you name, I don't know what that is. Is that username?

08:33 I don't know. But anyway, the...

08:36 So there's a few things in the OS module that are interesting that you're probably not looking there.

08:42 I often have used subprocess, and this is, I guess, a reminder that with modern Python development, if you're using subprocess, you probably want subprocess run, even though there's a lot of other legacy stuff in the subprocess package.

09:01 P open, yeah, P open, for example.

09:04 Yeah.

09:04 Yeah.

09:04 And call, you probably don't want those.

09:07 What you probably want is run.

09:08 Run is kind of a catch-all that works for most things now.

09:13 Because I really like, doesn't show it in the example, but there's options in run to just turn on, like, encoding.

09:24 Here's the encoding bit that says, you know, turn it on.

09:27 Capture the standard in.

09:28 Oh, yeah, there it is.

09:29 capture output equals true is so that you can capture the output.

09:34 That's often what I want to do if I'm running a program is find out what its output is.

09:39 So this is handy.

09:41 However, one of the things that I haven't used, this article Martin Heinz mentions, there's one right way and for his opinion, the right way is use the third-party package, which is a very unsearchable package name called the SH.

10:01 >> You don't even want to talk about it.

10:05 >> So I have no idea if anybody's written about this because it's really hard to Google SH because it's everywhere.

10:12 But it's a neat package.

10:14 So I looked it up, of course, and it's tested on all sorts of versions and downloaded a ton.

10:23 So 3.9 million a month.

10:26 Look at the stars 6.6 thousand stars.

10:29 So fairly popular package.

10:31 So most of you probably already know about it.

10:33 But the just that's Brian.

10:35 >> It's just as we did it though.

10:37 But there's a, it's kind of neat.

10:38 There's what it is, is you've got commands that are, that are just kind of look like they did before.

10:44 Like LS is sh.ls.

10:47 That's kind of neat. And you can pass in arguments.

10:50 What's some of the others like, I'm going to go over to the documentation.

10:55 You've got LS, you've got like, what else?

10:58 Oh, yes, it just has LX examples.

11:02 Get.

11:03 Yeah, I guess that's cool.

11:05 Anyway, find.

11:07 There's a few others.

11:08 There's a bunch of others.

11:09 Actually, it's a pretty big package and it isn't a rewriting of all of these things.

11:15 It's actually talking to your operating system.

11:17 So that's the catch.

11:18 It's talking to a Unix like operating system.

11:22 So it works on Linux.

11:24 It works on Mac.

11:25 It will not work on Windows apparently.

11:27 >> Unless you're using Linux subsystem for Windows.

11:30 Wait, yeah. Linux subsystem for Windows.

11:33 >> Maybe.

11:34 >> Linux, I guess it is.

11:36 Yeah. Anyway, the embedded Linux, you can run on Windows if you want.

11:39 >> Okay.

11:39 >> Because that's just Ubuntu.

11:40 >> Perfect.

11:41 >> One thing I like, if you scroll just a little bit here, so I can point at you on it.

11:44 It says, actually it's down one page.

11:46 It says, what you can do is you can say sh.ls, or you can create a command like any executable you want, you can just say sh.command and you give it the path to the executable.

11:59 Then the arguments can be passed as if they were a function call on that resulting thing.

12:05 Instead of chaining it all together, you could say like create the git command and then you could do a git parentheses checkout, main or prod or whatever.

12:16 That's a pretty cool way to integrate with the command line there.

12:19 >> Yeah, that is pretty neat.

12:21 And that'll work with even your like, like you said, >> I think so. If you look at the next example down right below the ls underscore command.

12:28 Yeah. Custom CMD is what it says. Yeah.

12:30 >> So your own command, you can have it run something and have the arguments listed.

12:36 It's pretty neat.

12:37 >> It could even be another Python command.

12:38 You might think, why would I ever do that in Python?

12:41 But you know, maybe that's coming out of a different virtual environment with like some setup that's got a bunch of things that you're not integrating into your system.

12:49 I don't know. There might be reasons.

12:50 Or you're using, so like if you're using, what, click or was the typer?

12:58 They have built-in test frameworks, but if you have another, a different command line interface that you're testing against, it might not have a way to run the commands directly. So you could use this to run a Python command for testing.

13:10 So, neat.

13:12 A couple of live stream comments, Brian.

13:15 Michael says, not Michael, Michael W.

13:17 Every time I fall back to OS.System out of habit, I feel like the old guy measuring his gas mileage in rods for hedgehogs head.

13:25 I love it. Henry Schreiner out there says there's also Plumbum, of which he's been a maintainer since 2015, similar to SH.

13:35 But he's not really up on them both well enough to give a comparison.

13:40 He doesn't know SH that well.

13:41 >> I will check out Plumbum. Nice.

13:44 Cool. Thanks guys.

13:45 >> Well, what you got for us?

13:46 >> I think, yeah, we got one more, don't we?

13:49 Got another one.

13:50 Over here, I've got-

13:52 >> Or do we want to do it in?

13:53 >> Well, encourage people to check out the courses over at Talk Python Training.

13:57 Always supports us that way, including the pytest course.

14:00 Check out the new mobile app that we built and check out the pytest book.

14:03 Really supporting our work that way is really the best way to support the podcast and visiting the sponsors when we have other sponsors.

14:11 But I want to talk about buying and selling your data.

14:14 So there's an article on PC Magaball Places that I got this that talks about a report released by the Office of the Director of National Intelligence, ODNI, which pretty much how I'm going to refer to them from here on out.

14:30 ODNI released this, declassified this report from January 2022.

14:36 And the headline is the US says, the United States says, yep, we're buying your data, including your embarrassing secrets. Digital information can be purchased from commercial data brokers and de-anonymized to ID the person it is tied to, including US citizens, says the ODNI. That's a little disturbing. So when you, you know, when you go to, you know, that ad-ridden website that has 29 trackers and 42 ad networks on it, right, They're collecting a bunch of data, but that same network is on a bunch of other sites and they're pulling all those things together. We have these data brokers who gather all that information, but also really, really frustrating things where they buy and sell your credit card data and you don't get to say whether or not you want your credit card data for sale. I'm pretty sure it was T-Mobile. There's one of the mobile carriers who was selling your location data and you didn't get to opt out of it. Just like, well, you're using your phone, And I just, so why isn't that for sale?

15:33 And all of that stuff gets combined into like a profile on you, right.

15:37 A shadow profile.

15:38 And so the news is that the declassified report is here.

15:43 It talks about how the U S has been buying large amounts of this type of commercial information for purposes of spying and other intelligence related.

15:53 Thanks.

15:54 Right.

15:54 And to some degree, I support what the U S does with national intelligence.

15:59 Do you want them to keep us safe and things like that?

16:02 On the other hand, this seems really out of bounds, right?

16:05 Like I think the report itself even said the declassification of the report prompted Senator Wyden to call on the US government to rein in unchecked surveillance.

16:16 And according to the report, ODNI does not even know which agents are doing this and said if the government can buy its way around the fourth amendment, the required must have a reason to search people and their properties due process, then what's the point of it, right?

16:33 So that's basically what this report goes through and talks about.

16:37 And yeah, it's not terribly scary, but it's just another reminder that you should be, when you go to a website, like if you go to say cnn.com or somewhere else and you get a big pop-up, don't you wanna support us?

16:52 Unblock your ad blocker, right?

16:54 it's not just about selling the ads, right?

16:57 It's about, you know, willingly feeding yourself into surveillance pipelines, into retargeting pipelines that might change the price you pay for insurance or determine whether or not you're eligible for a mortgage, not because of what you present, but because of, you know, some back channel thing that has been discovered about you in some way that you didn't intend to, or probably, you know, maybe doesn't even make sense, right?

17:22 - Yeah.

17:23 - Accidentally clicked a link you're, you're marked as something that you didn't necessarily mean to be.

17:27 Right.

17:27 So anyway, you can, people can look through this.

17:30 I just want to encourage, encourage folks that like, as they think about working with ad company, they think about creating these products, just, you know, probably less ads, right.

17:38 Over at Python bites, go to one of these.

17:41 We have our ads right here.

17:42 I have like the most intense ad blocking you can get pretty much.

17:45 And what do we see right there?

17:46 An ad from influx data, because we're not retracking you.

17:49 We're not targeting.

17:50 You don't see a cookie banner because there's no cookies, right?

17:53 There's no third party cookies.

17:54 And, and, this, this is certainly possible.

17:57 So I encourage people to use browsers such as Vivaldi or brave, not Chrome that do not track you as well as next DNS.

18:05 But I put a link to that in the show notes.

18:07 So, next DNS, I've spelled that right.

18:10 Which is, this is awesome.

18:12 I talked about it before, but like on your mobile phone apps.

18:14 So for example, Flipboard is a thing you flip through when your magazine ads or Apple news, when you open it up, those are still full of ads.

18:21 even if you've got an ad blocker installed on your browser, right?

18:24 But once you put this on your local network, then everything has ad blocking built in, even your mobile apps, which is pretty excellent.

18:31 >> That's pretty cool.

18:32 >> Yeah.

18:33 >> I highly encourage people with lots of non-tech savvy people in your household to turn this on so that people can be protected.

18:43 Anyway.

18:43 >> The only trick is it's a little bit challenging to turn it off because it's like a router setting for the whole system.

18:50 >> Okay.

18:50 And so what you can do is you can set up DNS over HTTP on your browsers, right?

18:55 So that way, even if you're not at home, it still works.

18:58 But also, I have a second browser, a second browser, that if I have to turn off that, I set its HTTPS, or its DNS over HTTPS, to a non-blocking one.

19:09 So I can turn on the ads with that browser explicitly, like to get around this, so I don't have to configure things.

19:14 But it's a tiny bit of a hassle, but it's super worth it.

19:16 - Yeah, another thing, you talked about ads, but there's also tracking analytics.

19:24 So a lot of people are not doing any ads, but they're just curious about how good their site is working and stuff, so they turn on Google Analytics or some other analytics.

19:34 And a lot of analytics are kind of awful about collecting and selling data.

19:42 You might get a little bit of value.

19:43 Google gets a lot of value from seeing everybody that goes to your website.

19:47 So I do like a lot of people switching to other types of analytics.

19:52 Collecting download counts, a lot of times your host can do that.

19:56 You don't need to put that in cookies or anything like that.

19:59 >> Exactly. That's what we did as well.

20:01 I do want to point out one final thing.

20:03 I do find it ironic.

20:05 I don't know really what you do about this in life.

20:07 So this article is on PCMag, which is a well-written article by Michael Pan.

20:12 If I go to search that in Taggy and I pull it up, Taggy has like a privacy report on the right hand side of all these things.

20:19 19 trackers and blockers, including advertising, Google email aggressive, fingerprinting, email invasive, fingerprinting, on and on and on.

20:28 It's like, well, okay.

20:29 Wow.

20:30 As you go to learn about how this is not ideal, you only get 19 trackers put on you.

20:36 Yeah, yeah.

20:38 Okay.

20:40 Maybe one final thing here is Daniel points out Piehole DNS ad blocker has a feature that lets you disable ad blocking for a period of time.

20:47 Interesting. And so the next DNS thing is like Piehole as a service, basically.

20:52 So they're similar. Interesting. Okay.

20:54 All right. Well, on a slightly brighter note, maybe, let's talk about pytest.

21:01 Yes.

21:02 So Frank Wiles wrote an article for RevSys titled, "Pro Tip, pytest Fixtures Are Magic." They're not really magic, but they kind of look like magic.

21:13 They seem like magic.

21:14 So I just wanted to highlight this because it was a pretty well, fixtures are the part of pytest that is the brain shift.

21:23 So when you get into pytest, understanding fixtures is the big thing that is difficult to get your head around.

21:32 So that's why I really appreciate the article talking through that.

21:37 Fixtures, if anybody is unfamiliar, you can kind of think of them like set up and tear down they run before and after your test and well parts of it run after if you set it up if you need to the now revsys does a lot of work with Django so there's this is articles talking about the idea of like you To test your like let's say you have a it has a like is the hypothetical scenario that you got a feature where like you're testing a workflow we have you want your you need to you gotta have different users you need to create an owner because you want to see if you can filter swear words out of comments So in like some in and so it like in get up or something you'd have to create an organization and then create a user and then have a public repo in a private repo to be able to test your functionality and there's a lot of setup and there's often a lot of setup needed for a lot of a lot of software projects so fix your helpful so that's the setup you get it's through goes through just talking basically about how to use them.

22:45 Fixtures are just a function that's decorated with pytest.fixture, and you use it by, in the test, you just call the, you put the function name, the name of the fixture in the parameter list, and it magically just happens for you. And that's the magic part.

23:00 One of the things I really like is it goes, kind of goes into depth of even more than that, they're kind of cool, you can compose them, fixtures can use other fixtures and you can use more than one it's kind of neat goes through talking about also that they can return things so they can return either just simple data like strings or numbers but they can also return dictionaries and objects and instantiated things and they can even return a function that can create things for you so So it's kind of a neat example, he returns, he has a fixture called makeUser that returns a new user created, it returns a function that you can call to create a user with parameters and stuff. So that's kind of a neat example.

23:51 It's like a fixture factory.

23:53 Yeah, like an object factory returned as a fixture thing.

23:58 So yeah, and another example with like a make admin fixture that returns a function that can create an admin user.

24:08 So that's kind of neat.

24:10 One of the things that was new that I hadn't seen, which is kind of a cool idea, is how to organize your fixtures.

24:16 So he talks about putting...

24:19 He's got like, let's say, a big Django project and each of the different Django applications within the project have their own tests and within those there's a fixtures file you can't use that directly this is a trick that they're doing is sticking the fixtures in a file called fixtures and then at the top level having a conf test file that imports those just imports everything out of it and at first i was like why would you do that why don't you just put conf test files there And his reason, whether you think he's sane or not, the reason is so that you can keep the code local to the application that's using it.

25:00 Maybe it's even a sub project or sub Git repo or something, who knows.

25:07 But at the top level, you can have access to it. So any test can access any fixture within any other application.

25:15 That may or may not be a good thing for you, but it's kind of a cool idea.

25:19 And then he talks about how plugins can have fixtures also. There's the excellent pytest Django plugin that has things like DB which marks your tests, creates the database for you before you start, and a client that, you know, it makes it, I'm learning Django right now and I'm using pytest Django and it's pretty awesome.

25:42 And then RevSys itself has an extension called Django Test Plus, which has a thing called TP, and that has some extra cool features that aren't out of the box with pytest Django.

25:58 So that's kind of fun.

25:59 The last bit of--

26:00 And even get requests like within the app.

26:03 Yeah.

26:03 Yeah, and test for the response.

26:05 Yeah, a lot of-- kind of like what you would do with requests, but inside without actually going through the network.

26:09 Right.

26:10 And it's very similar to the unit test framework around Django, built into Django also.

26:18 I'm glad that the Django Test+ and the Django pytest plugin are pretty consistent with the unit test, so if you want to switch back and forth, it's not that hard.

26:30 And as a reminder, you can run unit test functions from pytest also, but why would you?

26:36 The last bit I want to highlight, and I have reached out to Frank, but I haven't heard anything back.

26:44 He has an example on the auto use. It's just wrong. So don't take his word for it.

26:49 The auto use is cool. Auto use makes fixtures just run automatically before your test without having to call them out.

26:57 But it's really hard to come up with a good toy example for why you'd use it, because there aren't very many good examples for why you'd use it.

27:04 It seems magical at first, and then it suddenly doesn't take long to go, "Wow, I really should be careful with that." Because you should be careful with it.

27:11 This example shows that a global value being set with a fixture, and that's just not true. It doesn't do that.

27:18 If you want to get the object, the return value of a fixture, you have to name the fixture within the test.

27:25 So that's about it, really. It's a pretty fun introduction to fixtures.

27:30 Yeah, they could fix it up by just having a variable in the module and saying global and then set its value, right?

27:36 Like you would with any other Python function.

27:37 >> Yeah.

27:38 >> If you wanted to.

27:39 >> The other thing I wanted to point out is he says, tempter is a really cool built-in fixture.

27:44 It is, but it's deprecated.

27:46 Temp path is what we try to get people to use now because it uses pathlib and pathlib is awesome.

27:53 >> Indeed, Tony Sherman has been on the same journey and says, "It seems so great, auto use." at the beginning and things blow up quickly.

28:02 >> Yeah.

28:03 >> Brian, can you open up a website for me?

28:05 >> Sure.

28:06 >> Before we move on as a piece of follow-up for plausible.io.

28:09 Pat Decker, former co-guest host about a year ago, says plausible is the open-source option alternative to Google Analytics, which is GDPR compliant and doesn't set third-party cookies.

28:22 If you scroll down, you can see that somewhere in there.

28:24 >> Cool.

28:25 >> Why did I ask you to open it?

28:26 Why didn't I just open it on my share?

28:28 Because my next DNS blocks it like it does everything else until I like clear the DNS out of my web browser, which is good.

28:35 Oh, it finally came back.

28:36 It took a while, even though I allow us to did so I could pull it up.

28:39 But yeah, it's, it looks pretty interesting.

28:41 I had not heard about that.

28:42 So thank you, Pat, for that shout out.

28:44 That certainly seems like a, I know nothing about it, but what I've already learned is it looks like a, a mega improvement over the other types of retargeting feeding third party cookie drop in analytics systems.

28:56 So pretty cool.

28:57 Thanks.

28:57 Cool.

28:58 Yeah.

28:58 I have no extras.

28:59 You have no extras.

29:01 Okay, well I got a couple of extras.

29:03 I ran across this fun tool, or fun contest.

29:09 The International Obfuscated Python Code Competition.

29:14 I know that those existed for C and Perl, but I didn't know that we had a Python one.

29:21 Submissions are due tentatively by August 30th, and I have no idea about who's running this.

29:29 But it looks fun.

29:31 Oh, probably the judges.

29:33 So Julius, Kevin, Shane, and Anonymous will judge you.

29:37 Yeah.

29:38 But I'm just curious if...

29:42 I know that it's possible to write terrible Python code, but I'm looking forward to seeing the results.

29:48 Next up, there's a quick...

29:52 We talk about a lot of things that are using Rust to speed up parts of Python.

29:57 So there's a decent article called "Porting Python Objects to Rust".

30:02 I think it's decent. I haven't walked through it to see if you can actually do this.

30:05 But the recommendation here is if you've got a Python project that you'd like to replace all or part of it with Rust, go slow and port pieces of it at a time.

30:16 Iterative porting.

30:18 I like, there's a lot of things that I've thought about or cool Python tools that'd be kind of neat if like part of it was speeded up with, sped up with Rust.

30:27 - Maybe.

30:29 - Step one, learn Rust.

30:30 - Step one.

30:31 Or step one, have a podcast where you convince other people to write it in Rust.

30:36 - That's right.

30:38 Also an option.

30:39 - Yeah, anyway, that's all I got.

30:40 - All right, cool, those are good.

30:42 Final one here is Henry points out that scientific Python use is possible on their website, presumably.

30:47 >> Okay.

30:48 >> Okay. Ready for a joke?

30:50 >> Well, almost. I would like to encourage people to submit questions to our Ask Me Anything.

30:58 Let's see, do we have a link for that?

31:01 >> We do have a link for that.

31:03 The link is, which I was going to mention that and somehow didn't, didn't I?

31:08 It's pythonbytes.fm/ama2023.

31:11 I'll put a link in the show notes.

31:13 >> Okay. Link will be in the show notes and it'll look something like this.

31:16 So indeed, and we've got a bunch of great comments and thoughts and very kind messages in there as well.

31:21 So much appreciated.

31:23 We're going to do our ask me, ask us anything in July 11th.

31:29 If we can make it work, then we'll confirm as we get closer, but that'd be a fun one for a lot of people to attend live because they could also ask us stuff.

31:35 Yeah, it'll be good.

31:36 Sure.

31:36 Well, all right.

31:37 Ready for a joke now?

31:38 Yes.

31:38 So stack overflow is pretty awesome, right?

31:41 Brian?

31:41 I mean, it's a huge resource if you want to find something, right?

31:45 you got some kind of problem, especially if it's kind of outside the realm of your usual expertise.

31:50 You're like, ah, I gotta work on, gotta work on this JavaScript thing.

31:53 I don't know how it works.

31:54 If I just Google it, maybe someone else had the problem or you know, something's not working, yeah?

31:59 But as a social network, it can be a bit of a rough and tumble place.

32:02 Come in here and it has this picture of this guy wearing a t-shirt offering like a bouquet of lavender flowers or something.

32:11 he just picked up off of the, you know, like along the side during some protests and there's these like cops or military folks in like armor and he tries to offer it to one of them and says, me asking a question on stack overflow.

32:24 And then immediately they swarm him and like, you know, put him in a necklock and stuff and it says, Mark does duplicate.

32:30 It's always marked as duplicate.

32:32 Yeah.

32:33 And that's the easy one.

32:35 yeah, it's can be a brutal place.

32:38 Yes, it can.

32:40 I find it better as read-only.

32:42 [LAUGHTER]

32:43 >> Yeah. But it is one of those handy places that happens to have, like when you just take your actual error message and Google it, it often lands in Stack Overflow somewhere.

32:55 >> Yes, it does. It's often helpful.

32:57 >> Yeah.

32:58 >> If you're willing to take a little abuse.

33:00 >> If you want to get a headlock, yeah.

33:02 >> Yeah, exactly.

33:03 [LAUGHTER]

33:04 >> Nice. I also heard that recently, There's been a bunch of Stack Overflow, like issue moderators and stuff that-

33:12 >> Reddit.

33:13 >> Oh, was it Reddit?

33:14 >> Reddit blackout.

33:15 >> Yeah.

33:16 >> So the CEO, I forgot the guy's name, the CEO of Reddit decided that they were going to monetize the API of Reddit because like Twitter did a little bit, Twitter wanted to kill off the third-party clients just to make them go away so they had more control.

33:31 That was one of the things that happened when us took over.

33:34 So they didn't quite want to do that.

33:36 They wanted to charge money for the API because they're not showing ads for the mobile apps.

33:40 And Apollo was the mobile app that was most is, I guess, maybe was more accurate, was most popular.

33:46 And in order for that app to keep running, I think they have to pay $20 million a year in API fee call fees.

33:53 So they're like, well, we don't make that much money.

33:55 We're shutting down.

33:56 And so they're effectively killed off all the third party clients, which set off a protest And the protest manifested in that people who are moderating popular Reddit areas, sub-Reddits, mark them all as private to say, you know, we're taking our content, our contributions we put into Reddit off as a way of protesting what you're doing for the community to like close it down and, you know, extract money from it basically.

34:22 Yeah, but also, I mean, also Stack Overflow.

34:24 So Stack Overflow is a, I don't know, six months ago, is like blocked because of people like it.

34:34 Obviously, I think everybody on our that's listening here knows what Stack Overflow is.

34:38 But people are taking the questions and just going and pasting them in ChatGPT, getting the answer and putting them back in the Stack Overflow.

34:45 That's lame.

34:47 What even?

34:49 So apparently, that's blocked.

34:52 >> Yeah.

34:53 >> Well, I sure had fun talking with you today and talking with everybody.

34:57 and just excited about the future of not using AI for my software.

35:04 Thanks, Michael.

35:04 >> I have to go back to writing to myself as well.

35:06 >> Yeah.

35:07 >> Thanks as always, Brian.

Back to show page