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


Transcript #124: This is not the None you're looking for

Return to episode page view on github
Recorded on Wednesday, Apr 3, 2019.

00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds. This is episode 124 recorded April 3rd, 2019. I'm Michael Kennedy.

00:10 And I'm Brian Okken.

00:11 And this episode is brought to you by DigitalOcean. Check them out at pythonbytes.fm/digitalocean. Get $100 credit for new users. Tell you more about why that's awesome later.

00:20 All right now, Brian, I feel like we're going to go to your happy place.

00:23 Yes, I'm definitely one of the testing nerds that's around.

00:28 And I'm excited about the pytest4.4.0 released.

00:33 There's a lot of stuff in the 4.4 release.

00:38 And that's pretty cool. There's a lot of actually really neat things.

00:43 I'm going to save the big one for last, but one of the cool things is there's a test_paths variable that you can put in your configuration, any file, it tells the pytest where to look for tests.

00:54 And it kind of short-circuits some of the searching everything under the current directory.

01:00 Just what, like two sub-directories or something, but not everything?

01:03 Yeah, like for instance, this is very common if you've got like a structure where you've got tests in one directory, your source in another directory, and then maybe some documents or something, and it's a large project.

01:15 If you just launch pytest from the top, it'll look at everything, and it really should just look in the test directory.

01:21 Right, exactly.

01:22 That makes sense.

01:23 So that's pretty cool.

01:24 It's been around for a while, but it's kind of hidden.

01:27 It just worked that way.

01:29 And what they've done now is they've added in the output, it tells you which test paths have been set.

01:37 So that's nice.

01:38 Yeah, that's cool.

01:39 And then there's a whole bunch of stuff that's relevant, especially to plugin writers, and a little bit for test writers.

01:44 actually quite a few things. I encourage people if they're nerdy about pytest to check out the changed list. The thing that I'm super excited about is there were a couple of internal changes that made it so that there's a new plugin called the pytest Subtests that works.

02:01 Ooh, nice.

02:02 Ish. So pytest has always been able to run unit test code. But one of the things that happened is if unit tests were had sub tests in them and sub tests are a way to have kind of multiple checks within a test if you had those in there and one of them failed it's supposed to keep going and check all of them but pytest would stop at the first failure now it doesn't now it continues on with running all of them that's cool like so if I've got say a list of five things and I want to loop over those and test each one of them without some kind of parameterized I just want to loop over them all and write one test and do that.

02:41 I would do that with a subtest.

02:42 Yeah, or at least you can.

02:43 Yeah.

02:44 And it works pretty good.

02:45 So it really was to the plugin and the changes were really to fix this little corner case of the unit test support.

02:52 And so I'm really glad that they did that.

02:55 But they also threw in a new fixture called subtests.

02:59 So even if you're not using unit test, you can use this new fixture.

03:03 and it has a subtest test context manager that works just like the unit test version, but you can use it in pytest tests.

03:12 - Yeah, that's cool.

03:13 - That's neat.

03:14 - Another one that I think is nice is async.

03:15 So you have the async, you know, mark as async decorator you can use.

03:21 But previously, if you did that, but for some reason, like the right plugin to run the async, say like pytest-asyncIO or pytest trio wasn't there, they would just not run, but they were still marked as passed.

03:34 And now at least you get a warning that they're not run or something like this.

03:37 That's cool.

03:38 - Yeah, that's a oops.

03:40 - That's one way to make your test pass.

03:42 Like let's just not install that async runner.

03:44 We'll be cool.

03:44 - Yeah, yeah.

03:46 - Well, keeping with the async theme, I wanna roll right into requests.

03:50 So I literally just hung up recording or stopped recording with Kenneth Wrights.

03:56 We're doing an episode on Talk Python and we're talking to him about requests a little bit, but mostly other things.

04:02 Anyway, this next item follows right onto that is request-async.

04:07 So currently, without this library or something like it, if I want to use async and await, and I'm doing web requests like microservices or calling like a Stripe API or something, I either do it synchronously with requests or I can do it asynchronously, but I have to switch out my calling package.

04:26 I have to use like aiohtp.client_session or something totally different, rewrite my code.

04:31 There's a package called request-async, which is pretty cool, and it's actually a different thing you import, but if you import it as requests, then you can do await request.get, await request.post, and all of that.

04:47 So it seamlessly fits into your async and await methods.

04:52 Maybe you're testing with that pytest thing I was talking about, and it's basically the same API, but now it's async-friendly, which is cool.

04:59 - That's very neat, yeah.

05:00 And like I said, there's other stuff you could use.

05:02 You could use AIO HTTP, which is nice, but it means you rewrite your stuff, right?

05:06 And a lot of people depend on like changing DNS resolvers and all sorts of crazy stuff deep down inside a request.

05:11 So this will let you do that, theoretically at least.

05:14 I haven't tried all the edge cases, but let you do that without rewriting your code, which I think is pretty cool.

05:19 Now, I did say I was just talking to Kenneth and one of the things he said is they are working on native async and await support for requests.

05:27 So that's pretty cool, which would make this unnecessary.

05:30 So why do I bring it up?

05:31 Well, he said it's probably like not done for a while.

05:33 It's probably like a year away 'cause they're doing like major rework inside of requests.

05:38 And think how many libraries and people depend upon requests and how hard that must make it to change at all, right?

05:44 - Yeah, it needs to not break backwards compatibility.

05:47 And it's not even just breaking it.

05:49 It can't slow things down either.

05:51 - Yeah, exactly.

05:51 So they're talking about making a new package called request three.

05:55 So you import request three and it has a slightly different API.

05:59 I just barely.

06:00 So anyway, here's an interim way to get async and await working with requests.

06:04 And another thing, there's a cool bit of testing going on here, Brian, I thought you might like.

06:08 So I can mock out my endpoint.

06:11 Like let's suppose I'm trying to call an API or something and I don't really want it to go to the real server.

06:17 I want to give it a test one.

06:18 I can create a Flask app or a core or starlet or whatever and create a mock connection pool or something to that effect and give it my real website implement it in Python, and that's the mock behavior of this thing.

06:32 - Okay, well that's neat.

06:33 Is there more information about that somewhere?

06:35 - It's covered in the GitHub repo that I linked to, and if you go to the bottom down there, it talks about it.

06:40 I don't totally know what's going on exactly, but for example, you want to call, I don't know, your API, and you could have a little local one running on SQLite or something, and you could literally give it the app.

06:53 It won't even go to the network.

06:54 It'll just directly interact with the app as if it was the web server.

06:57 - Oh, that's really cool.

06:59 - Yeah, it's pretty wild.

07:00 So anyway, this is--

07:00 - I'm gonna play with that.

07:02 - Yeah, yeah, it's a pretty cool thing to be playing with and it has some other cool async testing support.

07:06 So it's got a cool testing angle as well.

07:07 - Nice, cool.

07:08 - Speaking of services, what do you got next?

07:10 - I did notice that there was an article in the register about a bunch of, I don't know how a bunch, but some layoffs at NPM.

07:19 - Right, NPM is the commercial equivalent of PIP, sort of.

07:22 And PyPA, Python Package Authority, like mushed into one, right?

07:26 - Yeah, I didn't know that it was a for-profit company, but apparently it is.

07:32 - Yeah, that's interesting all by itself right there, isn't it?

07:35 - Yeah, so Dustin Ingram wrote an article talking about, and Dustin is one of the people that works with PyPI and the Packaging Authority, and he wrote an article called PyPI as a Service.

07:47 And essentially, there's a couple interesting comparisons between NPM and PyPI.

07:54 Firstly, NPM's been around for longer, I guess, since 2014.

07:59 PyPI in 2002.

08:02 Oh no, we're older, so PyPI's older.

08:06 Math is easy.

08:07 Anyway, they have like $10 million in funding.

08:10 And whereas, around 60 people working there, and the PyPI has like less than half a million in grants.

08:19 And then just like, there's only half of a, a fraction of a single employee, and then some volunteers.

08:25 So there's a lot less people running PyPI and a lot less money.

08:30 But what if they changed it?

08:32 Apparently they've had a lot of people ask for an as-a-service version so they could have like a private thing.

08:38 So you could use something like PyPI but with your own stuff that's internal or whatever.

08:45 And generally just talked about some of the problems with that.

08:48 One of the problems is it might jeopardize the non-profit aspect of the Python Software Foundation.

08:55 That would be bad.

08:56 Also, there's a whole bunch of people that, companies that donate services and infrastructure to make PyPI run at the tune of about a million dollars a year, and I don't know if, and he mentions that they might not be thrilled about donating that service to a for-profit company.

09:13 - I'm sure they wouldn't.

09:14 - I agree.

09:15 There's also some of the ecosystem.

09:17 There's other options out there.

09:19 However, I've kind of looked into these and I'm not really thrilled with the other options available.

09:24 So I actually think there's room for somebody else to create something like PyPI for private use that might as a service, that might be an opportunity for somebody.

09:33 - Yeah, for sure.

09:34 You know, one of them that comes to mind is pydisc.com.

09:38 That's in there right now, but it's basically that.

09:41 It's basically the service that people are asking for.

09:43 Honestly, I totally see the problem here, right?

09:47 We've got this careful balance of this actually really expensive thing to run, PyPI, especially the traffic and the website and whatnot.

09:54 And then we've got these donations taking care of that.

09:58 There probably is a business model to be had here, but there's gonna be like a wicked dip to zero, near zero, and it has to, somehow you have to be able to climb back high enough to cover just the expenses, right?

10:11 Like that's pretty risky to do that.

10:13 - Right, and also, what do you do with the people that are now volunteering?

10:16 Do you start paying them?

10:17 What if they only volunteer for a couple hours a week or a couple hours a month?

10:20 Do you pay them for that?

10:21 - Yeah.

10:22 - And then also they support some of these alternate services right now, PYPA does.

10:28 And if they had an incentive to not support the other services and only support their own profit, that's not good.

10:35 So anyway, it's an interesting topic.

10:38 - I honestly think that there's actually a huge potential.

10:41 I've talked to people in the community about this, but I don't know that I've talked about it on the podcast before around pypi.org.

10:48 If you look at how much traffic is there, there's a huge opportunity for non-invasive ethical ads and other types of promoted stuff to be put on there.

10:59 And I'm sure they could do more than a million dollars with the amount of traffic they have, but there would be that bad dip and they might not make it through and so on.

11:06 But I certainly see this as totally possible that it could go that way.

11:10 And it may be, given that they're basically saying, "Hey, we need to receive a donation of $40,000, $45,000 "a month of bandwidth, and if we don't, we're done." Right, that's a really scary situation to be in as well, they're dependent just on one company.

11:25 So I don't know, it's super interesting.

11:27 The layoffs at NPM, that doesn't make me sound, it make me really want to encourage PyPI to go that way.

11:35 - Right, it was interesting at the end, the conclusion wasn't that it's never gonna happen.

11:40 It's just right now it looks like it's not worth it.

11:44 It would be kind of a pain and it might backfire.

11:47 And so right now they're not looking into it.

11:50 But it's not a never thing.

11:51 - That makes sense.

11:52 All right, before we get on to the next one, let me just tell you all about some cool features at DigitalOcean.

11:57 Something they just announced is the DigitalOcean Marketplace.

12:00 So it's like one-click apps and server configuration for all sorts of tools and whatnot.

12:06 So maybe you want a Discourse server, a GitLab Enterprise server, a MongoDB server, or even Django, you can go up to there, create an account, go into the marketplace and just click the button and boom, you have an infrastructure all set up, pre-compigured to run whatever app it is that you want there.

12:22 So there's a bunch there and I think you can even create more and add them if you want your project in there.

12:26 So check them out at pythonbytes.fm/digitalocean.

12:29 Get $100 free credit for new users and definitely get a play with that marketplace.

12:34 It's quite cool.

12:35 Brian, if I was looking to run, say, some data science Python in the cloud, and I maybe wanted to do that without paying any money.

12:42 Maybe I was a college professor and I wouldn't have my students do it, or even high school, or I just didn't want to pay money or whatever.

12:50 There's a bunch of these services now that'll run basically Jupyter in the cloud, right?

12:55 - Okay.

12:55 - So there's a couple of big ones.

12:56 We have like Azure and we have Google, but there's some smaller ones as well.

13:01 And a friend of ours, Kevin Markham, put together a cool article called six easy ways to run your Jupyter Notebook in the cloud.

13:08 So basically he went through and compared six different services, assuming they all had, you know, they got into this list if they had all the characteristics in that they don't require you to install anything on your machine.

13:18 They're either completely free or they have a completely free plan.

13:22 They give you access to something like a Jupyter Notebook environment.

13:26 You can import and export real Jupyter Notebooks through the IPYNB format.

13:33 and they support Python language, maybe others as well.

13:36 Out of all the ones he looked through, there's six that were decent that matched those criteria.

13:41 So we have Binder.

13:43 Maybe you've gone to GitHub and you've seen like a GitHub repo that has some iPython notebooks in it, and a little binder, like a run in binder button.

13:51 So if you click that, you can basically use the binder service and run any Jupyter notebook that lives in a public GitHub repo on Binder.

14:00 So you just click a button and say run this repo.

14:02 That's kind of cool, right?

14:03 - Yeah, very cool.

14:04 - So that's nice.

14:04 What I like about Kevin's article is he goes through and says, "These are the pros, these are the cons." So like pros, obviously this is free and easy.

14:11 If you already work on GitHub, it's just right there.

14:13 If you don't, or what you have is a private repo, then Binder is not such a big help.

14:19 Another thing that's big in data science is Kaggle, right?

14:22 So they have these Kaggle competitions, which are like, "Here's a bunch of data, "try to solve a problem by getting the data to tell you," or training a neural network or something like that.

14:30 So Kaggle's known for that, They also have this thing called kernels, like a free service called Kernel, so Kaggle Kernels.

14:36 And these are kind of like Jupyter Notebooks, like super simplified ones.

14:40 So you can run your stuff there, that's cool.

14:42 Maybe one of the bigger ones is Google Collaboratory or Google Colab.

14:46 And as long as you have a Google account, it's like Google Docs, but for Jupyter Notebooks.

14:49 You just log in, go.

14:51 What I really like about this one is it's like Google Docs in that you and I could be working on a problem, and we could just both be typing at the same time and working right alongside each other.

15:00 So the collaboratory bit is like super big there.

15:02 - Oh, that's nice.

15:03 - So that's pretty good.

15:04 And then also you can run your code regular on a server through Google Colab, but you can also run it on a GPU or a TPU, TensorFlow unit, processing unit, which is pretty awesome for something.

15:19 I don't know if you have to pay for the GPU option, but still pretty cool.

15:23 - Yeah.

15:24 - 'Cause a lot of people don't have, certainly don't have TensorFlow chips laying around probably.

15:29 Maybe comparable to the Google one is the Azure Notebooks.

15:33 So this is a big part of what Python and Microsoft are doing.

15:38 What Python is sort of showing up in in the Microsoft space is over on Azure and Azure Notebooks.

15:44 So they've got-- simply, it's more of like a project.

15:47 It's not just a notebook, but it's like multiple notebooks, markdown files, data sets.

15:52 So you kind of create these project folder type things that you can run on Azure Notebooks.

15:56 And that's cool, also free.

15:57 All of them are free.

15:58 There's something I had not heard of, CoCalc for collaborative calculation.

16:02 Also super collaboratory, like the Google Collaboratory one.

16:06 Yeah, it's pretty cool.

16:07 It lets you do all sorts of stuff like Jupyter Notebooks, but also Sage worksheets and other things, which is good.

16:12 And finally, from JetBrains, we have Datalore, and it's not exactly Jupyter Notebooks, but it's like a re-imagining of a Jupyter Notebook, which is cool, but you can import and export Jupyter Notebooks from it.

16:23 So that's pretty cool.

16:24 Like all the features and autocomplete and cool stuff that you get in PyCharm, but like in a notebook, Jupyter-like notebook, is sort of data or also real-time collaboration there.

16:34 So those are all, yeah, those are all pretty cool.

16:36 So if people are out there thinking like, hey, I want to do some Jupyter in the cloud, maybe for a course or for collaboration or something, these are all good options.

16:43 - Yeah, very cool.

16:44 - Yeah, nice article, Kevin, and hopefully it helps some folks out there.

16:47 Speaking of Jupyter, what do you got next?

16:51 - Yeah, did you have this down and I just didn't see it beforehand, or did we just, coincidence?

16:55 - Just a coincidence.

16:56 Okay, so my next item is Jupyter Notebook tutorials.

17:00 So let's say you have some people you're trying to collaborate or not, and you have some people that aren't quite familiar with Jupyter Notebooks and you wanna get them up to speed really fast.

17:12 I'm actually in this situation right now, not for me, but with some people I'm trying to ramp up.

17:17 And I found there's a ton of tutorials about Jupyter Notebooks, of course, out there.

17:22 But I really liked, there's two tutorials from DataQuest.

17:27 The first is Jupiter Notebook for Beginners, a tutorial.

17:30 And the second is Tutorial Advanced Jupiter Notebooks.

17:35 And it's by the same author, which I should have written down, but I didn't.

17:39 It starts out incredibly gentle, but it's also useful and concise and quick.

17:45 You can get through quite a bit right away.

17:48 And so it even starts with like, if you want to install Jupyter on your computer, how to install it, how to get started up, you don't even, if you aren't even familiar with how these work, how to get going, a little bit of a discussion about the file type, the I-P-Y-N-B, and then a run through of the interface and how it works to work with a notebook.

18:08 And then even into data, so like loading data and some important things like plotting data right off the bat, and then even how to share, and then using save and checkpoint frequently to make sure that you save parts of your notebook.

18:23 Like this saving often is something we take for granted with an editor, but it's kind of nice to have this within Jupyter Notebooks also.

18:31 - Yeah, for sure.

18:32 - And I kind of like that he stops the beginning one.

18:35 It's long enough to get people started right at there, but then the advanced one, once people play with it a little bit, getting into some advanced things, which like the magics, keywords, debugging, shell commands, logging, using Seaborn, using macros, and all sorts of stuff in the advanced one, which are not--

18:56 it's nice.

18:56 But they're not too long.

18:58 You could probably take an hour or so and go through it and learn what you need and skip what you don't need yet.

19:02 Yeah, that's cool.

19:03 I've also been playing with using PyCharm to edit IPython notebooks.

19:08 It works really good.

19:10 I would recommend if people are debugging notebooks, maybe not use write in Jupyter.

19:15 I would probably use PyCharm for debugging.

19:17 Yeah, PyCharm's pretty sweet for debugging.

19:19 - Anyway, so that's what I got.

19:20 - Yeah, that's nice.

19:21 I think those definitely go well together.

19:22 So people can check out those articles and then try them online.

19:26 They don't even have to install anything.

19:27 All right, final one, Brian, comes from a friend of the show, Trey Hunter, and it's called unique sentinel values, identity checks, and when to use object instead of none.

19:37 And I think this is just a really nice reminder, maybe something a lot of folks don't know or haven't really thought about.

19:43 Often we have to clear a variable and it may or may not have a value.

19:47 Think of like computing the minimum of something.

19:50 So you're gonna, the algorithm is you have the minimum value and you gotta set that to something and then you're gonna loop through all the items and you're gonna set it to the lowest.

19:58 But how do you kind of initialize that, right?

20:00 Do you set it to none?

20:01 Do you set it to maybe negative one?

20:03 But well, what if the values could be negative?

20:04 Like what is that value, right?

20:06 So often none becomes this thing that is the it's not yet set value.

20:11 But if none is a valid value or maybe in this minimum example, like none could actually be a value that was passed to you in the list that you're trying to find the minimum of, but you need to treat it differently than actually the not having, you know, like it gets really weird, right?

20:25 - Yeah.

20:26 - So Trey makes a case for this, for something different in this article.

20:30 I really like this.

20:31 It's like, instead of sending a value to none, you can set it to object, parentheses, parentheses.

20:38 And that allocates an object, much like none is an object, ironically, singleton and things like that.

20:44 But object is going to be allocated on the heap and no one will ever pass that thing to you.

20:50 There's no other use case for allocating an object to object.

20:54 You always have something derived from object.

20:57 I don't know, a string, a number, a customer, but not object itself, like the base class.

21:02 So just allocating one of those is the perfect Sentinel value.

21:05 And there's all kinds of examples he goes through, default values for a function, default parameters for functions, how you deal with that, How do you deal with this minimum example?

21:17 What is the first value before you've looked at the list?

21:19 And so you end up with really nice checks like that set minimum equals to object and then if minimum is not initial, right?

21:26 Or is not this, you set the initial to this new object.

21:30 Right, then you go work with it.

21:31 So super simple adaptation that solves a certain class of bugs and makes it really nice.

21:36 - That's interesting.

21:37 - Yeah, it's super simple, but it's kind of a good reminder.

21:40 And there's the example, He re-implements the min function that's a built-in, but in Python, and goes through all the cases to make it work, and shows how this pattern is much better than using none.

21:51 I'll have to hit up Trey and ask him how to deal with that with type hints.

21:55 Yeah.

21:55 Because I'm used to--

21:56 Yeah, I know.

21:57 I know.

21:57 You can't just say optional.

21:59 I guess you've got to do like union of object, but that's also not a good answer.

22:02 Because that would be everything.

22:04 Yeah.

22:07 Yeah, right.

22:08 Yeah, it's not so good.

22:10 Interesting.

22:10 But it's a cool idea.

22:12 - Yeah, it's a great idea.

22:12 It is a little bizarre with the, I don't know, with the type-ins, you're right, but that's okay.

22:17 I think you can get around it or just put like a, you know, ignore this one line type of thing.

22:21 - Yeah, well, I mean, and it only really will come into place if it's part of your interface to something.

22:26 - I mean, you'd probably do have to be careful with like mypy and mypyc and those tools, so they'll probably freak out if you don't take it into account.

22:34 So, but yeah, I love the pattern in general, how it fits with type-ins, that's like a different, different aside.

22:40 - Sorry, Trey. - Yeah, Trey, there's your follow-up article, man.

22:45 Brian, that's it for our official six topics as usual.

22:48 You got anything extra you wanna share with anyone?

22:50 - I do.

22:51 I forgot to write it down, but you reminded me 'cause you were talking about sentinel values, and sentinels were part of the Matrix, right?

22:59 - Oh yeah, they were scary.

23:00 (laughing)

23:01 Those were the big metal things that went through the underground tubes and they would grab onto the spaceship with the good guys in it, yeah.

23:07 - Yeah, yeah, but there's something that's not scary is the cool computer screens that would go downwards.

23:14 So one of the things I found, which is--

23:17 I brought it up because I brought up pytest earlier--

23:20 was a plug-in called pytest-Neo.

23:24 And it runs all your--

23:26 like normally, if you just run pytest by default, it'll print out the test file name and then a whole bunch of dots.

23:32 And the dots mean everything passed or like an F for fail.

23:36 The pytest-Neo plug-in, if you have that installed, That happens, but it goes downwards and looks like the screen, like a matrix screen, but it actually, it looks cool.

23:47 But it's actually informative.

23:48 It has all the same information, just in the wrong, a different direction.

23:51 - Whoa, I need to learn unit testing.

23:53 Chunk, yeah, that's awesome, I love it.

23:55 Brings me back to the '90s.

23:56 That's cool, very, very cool.

23:58 - How about you?

23:59 - I've got a couple of things.

23:59 Let's start with this one.

24:00 So I recently released a free course.

24:04 So people can check that out over at training.python.fm or just click the link.

24:07 I think we've talked about Kenneth Wright's new web framework called Responder, right?

24:12 >> I think so. >> I think so, yeah, I'm pretty sure we have.

24:14 So I decided to create a super short little mini course on it.

24:17 So I created a almost one hour long course on Responder and the framework and it actually uses, goes and builds it.

24:25 We go and build out like a cool API using Responder.

24:28 And then actually consume it with Vue.js as well.

24:31 So there's a cool little Vue.js front end on top of that.

24:34 So if people wanna get some quick exposure to Responder, maybe see some of the cool features that it can do.

24:40 Kind of Flask-like, but it does a bunch of other awesome stuff as well.

24:43 It's not just Flask.

24:44 Check that out, so check out the Responder course.

24:46 Like I said, it's free, so no problem.

24:48 There you go, check that out.

24:49 And the other one is really cool, but I have to really remind myself to use it.

24:53 So imagine this.

24:55 I'm working in an editor.

24:56 This is for PyCharm or any of the IntelliJ platforms like WebStorm or whatever.

25:01 And I've got like a big monitor up, a whole bunch of code on the screen, and I have my fingers on the keyboard.

25:06 And I want to go up to that section where I'm doing like open something, something as fin or whatever, right?

25:14 But I don't want to take my mouse and go over that.

25:16 I don't want to arrow up like 17 lines and then go to the right, control whatever.

25:20 So there's this thing called AceJump.

25:22 Have you heard of this?

25:23 >> No. >> AceJump lets you hit a hotkey.

25:25 I think it's on Windows, sorry, Mac, it's Command semicolon.

25:29 And then if you type, let's say, fi, it'll go and put a single character on every space that fi is a substring of on the screen.

25:39 Maybe the one I'm looking for has a j byte, so I'd say fi and hit j.

25:44 And it'll take you straight to it.

25:46 So it basically turns your screen, your code, into you do a little bit of a search and then one character keystroke to jump to that section of code.

25:55 >> That's cool.

25:55 >> It's super cool.

25:57 It's super hard to remember to do that, not just era, era, era, era, or mouse, or whatever, right?

26:02 But if I can remind myself to do this, it's gonna be great.

26:05 - Okay, well, I mean, you use arrows, man?

26:09 - Sometimes.

26:09 - There's a VI mode.

26:10 - True, true, true.

26:14 - Anyway, so, no, that's cool.

26:16 I'm gonna have to try that out.

26:17 - Yeah, so you just basically type as you search and the whole thing becomes like, sort of quick jump around your editor.

26:24 All right, are you ready for a pie joke?

26:26 - I am.

26:27 - I gotta hit it a few times.

26:28 What's the object-oriented way to become wealthy?

26:31 I don't know.

26:32 Inheritance.

26:33 Okay.

26:33 That's bad, right?

26:34 [laughs]

26:34 A good programmer is someone who always looks both ways before crossing a one-way street.

26:38 [laughs]

26:42 Child, Dad, why does the sun rise in the east and set in the west?

26:47 Dad, sun is working, don't touch it.

26:49 [laughs]

26:52 All right, I'll do one more for you because it's about Python 2.7.

26:55 triumphantly Beth removed Python 2.7 from her server in 2020.

27:00 Finally, she said with glee, only to see the announcement for Python 4.4.

27:04 Yeah.

27:06 All right.

27:08 That's pretty cool.

27:10 Well, I guess I guess we'll leave it there.

27:11 Yep, that's good.

27:12 All right, Brian.

27:12 Thanks for being here.

27:13 Thanks for finding all these items.

27:15 Thanks.

27:15 Yep.

27:15 Bye.

27:16 Thank you for listening to Python Bytes.

27:18 Follow the show on Twitter via @PythonBytes.

27:20 That's Python Bytes as in B-Y-T-E-S.

27:23 and get the full show notes at pythonbytes.fm. If you have a news item you want featured, just visit pythonbytes.fm and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Okken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page