Hey there, thanks for listening. Before we jump into this episode, I just want to remind you
that this episode is brought to you by us over at Talk Python Training and Brian through his pytest
book. So if you want to get hands-on and learn something with Python, be sure to consider our
courses over at Talk Python Training. Visit them via pythonbytes.fm/courses. And if you're
looking to do testing and get better with pytest, check out Brian's book at pythonbytes.fm slash
pytest. Enjoy the episode. Hello and welcome to Python Bytes, where we deliver Python news and
headlines directly to your earbuds. This is episode 253, recorded October 6th, 2021. I'm Brian Okken.
I'm Michael Kennedy. Yeah, name's CX. This is me. So welcome. Hey, before we jump into some of our
topics, could you tell us a little bit about yourself? Sure, of course. First of all, I'm super
excited to be here. A little bit nervous because it's my first podcast ever. And I'm very happy to
be on Python Bytes. It's the podcast I've been listening to, I think, for the last five years,
about the same time I got into Python. So right now, I'm... I started... Like recently, a month ago,
I started working at a new company, cybersecurity company called Pytho Benito.
They're doing some cool stuff, automated network perimeter security for Fortune 500 companies. Very
interesting approach. What I do there is I'm an infrastructure and Intel tools developer and Python,
of course. And I've been doing Python for the last six years. So as a developer, as a backend developer,
as an automation developer, I actually started my career as a Q&A engineer. I didn't have any background,
coding background. So I kind of learned the Python on the job starting from little script snippets. And then I got into
pytest and automation. And at some point, I just switched to, yeah, full-time developer. But still, like,
testing is something very precious to me. I'm very invested in it. So, yeah.
Kind of important to me, too.
Yeah, I know.
Yeah, awesome.
I know.
I'm out of doing.
Thank you.
Welcome.
Well, Michael, let's kick it off with some awesomeness.
Yeah, I love awesome things. So let's kick it off with awesome HTMLX.
So we've covered many awesome lists. And one of the hottest technologies in the Python space these days,
and at least with the web, is over at htmax.org. A really cool way to basically create apps that you
would normally create with Vue or React, but just do it all in Python and mostly on the server,
which is really cool. So let's see. Make sure I get the name right here.
Rajeshagar. Probably messed it up. Sorry. But put together this list. Thank you for keeping track of
all the things that are awesome that have to do with HTMLX. So you look down here, there's like
blog posts, tools, videos, examples. And what's kind of nice about it is it's not just,
here's a Python list of using this framework, but it's this framework in a lot of different situations
that might be useful to people. So for example, if you want to know how to use it in Django,
there's an example, rather a blog post for that. There's one for using Tailwind with Flask. There's
one for doing it with somewhere in here. I don't see it yet, but there's a Ruby on Rails one.
There's plugins for HTML. So if you do Craft, which is a CMS, there's Django integration,
Rails integration, all kinds of stuff. And there's videos. Check out number three here,
Python bytes, HTMLX, dynamic and live HTML without JavaScript. That's our YouTube live
stream. And we had, I think that was Hannah Stepnick who was on with us on that episode.
And so there's some videos you can check out about it. There's also
the talk Python episode where I interviewed Carson Gross, the creator. So they're including our stuff,
which is very much appreciated. But then also a bunch of examples for like Node.js and ASP.NET.
And oh my gosh, a lisp. A lisp is in there. But yeah, like plenty of Python ones as well.
Yeah. This is cool. And yeah, I actually gave some try using HTML mix following one of the podcasts I
listened to. I don't do a lot of front end, but it was really nice to get rid of some ad hoc
JavaScript stuff I did. It works so well, doesn't it?
Oh yeah. And I really don't, I really don't enjoy doing JavaScript because I'm not a front-end developer,
but sometimes I need to provide some kind of a UI interface and then it requires JavaScript. And then
like, yeah, I usually just take some snippets from Stack Overflow and throw it in there.
And when I tried HTMLX, it was so much cleaner. I could understand what's going on there. Very, very nice.
I think I need a sticker for my laptop that says, I really don't enjoy using JavaScript.
So one thing I would like to throw out there that people, when I, I'm doing a talk in San Francisco and
people heard the title, which is something like, you know, interactive Python web apps,
hold the JavaScript, something like that. And they're like, oh, why are you always hating on
JavaScript? I'm not, I don't think that this is so much about hating on JavaScript. If you want to do
JavaScript, knock yourself out. You can write, you can like a lot of these examples are node.js and
express using HTMX. But the three of us on this call, we're not like, I can't wait to run out and
write stuff that runs on node. We'd much rather go write stuff that runs on Python. So what this lets us
do is still use like Python code on the server, but then it just behaves as if it was running on the front.
And it's super smooth. Just like y'all said, like it really cleans things up and makes it simple.
Yeah. So here's a bunch of awesome stuff.
It's not just JavaScript. There's a bunch of other languages I don't want to work in either.
Exactly.
Awesome. Well, there's not a whole lot more to add to this, but it's nice when these emerging
technologies are coming along to get some help and examples and other resources. So thanks,
Rush, for putting together this awesome list.
Yeah. Well, I can't believe I got this topic. You guys. Yeah. Anyway, Python 3.10,
I'm so excited. It came out two days ago. I'm loving it. I've switched. I'm using it at work.
I'm using it at home. And it's not like it's new. I mean, one of the things there was an article.
I'll just go through a few topics. One, the logo is awesome. 310, the 310 launch logo.
Super cool. Yeah, I love it. I want a sticker like that. There's a couple of videos that I think are
good to at least know about. There's the launch party that started off with some awesome hats.
They basically actually walked through the entire launch process of making 310 live on camera.
It's three hours long though. I only watched a little bit, but great hats.
This is cool. Yeah. So this is by the people who are actually releasing. It's not a party celebrating
the launch. It's the actual launch.
Yeah, the actual launch. Right. It's awesome.
It was neat. But chat brains hosted, I think that was a prerecorded thing, but there was a
what's new in Python 3.10 video that I, this is more, more, more consumable at 33 minutes.
Um, I, I definitely, I watched this, while it was live or while it was being broadcast at first.
Yes. A couple of days ago. And it's really interesting. This, this one's really great.
I thought I knew everything that was coming in 310. The thing that I really love about this video is,
um, there's a Łukasz Langa and, camera or somebody else talked about, do you know,
the other person was Sebastian Ramirez and Brant Boucher. Okay. and, Lucas,
talked about some of the, some of the details on, well, a couple of them were talking about the,
uh, I'm getting this wrong. What's the thing? the structural pattern matching. That's it.
Yes. super, super switch. Yeah. So is structural pattern matching. It's gonna,
it's really cool. I haven't come up with a reason to use it yet. but, give me time, but the,
there was a discussion of why the, like a whole, a big discussion on this, which was neat. It was a kind
of a tutorial right there. And then also a discussion of why black doesn't work for it
yet. So that was the odd takeaway that I didn't, wasn't expecting is if you're really addicted to
black, you can't use structural pattern matching and black together right now. they will catch
up, but they're, they have two different parsers for Python and getting them all cut up will be,
uh, it'll take a little time. So be patient. Nice. Yeah. That's huge. But I guess if you want to use,
uh, the, if you still want to use black, you just need to just, do formatting off on the block when
you use, pattern matching. So yeah, actually I have to put it in a different file. Cause you can't,
the format off doesn't work in line in the file with it. I tried that and it didn't work.
Interesting. It didn't work. Oh, that's a, that's a bummer. Okay.
But all the other features of three 10 seem to work fine. So it's good. Yeah. Very nice. some of the
some of the things that jump out that are exciting for me is X pipe Y versus rather than, X,
you know, union of X comma Y or optional of X versus X comma or X pipe. None. Those, those are nice.
The additional type information and better error messages. Those are the things that I'm looking
forward to, except for, I'm not really looking forward to errors. I generally don't like that,
but once you're there, I prefer better error messages. I think everybody teaching Python is going
to love the error messages. So. Oh, the, the error messages are pretty awesome. Just a few days ago,
I was refactoring some code and I had some, well, a bit complex expression. It was like nested deep and
I needed to do some asserting. And so another parenthesis, and I guess I missed something.
And then I would have, I had this error, like expression is expected. And we're like, what expression?
It's all right there. And I wasted literally like about three minutes figuring out what expression
it's missing. And eventually they end up like, I missed some curly brackets. And I really expect,
I mean, yeah. Pattern matching is great. The, the pie painting is awesome. But those specific,
like little things are, I don't know, I think like really bombs your dev experience. So yeah.
Yeah. It definitely does. Speaking of better error messages and stuff, I'm planning on just integrating
a rich, like the trace back stuff and all those kinds of things just into all my apps. Cause it's just
better. And it's one line of code at the top. So very nice. Yeah. That's cool. Yeah. All right. Good one,
Brian. All right. Yeah. You're up with the next one. Yeah. So it's a tool I've stumbled upon a while
when I was looking for some kind of a solution for bundling all my, all our analysis tools in one,
and then we have like large code bases and we use a microservices. So that we have a lot of repositories.
And of course we would like to use some linking. and then we added pipeline style and then we added
another package because we found it pretty useful called culture that finds that some unused, the code
then pointed out that maybe it should be removed or refactor, which is quite cool.
Vulture. That is a fantastic name for that Lint feature. Yeah.
It goes in five inch dead code. Oh my gosh.
Yeah. Yeah. It's pretty cool.
Okay. Sorry. I just, I love the name.
Yeah. That's, that's one of the latest additions. And then, well, because we deal with the
some security and vulnerabilities, we decided also to add bandwidth to the whole party.
Uh, those are really awesome tools, but we started to get a bit frustrated. First of all,
each and every tool requires a sun configuration file, like profiling, like, every linker has
its own rules by that style. You want to ignore some stuff. Oh, it's kind of a, kind of a requires customization.
So we ended up having like four different customization profile files for each tool. And that's okay. I mean,
once you've done it, it's okay. But then people start to get really frustrated with their FTIs
because it became a bit slow because of the, all the tools run sequentially. So, and even more so,
they become a bit frustrated with all the types, all the different outputs. So let's say you have
issues in piling, and then you have problems with PID code style. And at first, we didn't, we just
started failing once you, once you have a failure in piling, you don't proceed, but you fix piling. And then,
oh, okay. Yay. But then you have errors in Python style and so on and so on. So it was really frustrating.
Um, so we said, okay, just okay. It fails, but let's continue. And then just, speed all the errors once, once it's done.
So, but still people had some issues and started reading the output because it's different format. And they're like,
okay, what does it want from me? What, what do I do? And, you know, and then the whole thing, the whole experience is,
okay, I finished working on my PR. I just want to post it and get a review in it. But then I get stuck in this
limbo of fixing all this kind of stuff. So we started thinking what can, improve the, user and the
dev, the dev experience. So people will get frustrated. Yeah. Because people want people to take the
data. Yeah. They start a disabling creatures and that's something that we didn't want.
Yeah. Then your CI starts to lose all its value and everything. Right?
Exactly. Exactly. So I kind of stumbled on a prospector and I, I say stumble because it was,
was always there. It's actually brought, brought by PySecure, the same, the same guys, the same
organization that are responsible for piling and for PyCock style. But somehow I missed the
whole bundle thing that called prospector. I guess it's a bit less popular. So we started using it.
Uh, it bundled all our, analysis tools together in one run and in one unified output. So it's much
easier when you have the output just, just to read it and understand what's going on. And more than that,
some bonuses, we discovered some more tools that it provides that we didn't be weren't even familiar
with such as the McCabe complexity analysis, which, provides, points out some kind of a cop,
like in case you have a very big, function with nested conditions and stuff.
Nice. Is that like cyclomatic complexity and stuff like that?
Exactly. Yeah. So there's actually a link there inside that, takes
you to Wikipedia and explains how all those things are calculated, but it's pretty, pretty nice.
Uh, some, you, you cannot always follow it through because sometimes, well, you have a complex function
in the legacy code and don't necessarily want to mess with it, but it's nice to have this information
that you can put in a backlog. So that's something we discovered that there's also pyroma if you're developing packages.
So if you have like some missing, let's say contributor, RFC or, so it will point out all the stuff there.
Um, you have the dodgy, that points out if you have like some sensitive data such as passwords or like AWS keys or some things you not necessarily want to include in your code way.
So a lot of goodies that come with this prospector that actually bundles a lot of analysis tools, which is cool.
But, as I said, for us, it really improve our experience because it's one output and one profile configuration,
which means instead of having like a configuration file for each of the tools, you have only one to rule them all.
And more than that, you have profile, which means like, let's say you have, at some point you would like to run my type.
Okay. But in some point you don't want, like, if you are merging to master, maybe you want to check vulnerabilities at that point, but not on every commit because you're still developing.
So super useful. And surprisingly, it runs faster than each tool on its own.
Wow. That is super cool.
It takes some time. It takes some time. I mean, it's not a super fast because, first of all, it installs all the required tools for just in one bundle.
And the execution is still the same execution for all the tools, but yeah, it's really simplified thing. So highly recommended.
Cool. Good recommendation. out in the live stream, Paul Ansel has a question. Not sure if you know the answer.
Is there a way to add a comment to your code for her example, hash, no prospector to tell it that a given line is actually not a problem, similar to how bandit would disable warnings with hash. No sec.
Um, so first factor is just a bundle. It's, like behind the scene, it just indicates the same tool. So you would use the same, disable piling or disable pilot style or no key way. So the, the rules there apply to each tool differently.
Got it. Makes sense. Cool. All right. Am I up next, Brian? yes. I think so. so another topic on rich, I feel like we're always talking about rich now. super fun. I actually just had Will McGugan, who I see out in the audience. Hey, Will, on talk Python. So that was really fun. So here's the thing from Avi Pearl, not Avi Python, but you know, we'll still accept it.
Just kidding. That's just the last name. Thank you Avi for sending this over and let us know about it. so Kunyan Tran created this cool terminal based visualizer for Panda's data frames. So she's into data science and stuff like that. And like many things that have to do with rich in UI, just having a screen animation is, is really all you need to know whether or not this is useful for you.
And so you can just go to the website that we'll link to the GitHub repo and it's got an animated GIF right on the front there. Super nice. So just imagine you are in a Jupyter notebook and you went to a data frame, you said DF dot head or tail, something like that. And you get a little table that comes out. Well, here's one with animation and color and all that stuff as a rich table, you know, the rich library generating the table of the data frame right there.
So if you're creating something in the terminal and you want a nice output for a data frame, it's pretty simple. The code that you got to write is super easy. So for example, you come up with a data frame somehow, and then you just say from rich data frame and import pretty fine. And then just pretty fine your data frame. And that's it done.
Like, yeah, it's cool, right? You can also apply it to just regular dictionaries and stuff like that. And you can control things like limit the number of rows that come back, how many columns will be shown in case there's a ton.
You don't want to fill the screen. Of course, you can transform your data frame. But if you just want a quick like, hey, just show me the first few columns, it'll do that. You can either view the head or the tail effectively. You know, if you're going to say, give me 20 columns, there's 2000. Well, I think that by default, it shows the first the head, but you can also show it in reverse and clear the console. So it just fills the screen, things like that. So even control the animation.
So not a lot to do with this. But if it's useful to you, I think, I mean, like not a lot of gears and ways to use it. But I think if it's useful to you, you'll really find it interesting.
Yeah, all those pretty colors. I like it.
Yeah, yeah, yeah. I love the colors. So super cool.
So Rich has a ton of stuff in it. But I mean, I use the tables like all over the place because it's just the easiest and prettiest way to display a table right now in a CLI application.
Awesome.
Like, love it.
Love it. Love it.
Raw Inta out in the live stream says, well, Rich for the win once again, looks great for SSH session.
Yes, it does. And I hadn't really even thought about it for that scenario. But yeah, it definitely does.
And Jared says to us, Brian and me, I can't thank you enough for all your podcasts as great as they are.
The video format is even better. Yeah, Jared, thanks for being here. We always love having people on the show.
It gives us a little bit more interactive aspect for all the people listening afterwards.
Yeah.
Have that, Brian?
Definitely.
Go for it.
So, yeah. I'm going to go back to 3.10 for now. So I'm like, one of the things I'm excited about is the union types.
One of the things that was released is union types so that you can do X or Y. The thing that I really like about this, one of the things is the optional.
So you can instead of stuff you've got, I don't have an example here, but if you've got a function that takes an integer, but it might default to none, you can now say that the type is int or none, and then assign it the default value of none.
So it'd be int or none equal none. And that's, and it's really clean. One of the nice things about that is you don't have to import optional from typing. So that's really clean. But I was, I was like bummed because I actually, a lot of the projects I work on, I have to support more than just 3.10. I've got to support 3.7, 3.8.
What? You haven't already moved to 3.10? You guys are such laggards.
The stuff that, like, it's my application.
You've got two days. Come on.
If you're supporting Python packages, you want to support more than just one version of Python, right? A little bit. I mean, you don't have to.
No, of course.
If you want to. And so then I was excited to see that Adam Johnson put out, and I was actually, I want to shout out who told me about this. Oh, I lost it. Somebody else told me about this.
So sorry. But Adam Johnson wrote an article about type hints, how to upgrade syntax with pi upgrade.
So Anthony Sotili wrote a pi upgrade tool. And what it'll do is it does a lot of stuff.
But one of the things it does is it changes this, this union operator or this. Yeah.
For types. And it includes, what does it include? The from future import annotations that will allow you to use this type, union types and none in everything back to Python 3.7.
Very nice.
Supposedly. I haven't tried it on 3.7, but that's the claim.
So there's a nice article on how to upgrade your syntax.
This is a tool, like an automatic tool you just run.
Yeah. It's a pi upgrade.
Yeah.
That's cool.
Very nice.
Frederick out in the live stream says the union pipe really makes everything a lot less noisy and more readable. Love it.
Yes.
What are you going to offer? What are you going to suggest?
Oh, the next topic, you mean?
Oh, yeah. Sure.
Oh, I actually wanted to just say.
Just a comment on that. I thought you were going to have a comment on that.
Yeah, I actually have a little comment because I really like the pi upgrade stuff because I kind of feel that lately we have.
I enjoy type annotations, but like with each version, I mean, have like a little bit of change and then you have to comply to the previous one.
And then like what I would love to see is like some kind of a convention on how to do type hinting correctly because there are so many versions.
And well, because I'm a bit lazy, I don't always use type annotations, but I know I should.
And then I use some kind of what I use the tools like the monkey type and sometimes the pi annotate.
So they just add type annotations during run time.
And then it's a kind of a, then I kind of have some kind of a convention there because I feel like with hyper annotation, you can do it in so many ways.
Yeah, it's a little bit like string formatting.
Exactly.
But eventually we all, I think we can all agree that f-strings is the way to go.
Right.
Yes.
But right now we're kind of in a wild, wild west with cyber annotations because we have those, I think 3.5, 3, 3.3.
Yeah.
And then we have something new and then the old becomes obsolete or fraud upon and then, oh, you shouldn't do it like that.
But what I would like to see, maybe a tool such as the Pi upgrade that will tell me, okay, this is the convention.
This is how we do.
You should be doing your type on a type hinting from now on.
That's a good idea.
We saw you're doing the old way.
Here's the new way to that.
Yeah.
And I'm, I'm a bit confused.
I'm a bit, and I'm lazy and I'm confused.
Not entirely.
It's not a built in feature still.
Like you're using type annotation.
I see a lot of Python.
They slow just fluent for them.
And for me, it's like, okay, I'll write my code and then, okay, I'll start using some type hinting.
Yeah.
Sounds good.
Yeah.
I think Pi upgrade is the trick.
So it does do a lot of these, like the going from uppercase list to lowercase list and switching away from optional and things like that.
I may be running this later today because it looks good.
Some kind of a type hinting the formatter.
Just make it like it should be.
That's what I would like to see.
Yeah.
Exactly.
Brian, you know what time it is?
Extra time.
You got anything you want to put up there?
Throw out to people?
Yeah.
Actually, I don't have any links for it, but I should have had links up.
But I was, this is hard for me to believe actually.
But in like 2017, a long time ago, 2017, 2018, I submitted a defect to pytest, the pytest project.
And then I also wrote up a test to describe the defect, but I didn't know how to fix it.
So that was my first contribution to pytest is adding test code.
But this last week, I added two, had two pull requests and they both got accepted and merged.
So the next version of pytest will actually have my code in it.
So.
Super cool.
Very cool.
Hey, I just realized we skipped Yael's final thing.
Oh, right.
Oh, no.
Yeah.
Sorry.
Yeah.
Tell us about that before we get to the rest of the extras.
That's fine.
So, yeah.
I feel like you've got these cool ways to like bring together multiple tools.
Instead of telling people about Bandit, you're like, here's how to use Bandit, all these things.
Or instead of Black, here's how to like do all these different things.
Yeah.
I kind of like combining things and then make it more general.
I mean, the Python ecosystem is so rich.
There are so many things.
Yeah.
So it's nice to bring some stuff together, bundled and easy to use.
So, darker is something also I stumble.
Well, I was recommended by a friend after I, after describing a problem or my resentment even to Black formatter.
I know it's not a popular take.
Maybe I shouldn't say it.
But until recently, I was quite well.
It's not that I don't enjoy Black formatting.
I think it looks great.
It's more readable.
It's nice.
But I had some major issues with, well, with myself and colleagues that we can get sometimes over into the app.
Like, okay, I start to write some code.
And I don't know if it's a bug piece or I'm adding some feature.
And I'm done.
But then, yay, I want to make it Black because it's cool.
And then I run Black on the model.
Or sometimes if I really want to go wild, I'll run it on the entire package.
And then I submit my PR.
And my PR, well, it includes the single bug fix or the little line I've added for the functionality or the fixing.
And then I have, like, one, I don't know, some hundred changed files because I ran Black.
Or even if it's in the model, like, the whole model looks, like, brand new.
And then if I have to use such code, I would say, okay, but where do I start?
Where do I begin?
Because I don't know what changed my...
Why are there so many changes, right?
Yeah.
And it became a real issue because, on one hand, there are a lot of developers that were really, like, into Black.
Let's make everything Black.
Let's make everything beautiful.
And on the other hand, we would get those huge PRs.
Like, okay, where do I start?
Where do I even start?
So we started restricting Black.
We said, we, at some point, we, as a group, we decided, okay, no more Black.
But that was also very frustrating.
And then I had some talks with a friend of mine.
I said, okay, you should use Darker.
And Darker is really tiny.
It's not a big package.
very lightweight.
And what it does, it takes a little bit more conservative approach.
It doesn't say, okay, just Black everything and have a huge PR.
It says, okay, you want to have, to convert your code being beautiful and Black.
But let's make it gradually.
And then you have, and then you eliminate this huge PR and this huge mess.
Just change the stuff you need.
Run the Docker just on the file or even on the entire code.
And then it will format only the changes you made in the file.
Okay.
So here's the pink.
Let's see.
Nice example here.
I love that.
I love that it's runs on the last Git changes.
And that it's actually dark.
It's very simple.
I can't believe no one thought of it before.
Like, so simple.
Because what it does, it just does Git diff, gets the changes.
And then just runs Black formatting, all those changes.
And then you have normal looking PR with nice formatting.
And yeah, you won't get the whole beautiful Black all in one.
And you'll make it gradually.
But eventually, I think it's more controlled, more constrained.
And I think it's better this way.
And we started using it a couple of months ago.
And I think it has a good progress.
And we just integrated it into our pre-commit hooks.
So it's kind of seamless.
It's not that you need to remember running Black.
Of course, you can also integrate it in PyCharm or ES Code.
I think even Vim for people who are fond of Vim and stuff.
I think it has some kind of a plugin as well.
I don't know who would do that.
Yeah.
I don't know.
Who are those people anyways?
But yeah, so it's simple.
Yeah.
It's really nice and made by, I hope I'll get the name right.
It's anti-cohoila.
Yes.
I hope I didn't know the name.
Yeah, awesome.
I think this is great.
Yeah.
Paul out in the audience has an interesting bit of feedback.
This would be super helpful if you're starting to enforce code standards on an already existent repo,
which is the most kind of code you work with.
So, yeah.
Yeah.
If you're starting like new projects, so yeah, black it all the way.
That's fine.
Yeah.
I've heard recommendations before to just have one commit that just does the black thing.
But one of the problems with that is you lose sort of the history of when the file really was last modified.
So if a file hasn't been touched in two years, it's kind of nice to leave it as not touched for two years so that you can kind of see the history.
Yeah.
For sure.
Yeah.
If you run black on a five-year-old call base, it would look like you did it all from the beginning.
On the other hand, if you want to up your commit status, number of lines changed way more than the rest of the team.
You can always do that.
Yeah.
You could.
All right.
I know, Yael, you have a couple of things that you want to give a shout out to at the end here as well.
So let's just keep going with those.
Yeah.
Sure.
So I have two things.
The first one is actually a colleague of mine.
And he's been writing a book, a very interesting book, a bit of a controversial book if you dive into it.
And he basically says object-oriented, it's good for some, but in general, when you deal with complex problems, the object-oriented programming might even make stuff a lot more complicated in terms of debugging, in terms of separation of concerns.
And then he presents some kind of a new way to deal with the data and how we process data.
So it's data-oriented programming.
I have to admit, I read some of the chapters, not all.
I didn't finish the book.
It's almost still a work in progress, but most of it's a bit.
But you don't have to agree on everything, but the whole approach is the combination of data-oriented programming with functional programming.
I think there's some benefits to it.
And some complex problems can be solved faster and easier and with less debugging strength.
Like for me, like I have this rule of thumb that if I have to activate debugger over and over again to understand what the code does, instead of just reading the code, it means that something with the code is not 100% right.
Okay.
Because the code should be readable.
And I encountered those issues when working with very heavy object-oriented code bases.
Like a lot of inheritance and multi-inheritance.
And then I went to Django and they used mixing.
It is hard.
It is hard to design.
It is hard to...
But mostly it is hard to read.
And this approach, it's interesting.
As I said, I'm not fully, like, I'm not fully agree that, okay, object-oriented should be gone from the world.
It's not my stand, but I think...
Some people have made that stand, but it still is around, isn't it?
Yeah, but I'm not completely on board with that.
But I think in some cases, there are approaches that are much more lightweight.
And the whole thing with data versus code separation, I think it's nice.
I think it's kind of...
Nice.
Yeah, it kind of rewires your brain a bit after you read the chapter or two.
Like, makes you...
Yeah, maybe it's one of those things like functional programming.
You don't necessarily do it all the time, but you read it and it gives you a different perspective, even if you don't totally adopt it.
Yeah, exactly.
That's a good thing.
Yeah.
Okay.
All right.
And a little bit self-promotion here.
So a few months ago, I released my first open source project, Cornell.
It was actually covered by Brian, I think, two months ago.
Yeah.
So I just wanted to do a little shout out to all developers out there who are looking to contribute to a little bit nice, with a very nice documentation project.
It's only the beginning.
What it does is that it's actually a record and a replay server for mock.
It's a mock server that we call real data and then can be used as part of the CI and for purposes for end-to-end testing.
Because if you have some kind of an entry point that starts a cascade of events, including salary or whatever, and just eventually you reach the part when you go out and send an HTTP request.
So here Cornell comes in handy.
We use it quite a lot.
I'm in my previous company and I'm trying to now integrate it in my current workplace and I think it has some potential.
Very cool.
And it's not very mature.
So I would love, like really, if someone wants to contribute even a title or documentation or whatever, we really warmly welcome all contributions.
So it's great.
Yeah, that's great.
Brian asked me on that episode where I thought the name came from.
And I thought Chris Cornell from Soundgarden and all that.
Is that correct?
Blackwell Sun and all those things.
Well, you see the face.
What the face reminds you of.
Yeah, it does.
I don't think I saw that, paid attention to that before.
But yeah, now that I see it, I'm more confident in my answer.
Yeah, you are correct.
Indeed.
Right on.
All right.
Well, I got a few more extras to share with the world.
Let's see.
I just like literally at midnight last night, released a new course, HTML plus Flass, modern web apps, hold the JavaScript.
So this is a three hour course that like dives into cool ways of putting HTML and Flass together.
And it also brings together some of the other things we've talked about on the podcast before.
So when I was creating this course, I didn't really like the way that you would reuse HTML.
I have a lot of duplication and other crummy stuff.
So I created the Jinja partials and Chameleon partials projects to make this code better.
But anyone who uses HTML with Jinja or Chameleon should definitely check those out.
That's covered in the course.
There's also just links to it.
Of course, it does cost money, but you can go and get the GitHub repo and check out the stuff there.
So that's really cool.
Build like a really fun little app there and add a bunch of HTML things to it.
So link in the show notes.
Check that out.
Yeah.
So we've got an update, an update from Dan.
So, Brian, did you cover this?
I covered this last time, I think.
Thanks.
But the update is, yeah, we were talking about having, so it'll go and do auto optional stuff
where if you say something is like x:nt equals none as a default value, it goes,
no, no, no, no, no, that doesn't make sense.
So it'll create an optional of int automatically and correct the typing.
But we made the comment, Brian, I think maybe you did.
I can't remember who, but said, oh, it'd be really cool if we could use the pipe syntax
that we just talked about earlier.
So auto optional has been updated to create x:pipeNone instead of optional of x, which is
really cool.
Yeah.
I love it.
I love how the podcast helps bring some of this feedback to the world.
Change the world.
That's right.
We have made a dent in the universe, Brian, and it is x:pipeNone.
Okay.
Coverage, Ned Batchelder just released coverage on Monday.
So coverage six, which is a major reason.
Python 2 has been expelled from coverage, which is all good.
And 30 third-party packages are automatically ignored, which could be a big change for some people.
All right.
Bunch of other stuff.
You can check it out if you care a lot.
Django328 is out with a couple of bug fixes about read-only fields and admin and some regression
bug going on.
So check that out as well.
Sweet.
Yep.
Well, I guess this might be a time for a joke.
Shall we finish it with a joke?
Yes.
As we often do.
All right.
Going back to the very reliable geek and poke here.
We have paired captcha, as in reCaptcha.
You know, the little pop-up.
Oh.
You get the different panels.
You've got to say, like, click all of the crosswalks or click all of the dogs or whatever.
All right, Brian.
Let's do this together like last time.
I'll do the first one, the woman developer or just computer user trying to get through this.
So is this a traffic light or just a light?
No idea.
I guess it would guess a traffic light.
Nope.
Does the gray pixel in the corner also belong to the street sign?
And on and on it goes.
It's a sad statement on our digital existence.
There's been some where I'm stumped.
I'm like, I don't know.
I know.
Next.
Next question, please.
Sometimes I just troll three times in a row.
It's so embarrassing.
Am I a machine?
I couldn't find all the mountains.
Yeah.
The worst is when you find all the stuff correctly, then it refreshes and go find some mountains.
And you're like, I just found them all.
Why are you doing this to me?
You seem like you like to find traffic lights.
Here, have some more.
You looked bored.
We got some more lights for you.
Yeah.
All right.
Well, that's the joke I brought for y'all.
Well, thanks.
And I appreciate you finding them.
That's cool.
Cool.
So thanks a lot, everybody.
And we'll wrap it up for today.
And thanks, everybody on the stream for joining us.
We really appreciate it.
Yeah.
Thanks.
Y'all, thank you especially for being here.
Yeah.
It was really fun.
Thank you.
Thanks for listening to Python Bytes.
Follow the show on Twitter via @pythonbytes.
That's Python Bytes as in B-Y-T-E-S.
Get the full show notes over at pythonbytes.fm.
If you have a news item we should cover, just visit pythonbytes.fm and click submit in the
nav bar.
We're always on the lookout for sharing something cool.
If you want to join us for the live recording, just visit the website and click live stream
to get notified of when our next episode goes live.
That's usually happening at noon Pacific on Wednesdays over at YouTube.
On behalf of myself and Brian Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.