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


Transcript #301: PyTorch Grows Up and Moves Out

Return to episode page view on github
Recorded on Tuesday, Sep 13, 2022.

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

00:04 This is episode 301, recorded September 13th, 2022.

00:09 And I am Brian Okken.

00:11 And I'm Michael Kennedy.

00:12 And we're listening.

00:14 Anyway.

00:16 Hey, Brian.

00:17 Before we get started, we do have a sponsor, Microsoft for Smart Startups this week.

00:23 So that's cool. Thank you.

00:24 We'll talk about them later.

00:26 And what do you have for us first, Michael?

00:28 I want to take you on a journey.

00:30 Let's start at python.org.

00:31 I've mentioned this before, and it's been a while and not very many times.

00:35 And I never noticed this.

00:37 But if you see that code sample, there's like a set of different code samples that are on the page.

00:43 It's like the REPL.

00:44 And there's a little yellow, I guess that's supposed to be a prompt.

00:48 Like, I don't know.

00:49 It doesn't look like my prompt.

00:50 But, you know, you click it, though, and you wait for a moment.

00:53 What actually happens is it really, inside the website, opens up a Python REPL that is yours.

01:01 You can run it, right?

01:02 And this online console is hosted from Python Anywhere.

01:06 Pretty cool.

01:06 That is cool, right?

01:08 And it has, I think, stuff like various popular packages.

01:12 So I can type import requests and whatnot without doing any, you know, there's no pip install and stuff, right?

01:18 You have access to not just the standard library, but you have access to many aspects of the Python ecosystem.

01:24 That's super cool.

01:25 And you can also run not just these terminals, but you can also run probably more relevantly, most people, is Python web apps.

01:34 So API endpoints or, you know, some kind of like signup application for your kids.

01:41 I don't know, your kids' baseball team.

01:43 Who knows what, right?

01:44 So it's, they make it pretty easy because they've installed a lot of the things like Django and Flask and Pyramid.

01:50 So you don't even have to do a lot of setup.

01:52 They configure the servers.

01:54 You get this console in your browser to access it.

01:58 Get your own domain name.

02:00 And you can get much of this for free with some limitations.

02:03 Okay.

02:04 So, yeah.

02:05 So the reason I bring this up is Matthew Kramer sent over a message and said, in light of Heroku canceling their free tiers, which we talked about last week, I think, as an extra.

02:16 And so the Python Anywhere folks said, we are reaffirming our commitment to providing free accounts and free resources for the Python community.

02:26 How cool is that?

02:27 That's pretty cool.

02:29 Yeah.

02:29 Yeah.

02:30 I think this is great.

02:30 And they start out by saying, look, managing fraud and abuse for free products is definitely a challenge.

02:36 I mean, the thing I still really, really miss is Firefox Send.

02:40 Do you remember that?

02:41 Used to be able to go and create a temporary encrypted and encrypted type of way to exchange files.

02:47 And it was amazing until people started using it for malicious purposes and writing on the back of the domain for Firefox that would give it more credit than it otherwise deserves.

02:57 So it's hard to have free things on the internet because people are mean or some people are mean.

03:01 This is why we can't have nice things.

03:03 It is absolutely why we can't have nice things.

03:05 But the Python Anywhere folks are saying, look, we think we can have nice things within limits.

03:12 And we think those limits are not too significant.

03:15 So, you know, both of these companies went through an acquisition and possibly some kind of cultural shift.

03:21 So it's interesting to think about.

03:23 So Heroku was acquired by Salesforce.

03:26 Salesforce is a pretty interesting company.

03:28 They've got some wild history.

03:30 And then Python Anywhere was acquired by Anaconda Inc.

03:34 So, you know, if you think of who's deeper in the Python space, certainly Anaconda is more so than Salesforce.

03:39 Also, I want to point out that the free, I mean, free is awesome.

03:43 But if it's not quite enough for you, their one step up is only five a month.

03:48 That seems like a reasonable step.

03:50 Yeah.

03:50 It seems totally, totally reasonable.

03:52 So they said, look, we think we found a way to have free things.

03:55 And in our world, what that looks like is a few very minor restrictions.

04:00 So, for example, in this terminal that I showed you here, the REPL, you, for free accounts, you cannot have outbound internet access.

04:10 You can pull things in, but you can't serve stuff.

04:13 What is it?

04:14 You can't serve stuff out or something along those lines, right?

04:17 It's like one of the directions is restricted.

04:19 Okay.

04:20 Because they said, as soon as we had it completely open, bi-directional, hackers were all over it, doing all kinds of things.

04:28 So, let's see, they say explicitly here in the article, yeah, they limit outbound internet access.

04:34 That's what it is for free accounts.

04:36 And that dramatically limited the abuse that they have to deal with.

04:39 The other problem, you know, running these, especially for web apps, for consoles, like who cares?

04:44 It doesn't really matter.

04:45 But if you have a web app that's constantly running, probably its biggest resource is memory, right?

04:51 You know, it's using a certain amount of memory to keep that Flask or Django app running.

04:55 You don't really shut down the web app because the person stops interacting with it, right?

04:59 So, it said accounts like that where people might want to create an account to say, hey, look, I tried out Flask and here's my app.

05:07 I got it on the internet.

05:07 And then they left it alone.

05:09 They just quit.

05:10 They have no intention of doing anything with it, but they didn't bother to shut it down or delete it, right?

05:15 That's pretty tricky.

05:15 So, they basically set up a proof of life scenario here.

05:20 So, for a free web app to keep running, what you have to do is you have to go and click a button.

05:26 Yes, I want it to still run once every three months.

05:29 That seems completely reasonable.

05:32 That seems pretty reasonable, right?

05:33 Four times a year, you got to click a button.

05:35 You could automate it if you really want it, I suppose.

05:37 And then similarly for accounts, if you have a free account and you want to keep your resources,

05:44 you've got to do something similar once a year.

05:47 So, you've got to go in and say, yeah, yeah, please keep my account active.

05:50 And that's pretty much it.

05:51 So, with those don't seem like terrible restrictions and they get to keep offering free Python as a service.

05:58 Yeah.

05:58 Yeah.

05:59 I think that's completely reasonable.

06:00 Yeah.

06:01 Yeah.

06:01 Yeah.

06:01 Pretty cool.

06:02 Anyway, thanks, Matthew, for sending that in.

06:05 Yeah.

06:06 It is neat that people can, especially the example you mentioned.

06:11 So, I learned Flask and I made this Flask web app and I want to at least show my teacher and my friends and everything and my parents maybe.

06:19 Yeah.

06:19 Leave it.

06:20 That's fine.

06:21 Cool.

06:21 Exactly.

06:22 I want to put up a school project, but I don't know Linux and I don't want to go to big cloud providers.

06:27 I just want to get it up and running.

06:29 Yeah.

06:29 Yeah, this is great.

06:30 I need something for my Raspberry Pi that shows automation for my school project or whatever.

06:35 Yeah.

06:36 All right.

06:37 What's next?

06:37 I would like to talk about Python tooling.

06:40 So, I ran across this.

06:42 Not sure how, but there's an article called Python tooling could be much better, much faster, much, much faster.

06:51 And this is by Charlie Marsh.

06:53 And he, so apparently this is a thing that's going on.

06:58 I don't have an ear to the JavaScript world, but apparently the JavaScript ecosystem as well is thinking we need to make sure that our tools are really fast.

07:07 And Charlie said, maybe the Python tool should be really fast too.

07:11 So, what he did was he's putting together, he put together a thing called Ruff, which is, he says it's a proof of concept.

07:19 It's a Python linter, kind of like Flake 8.

07:22 It's written in Rust and it's like 150 times faster or something like that.

07:28 Wow.

07:29 And I was like, well, it doesn't cover everything, but it's covering like most of the stuff that Flake 8 covers without any plugins.

07:38 So, I guess, well, without the three main plugins that it ships with.

07:41 So, there's, it's pretty neat.

07:46 I downloaded it, tried it out.

07:48 So, we'll take a look at the GitHub repos here.

07:52 And it's, it's pretty awesome.

07:56 I downloaded it, tried it on.

07:57 Granted, I had a small project.

07:59 So, I had a small project where Flake 8 takes like a third of a second.

08:03 But it's, even at a third of a second, I was interested to know that I can kind of detect that it's doing something and then coming back.

08:10 But that's fast enough for me.

08:12 But I ran, I ran Ruff and I, like, just returned.

08:17 And I'm like, oh, something's broken because it's not doing anything.

08:20 It didn't do anything.

08:21 It didn't do anything.

08:21 So, I ran it again and then looked at the output and it said found zero things.

08:25 I'm like, well, maybe I'm not pointing it at my code or something.

08:28 Right.

08:29 So, I intentionally added some errors and it found those errors and it was in like 0.01 seconds or something.

08:37 It was, it came back so fast.

08:40 So, I'm pretty, I'm pretty blown away by it.

08:44 The, and I think other people are too.

08:46 I took a look at the stars.

08:48 I'm like, how long has this been around?

08:50 And it only came in at the end of August.

08:53 So, a couple weeks.

08:55 And we're at, what, 1.8?

08:58 Yeah, that's fantastic.

09:00 1.8 thousand stars.

09:01 So, it's pretty cool.

09:02 That's very cool.

09:03 They do, there's a hat tip to Flake 8 and stuff.

09:07 And so, there's a desire to make it.

09:10 It doesn't do everything yet, but they're working on it.

09:14 It's compatible with Black.

09:15 And, yeah.

09:17 So, there's a whole bunch of rules already built into it already.

09:21 And I think this is also kind of a cool project if people wanted to help out with the, or take a look at a project that's a Rust Python hybrid sort of thing.

09:30 This is kind of a neat project to take a look at.

09:33 Yeah, it looks very neat.

09:34 Can you pull up the star count thing?

09:37 Yeah.

09:38 What is it?

09:38 Star-history.com?

09:40 Yeah.

09:40 Hat tip to the XKCD type graph there, huh?

09:43 Yeah.

09:44 I actually love star history.

09:46 It's kind of fun to look at.

09:47 You know, and I have used this before.

09:51 I've never used it.

09:52 What do you do?

09:53 You just pop in, like, a GitHub account.

09:56 So, for this one, when I went to the GitHub thing and just took the GitHub address and popped it in.

10:04 Nice.

10:05 This is fantastic.

10:06 I really like it.

10:07 That's it.

10:07 Okay.

10:08 Well, now I definitely, and you can compare them, too.

10:11 I see.

10:11 So, you can put other, you could put, say, like, Flake 8 on there, and it would show you how to compare.

10:17 Yeah.

10:17 I'd have to go look up what the GitHub repo is for Flake 8.

10:20 I don't know it off the top of my head.

10:22 But.

10:22 Yeah, of course.

10:23 But this is neat.

10:23 I like it.

10:24 I'm going to have to play with star history.

10:25 But also rough.

10:27 So.

10:28 Yeah.

10:28 Very good.

10:29 Very good.

10:29 Well, cool.

10:30 Before we get going any further, we need to thank Microsoft for Startups Founders Hub.

10:36 And thank you for sponsoring the episode.

10:39 They've been sponsoring a lot this year, and we really appreciate it.

10:42 So, starting a business is hard.

10:44 By some estimates, over 90% of startups will go out of business in their first year.

10:49 With this in mind, Microsoft for Startups set out to understand.

10:52 What startups need to be successful and create a digital platform to help overcome those challenges.

10:57 And that's Microsoft for Startup Founders Hub.

11:00 The Founders Hub provides all founders at any stage with free resources to help solve startup challenges.

11:06 The platform provides technology benefits, access to expert guidance and skilling resources, mentorship and networking connections, and so much more.

11:14 Unlike others in the industry, Microsoft for Startups Founders Hub doesn't require startups to be investor-backed or third-party validated to participate.

11:23 Founders Hub is truly open to all.

11:25 So, what do you get?

11:26 You speed up development with free access to GitHub and the Microsoft Cloud with the ability to unlock credits over time.

11:33 And to help startups innovate, Founders Hub is partnering with innovative companies like OpenAI, a global leader in AI research and development, to provide exclusive benefits and discounts.

11:44 Through the Founders Hub, becoming a founder is no longer who you know.

11:48 You'll have access to their mentorship network, giving you access to a pool of hundreds of mentors across a range of disciplines, across areas like idea validation, fundraising, management and coaching, sales and marketing, as well as specific technical stress points.

12:04 You'll be able to book a one-to-one meeting with the mentors, many of whom are former founders themselves.

12:13 Make your idea reality today with the critical support you'll get from Microsoft for Startups Founders Hub.

12:19 To join the program, visit pythonbytes.fm/foundershub 2022.

12:25 And, of course, that link is in our show notes.

12:28 Awesome.

12:28 Thanks, Microsoft.

12:29 Really appreciate it.

12:30 And that's such a cool program.

12:31 If I were doing a startup, I would consider reaching out and applying.

12:34 But my startup has started and it's cruising along, keeping me extremely busy.

12:38 So it's all good.

12:39 More of that later, actually, Brian.

12:41 Yeah.

12:41 Right now, let's talk about a startup that's started a while ago called Meta.

12:46 Have you heard of it?

12:47 Facebook?

12:47 Yeah, I've heard a few things.

12:50 So many of the machine learning frameworks are actually brought out of internal projects at places like Google, Facebook, other large Silicon Valley type companies.

13:03 And PyTorch comes from Meta.

13:06 Okay.

13:07 And, you know, Angular is Google and things like this.

13:11 And I think that that can also Flutter, things like that can cause a little bit of concern.

13:16 Like, well, if you depend on this project, you're kind of buying into the Facebook world or the Google world or whichever world that that framework came from.

13:26 So the news here is that Meta is spinning off PyTorch into the PyTorch foundation and making it vendor neutral by making it basically part of the Linux foundation.

13:37 Okay.

13:38 Interesting.

13:39 Cool, right?

13:39 Yeah.

13:40 So if you're interested in PyTorch, well, it's a little more open than it used to be.

13:46 And this is the article I'm linking to for the announcement.

13:49 You can check out their direct blog post if you want.

13:51 But I'm linking to the Ars Technica article.

13:54 I love the comment section and just the type of discussion around some of these things.

13:58 In Ars Technica, although maybe this is not the best example of that because there are some silly questions in the comments.

14:04 But anyway, says PyTorch, which powers Tesla Autopilot and 150,000 other projects, will join the Linux foundation.

14:12 So that's pretty cool.

14:14 Let me see here.

14:15 So they say the PyTorch foundation will strive to adhere to four principles, remaining open, maintaining neutral branding, staying fair, and forging a strong technical identity.

14:27 And according to Meta, the transition to the PyTorch foundation will not affect any PyTorch code.

14:32 I'm guessing no namespaces change or anything like that.

14:36 The other relevant part, I guess, is that the governing board will include representatives from NVIDIA, Meta, Google, Microsoft, Amazon, and AMD.

14:46 Okay.

14:46 Yeah.

14:47 Yeah, so why?

14:48 Do you know?

14:49 Well, I think just to make it feel a little more truly open source and a little more independent, not something that's going to continue.

14:56 Less completely controlled by one company?

14:58 Yeah, exactly.

14:59 And, you know, maybe there's, I think, especially with AI machine learning frameworks, there's a little more concern that some implicit bias is not quite the right word, but some implicit influences that are being driven by the company behind it will influence the way that maybe it makes decisions.

15:18 Like, so if the algorithm is slightly tweaked in ways to help Facebook do more Facebook-like things, well, maybe it becomes less of a good framework to help you drive a car.

15:28 I don't know.

15:28 Right?

15:29 Something like that.

15:30 Right?

15:30 Whereas if it's a web framework, it's kind of like, dude, these are pipes.

15:33 They just do pipe stuff.

15:35 They carry the HTTP over, they return it.

15:37 There's no, like, concern that it's going to do stuff a little more interested in raising engagement in social.

15:44 Because it just doesn't, it's irrelevant to it, right?

15:47 Yeah.

15:48 Whereas maybe with machine learning, that's more of a concern.

15:50 Like, I did highlight the comments.

15:52 And so, you know, much like you asked, I respect this move, but I wonder why anybody would want to give up such a value, control of such a valuable software package.

16:00 And why do Microsoft and Google give things away?

16:02 I mean, obviously, like, it's just the benefits of open source, right?

16:05 It's not the framework that gives them the magic.

16:09 It's the data.

16:09 They can, you know, train the framework up on and then apply the framework to.

16:14 And they're not giving away the Facebook data.

16:16 So I don't see a big problem.

16:17 But what was an interesting conversation is that, for example, Google, their version of this is TensorFlow.

16:23 But Google is also a part of the representative group.

16:27 That's interesting, right?

16:28 Yeah, that is interesting.

16:29 The people in the comments basically said, well, look, much of the research field has moved to centralize on PyTorch.

16:38 And Google has a bunch of research people, and it's still relevant to them as well.

16:41 And it's a big company.

16:42 Yeah.

16:43 Yeah.

16:43 And it's a big company.

16:45 There's like a thousand things.

16:46 Let's see.

16:46 Paul Cutler.

16:47 Hey, Paul.

16:47 Fellow podcaster out there says, it helps to be more neutral or perceived neutral.

16:51 The Lindex Foundation is a good steward for projects like that.

16:53 Yeah.

16:55 And Panfield says, also in the, quote, war, you know, in the battle for mindshare, I guess, against TensorFlow, it's a killer move to say, well, which one are you going to choose?

17:04 Well, why not the more open one?

17:05 Yeah.

17:05 Yep.

17:06 Yeah, for sure.

17:07 Good, good.

17:08 It's a good move.

17:09 Yeah.

17:09 It is.

17:10 All right.

17:10 Well, well done, Meta.

17:11 Yeah, well done.

17:12 Well, I just want to take it back to simple things like strings.

17:17 So I actually kind of really enjoy this every once in a while.

17:20 They're just, especially people coming from, you know, I came from C++ and other languages, Perl and whatnot, into Python.

17:29 And so it's good to, sometimes I forget exactly how powerful a string is, even just simple things in Python.

17:36 So this is an article from Trey Hunter called Python String Methods to Know.

17:41 And this is something that's, I mean, we see articles like this every once in a while, but I like having one, a newer one, because some cool stuff came in in 3.9.

17:52 So I like how he broke it out, too.

17:55 He broke out the most useful string things to know, like join and split and replace.

18:02 And then strip, of course.

18:05 And then also he has it laid out with like related methods.

18:08 Like, for instance, strip has rstrip and lstrip for the left and right.

18:12 And then a couple of things that came out recently, I think the remove prefix and remove suffix are things that came out in 3.9, I believe.

18:22 Yeah.

18:23 Because everyone thought that would not, many people thought strip, if you gave it a substring, would take that substring off.

18:29 Yeah.

18:29 Really.

18:30 Yeah.

18:31 And it doesn't.

18:32 So the, yeah, remove prefix was added in 3.9.

18:37 So these are like really kind of cool things to just, you know, be able to do string manipulation quickly.

18:44 And it's a good reminder to, as you jump in, just because people manipulate strings all the time to just like, there's some power here you should be aware of.

18:54 And then if all of these seem easy, at the bottom, he's got learn these methods later, like encode and title and capitalize.

19:02 You know, I forget about this all the time that we have like the title function.

19:06 Title.

19:07 Interesting.

19:08 I did forget about that too, actually.

19:10 To title case of string.

19:11 And that's pretty cool.

19:13 And justification even.

19:14 Neat.

19:16 I didn't know is identifier was a thing.

19:18 I learned that new looking at this.

19:20 So check if a string is a valid Python identifier.

19:22 So, okay.

19:24 So this is a kind of a quick one.

19:25 So I wanted to throw in another one string related.

19:27 I use f strings a lot and I use numbers a lot.

19:31 And I, and so I ran across this Python f string number formatting cheat sheet.

19:38 It's actually pretty darn useful.

19:39 I, I, I always have like a cheat sheet like this around for, I used to have one for C++.

19:44 Then I had one for Perl and now I've got one for, for Python.

19:48 And it's kind of a nice layout.

19:50 You got float representations and how to, how to print those, how to print, replace a field within, within an expression.

19:57 It's kind of neat field replacement.

20:00 But what the main thing I like around it is all the number, number format things to remember, like if you want to have a certain number of digits on the right of the decimal point, how do you do that?

20:11 If you want it scientific case with like a, you know, E to the plus three or something, how to do that?

20:18 So these are cool things, especially if you're dealing with science and numbers and engineering and whatnot.

20:23 The percent one is great because I, I've always just said, all right, well, if I have 0.5 and I want to put it as a, I'll multiply it by a hundred and then treat it as a float, you know, but you can just do a percent and it will multiply it by a hundred and treat it as a float for you.

20:38 It's great.

20:38 I actually didn't know that.

20:39 So I didn't either.

20:40 Yeah.

20:41 Neat.

20:41 Yes.

20:42 Save your line of code there.

20:43 Nice.

20:44 And a little bit of memory.

20:45 Yeah.

20:46 Cool.

20:47 Awesome.

20:48 Yeah, this is great.

20:49 I love the cheat sheets and there's a lot you can do and either f-strings or just, you know, dot format style.

20:55 It's the same format string that goes on the end there, but this is, this is cool.

21:00 Like I said, I learned something with a percent already.

21:02 All right.

21:03 are those our items?

21:05 Those are our items.

21:07 How about some extras?

21:08 Yeah, I've got a couple and then we have a really big one that I'm excited about.

21:12 So, one of the, in back in episode two 71, we talked to that, talked about, and

21:19 that was back in February.

21:20 We talked about Seaborn was, trying out a new object interface.

21:24 And, so Seaborn just announced that Seaborn, the release of Seaborn 0.12 does have that object

21:31 interface.

21:31 So if you're waiting for an official release to use the object interface, it's here.

21:36 So go out and use it.

21:38 the other thing we talked to, we've talked about lazy imports, a couple of

21:43 times, on the show, PEP 696, 690.

21:46 Yep.

21:47 Yeah.

21:47 there was an interesting discussion on LW in that, or I don't know how to say that.

21:53 So anyway, there's a, there's a cool discussion there about talking about some of the pros and

21:58 cons, but anyway, I, the, it, the PEP says it's on, it's, it's still in draft mode.

22:04 So it's not, they haven't made a decision yet.

22:06 but it's targeting 312.

22:09 I kind of hope it goes in.

22:10 Yeah.

22:11 Yeah.

22:11 I kind of do too.

22:12 Yeah.

22:12 It seems like a, a good one, right?

22:15 You get the performance of not importing things unless you actually use them.

22:19 There's always those edge cases, right?

22:20 With enough people living at the edges, then it can become an issue, I guess.

22:25 Yeah.

22:25 And the discussion around whether or not how to turn it on, whether you turn it on by default

22:30 or whether you do a flag or have, have to turn it on in your code with the, the comment

22:35 that like, if you're doing an, if you're doing a library, you know, you don't know how somebody's

22:40 going to use it.

22:41 So maybe not turn it on, but if you're doing a package or something, but if you, if you're

22:45 doing, an application, then you're testing everything and you know whether or not it's going

22:50 to work.

22:50 So you can turn it on.

22:51 Yeah.

22:52 Give it a try.

22:52 See if it works.

22:53 Yeah.

22:53 See if it's worth it.

22:54 Before we move on to my item, I just want to say, while out there says first time watching

22:59 the show, usually just check into the audio.

23:01 I just want to take this chance to say, if you're listening to the show and you want to

23:06 maybe get your comments featured or you want to see it, what we look like on video, I suppose,

23:11 check us out.

23:12 We usually stream on Tuesdays at noon Pacific time.

23:16 And we're going to try to stick to that for a while.

23:18 Also they say like the browser choice for Vivaldi.

23:20 It's very cool.

23:21 Like you and I are both using Vivaldi for this and many other things, of course, also check

23:26 out cute browser that we actually covered back in episode two.

23:29 91 about three months ago.

23:31 So people can check that out if they're interested.

23:33 All right.

23:34 Onto my item.

23:35 Yeah.

23:35 Hey, Brian, tell me about pytest.

23:37 Yes.

23:39 So we've been working on this for a while and it's live now.

23:43 So there's a pytest course, now at, at how do I, how do people get there?

23:48 Talk Python.

23:49 They just go to talkpython.fm, click on courses and it will be right at the top.

23:55 So, yeah, super easy to get there.

23:58 And you just hit the courses.

23:59 It's like the very first one because it is the newest one released just over the weekend,

24:04 basically.

24:04 And people can check this out.

24:06 It's a four hour course that goes through all things pytest.

24:11 And it's really good for getting, I think it's good for getting a sense of what is the spectrum

24:17 of features of pytest, right?

24:19 Like it's, we've all seen courses that are like, well, red, green refactor, let's go, you

24:24 know?

24:25 And it's, it's fine.

24:27 And it's, it's, those are useful ways to learn testing.

24:30 But if you really want to take advantage of modern Python testing, you know, what are,

24:36 what are the ways to structure your code?

24:38 What are the different things that pytest can do?

24:41 And some of the plugins that make it better, like X fail and whatnot.

24:44 I think you did a really good job putting all of those together.

24:47 So especially the fixtures and purge of amortization and say that fast.

24:51 If anybody has the book, for instance, I think, and you've read the book and, and it's, thank

24:57 you if you've read the book.

24:58 but the, the, the, a lot of the material is related to the content in the book, but the

25:03 material of this course being that it's intended to be like, yeah, what is it?

25:07 4.7 hours or 3.7, I don't know.

25:09 It's around four hours or something.

25:11 Four ish.

25:11 Four ish.

25:12 that we, it's, we edited.

25:15 So we took, took out a lot of the material from the book to focus really on,

25:20 ramping people up and, and showing them the, the complete power of pytest.

25:24 And I think people can run with it as is, with it, with the content of the book,

25:29 for quite a while before they hit roadblocks and need to learn a little bit more.

25:33 So this, I think this would be great for teams to take together too.

25:37 So.

25:38 Yeah, absolutely.

25:38 That'd be great.

25:39 You know, get together and spend a week, one hour each, like a lunchtime, get lunch

25:45 together, sit in a conference room and watch it together.

25:47 Maybe.

25:47 Yeah.

25:48 That'd be cool.

25:48 So yeah.

25:49 Very excited.

25:50 Yay.

25:51 Yay.

25:51 Awesome.

25:52 I'm excited for you as well.

25:53 And like I said, I learned a bunch from it.

25:55 I thought it was a great course.

25:55 So really excited to be offering it and you know, people go check it out.

26:00 Talk by thun.fm.

26:01 Click on courses.

26:01 It'll be right there.

26:02 Awesome.

26:03 All right.

26:03 That's not very funny.

26:05 Very useful.

26:05 Very cool.

26:06 But not that funny.

26:06 I caught something that's pretty funny though.

26:08 Okay.

26:09 Okay.

26:10 Before we do the joke though, let me just really quick handful out there to audience

26:13 follow-ups.

26:13 On Scientific Python, we already are providing lazy imports.

26:16 SciPy and SciKit image, for instance, have a version of that and are acknowledged in the

26:21 pep.

26:21 Very cool.

26:22 And Alvaro says, congrats on the new course, Brian.

26:25 Thank you.

26:26 All right.

26:26 Now for something funny.

26:27 What if you're trying to build a horse with programming?

26:30 What would that look like?

26:31 So this is a cartoon by Goon Squad by Toggle.

26:35 And so it goes through the different languages.

26:37 You do C++, right?

26:39 Yeah.

26:39 So it starts with C++ and it says, so you built a horse and the people are looking quite

26:46 disgusted at it.

26:47 And it has like no skin or anything.

26:50 The organs are all hanging out.

26:51 There's weird bits that are not seen as it's ugly as can be.

26:55 It has a lot of dangling parts, but it gets the job done.

26:59 And of course, for Java, of course, you really want to build a horse.

27:03 So you open up your blueprints and you're studying.

27:06 It says, but first you need to build a horse factory.

27:08 Oh no.

27:09 Yeah.

27:10 The indirection, it runs deep.

27:13 JavaScript is pretty darn good.

27:15 Your horse has arrived in different packages.

27:17 You built the horse, but the backbone came out of Angular.

27:20 So the horse is paralyzed.

27:21 There's like a droopy horse that can only lift it by its poor front legs.

27:25 So sad.

27:26 The person is gasping and covering their mouth like, oh no, what have I done?

27:30 That's great.

27:31 All right.

27:32 Next, we have a no sequel horse.

27:34 I guess speaking to like, maybe it's unreliable.

27:36 I don't know.

27:37 No sequel.

27:37 You had a fast, beautiful horse.

27:39 Now there's a person in a pasture with no horse, but you have no idea where it is.

27:42 All right.

27:44 Next one up.

27:44 Kobold.

27:45 This one is real good.

27:46 It's black and white, like old fashioned overalls, like where it's being built.

27:51 You built a horse in 1962 and like so triumphant.

27:55 It can only be tamed by the original creator for all of the purposes.

27:59 It's a dragon.

28:00 It's like breathing fire and it's being battled by like modern military people.

28:04 Yeah.

28:05 That's funny.

28:05 That was pretty good.

28:06 Now, before I show you the Lisp one, I don't know if people are familiar with Lisp.

28:10 I, this is like the first CS class I had to take in college when I did a CS, a couple

28:16 of classes from my, like a minor part of my math degree.

28:19 And I really wanted to take C++.

28:21 And I said, please kind of take that.

28:23 No, you have to take Lisp.

28:24 All right, great.

28:24 So Lisp, I don't know if you've ever seen it, but boy, is it fun to have parentheses.

28:29 It's like everything is just parentheses, parentheses, parentheses.

28:32 You end up with like, even like a really simple example with like a line with five consecutive

28:37 closing parentheses.

28:38 Right.

28:39 So it's just all about the parentheses.

28:40 Lisp stands for lots of insipid, silly parentheses.

28:43 Exactly.

28:45 So the Lisp one is, it just says you built a parentheses, parentheses, parentheses, parentheses,

28:49 like about 50 parentheses, a horse emoji, close parentheses, about 50 times to match those

28:54 off.

28:55 That one's awesome, isn't it?

28:58 Yeah, it's good.

28:59 All right.

29:00 C-sharp.

29:00 C-sharp has camel casing for its, it's like a naming.

29:06 So it says, the horse works best when dressed in a camel costume.

29:09 They try to take it off and make it do something.

29:12 When you try anything else than a camel, it gets a bit fussy.

29:16 It won't even eat an apple because it's not, it's got its camel costume off.

29:20 Assembly.

29:23 This one may be, actually, this might be my favorite.

29:26 It's like eight bit graphics.

29:28 It's super old school looking.

29:30 And it's a, so it's like completely, I don't know, it looks like it's out of late 80s graphics.

29:36 It says the horse turns out a little basic, but boy, can it run fast.

29:41 And the girl, I just ride it like lightning.

29:44 Yeah.

29:45 I think this is the last one.

29:46 PHP.

29:47 You built a Trojan horse.

29:48 Oh, great.

29:49 It releases hundreds of tiny horses to punish you every day forever.

29:53 Okay.

29:59 And no, but unfortunately Python was absent or I, I don't know.

30:03 I'm not sure what it would have said, but Alvaro added it.

30:05 I guess for the Python one is just import horse emoji.

30:08 Import horse emoji.

30:10 That's pretty good.

30:11 Actually.

30:11 Oh, can you put emojis in, in package names on PyPI?

30:14 I don't know about package names.

30:16 You can put them in Python code.

30:18 Like they can be comments.

30:19 I don't know if you, they can be a pop, a pip install horse, but that'd be awesome.

30:23 Roman says Python is beautiful, but slow.

30:28 It's like a show horse.

30:29 Unless it's chased by C++ and it'll run.

30:33 Yeah.

30:34 The fast horses are actually just written in Rust and then imported in Python.

30:38 Exactly.

30:41 Very true.

30:41 All right.

30:42 Well, I thought this was a pretty good one.

30:43 A bit of a language lesson for everyone.

30:46 Yeah.

30:46 So what did we learn about PHP?

30:48 It releases hundreds of tiny horses to punish you every day forever.

30:51 Yeah.

30:53 You just hire new people to maintain it.

30:55 Exactly.

30:56 All right.

30:57 Well, good times.

30:58 Good times.

30:59 Yeah.

30:59 Thanks for, thanks for all the work on the pytest course too.

31:02 I appreciate it.

31:03 Yeah, absolutely.

31:04 Yeah.

31:04 People do check it out.

31:05 It really is good.

31:06 And Brian, thanks for doing it.

31:08 And thanks for being here.

31:08 Bye everyone.

Back to show page