Python Bytes - #253 A new Python for you, and for everyone!
Episode Date: October 7, 2021Topics covered in this episode: awesome-htmx Python 3.10 is here !!!! Prospector (almost) All Python analysis tools together Rich Pandas DataFrames Union types, baby! Make your code darker - Improv...ing Python code incrementally Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/253
Transcript
Discussion (0)
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 TalkPython 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 TalkPython Training.
Visit them via pythonbytes.fm slash 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 Ocken.
I'm Michael Kennedy.
Yeah, my name's Fiet. 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 a 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 started, like recently, a month ago, I started working at a new company,
a cybersecurity company called PytoBnito.
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 inter-output developer in 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 QN 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 full-time developer.
But still, testing is something very precious to me.
I'm very invested in it.
Kind of important to me, too.
Yeah, I know.
Yeah, awesome. I know I know. Yeah, awesome.
I know.
I'm out of doing.
Thank you.
Well, Michael, let's kick it off with some awesomeness.
Yeah, I love awesome things.
So let's kick it off with awesome HTMX.
So we've covered many awesome lists.
And one of the hottest technologies in the Python space these days, at least with the web, is over at htmx.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 make sure I get the name right here.
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 HTMX.
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 HTMS.
Like, 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, HTMX,
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.
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
frontend, but it was
really nice to get
rid of some ad hoc
JavaScript
stuff I did.
It works so well, doesn't it?
Yeah, and 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 I usually just take
some snippets from Stack Overflow and throw it
in there.
When I tried HTMX,
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 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 end.
It's super smooth, just like y'all said.
Like it really cleans things up and makes it simple.
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, Raj, for putting together this awesome list. 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's awesome. 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 um there's the uh the launch
party um that was that started off with some awesome hats uh they basically actually walked
through the entire launch process of going of making 310 live and on on on camera it's three
hours long though i only watched a little bit but uh 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, that's awesome.
It was neat.
But JetBrains 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 consumable at 33 minutes.
I watched this while it was live or while it was being broadcast at first, just a couple
of days ago.
And it's really interesting.
This one's really great.
I thought I knew everything that was coming in 3.10.
The thing that I really love about this video is um there's uh
lucas langa and um i can't remember somebody else talked about do you know the other person was
sebastian ramirez and brant boucher okay um and uh lucas uh talked about some of the
some of the details on well a couple of them are talking about the,
I'm getting this wrong.
What's the thing?
The structural pattern matching, that's it.
Yes.
Super switch.
Yeah.
So is structural pattern matching,
it's really cool.
I haven't come up with a reason to use it yet,
but give me time.
But there was a discussion of why,
like a big discussion on this, which was neat.
It was 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 wasn't expecting is, if you're really addicted to black, you can't use structural pattern matching in black together right now. They will catch up, but they have two different parsers for Python,
and getting them all cut up will be, it'll take a little time.
So be patient.
Nice.
Yeah, this is big news.
Yeah, that's huge.
But I guess if you want to use, if you still want to use black, you just need to do formatting off on
the block when you use
pattern matching.
You actually have to put it in a different file because
the format off doesn't work
in the file
with it. I tried
that and it didn't work.
Interesting.
It didn't work.
That's a bummer.
But all the other features of 3.10 seem to work fine.
So it's good.
Yeah, very nice.
Some of the things that jump out that are exciting for me is x pipe y 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 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 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 little things, I don't know,
I think really bumps your dev experience.
Yeah, it definitely does.
Speaking of better error messages and stuff,
I'm planning on just integrating rich,
like the traceback stuff and all those kinds of things
just into all my apps because it's just better. And it's one line of code at the top, so very 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, y'all you're up with the next one.
Yeah.
So it's a tool I've stumbled upon a while ago when I was looking for some kind of a solution for bundling all our analysis tools under one umbrella.
So we have large code bases,
and we use microservices,
so we have a lot of repositories.
And of course, we would like to use some linking.
And then we added PyPortStyle.
And then we added another package because we found it pretty useful called Vulture
that finds some unused code and points it out that maybe it should be removed or refactor,
which is quite cool.
Vulture. That is a fantastic name for that Lint feature.
It goes in Python's dead code.
Oh my gosh.
Yeah, it's pretty cool.
Sorry, I just, I love the name.
Yeah, that's one of the latest additions.
And then because we deal with some security and vulnerabilities,
we decided also to add bandwidth to the whole party.
Those are really awesome tools, but we started to get a bit frustrated.
First of all, each and every tool requires its own configuration file,
like profiling, like every linker has its own rules by that style.
You want to ignore some stuff, it kind of 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 started to get really frustrated with their CI because it became a bit slow because all the tools run sequentially.
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 pylons
and then you have problems with bytecode style.
And at first,
we just started piling.
Once you have a piling,
you don't proceed so you fix
filings and then okay yay
but then you have errors in Python
file and so on and so on so it
was really frustrating
so we said okay
it fails but let's continue
and then just speed all the
errors once it's done
but still people
had some issues
and started reading the output because it's a different format
and they're like, okay, what does it want from me?
What do I do?
And, you know, and then the whole experience is, okay, I
finished working on my PR.
I just want to post it and get a review on 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 experience
so people won't get frustrated with CI.
Because once people start a disabling feature,
then that's something that we didn't want.
Then your CI starts to lose all its value and everything, right?
Exactly.
Exactly.
So I kind of stumbled on Prospector.
And I say stumbled because it was always there.
It's actually brought by PyCQA, the same guys, the same organization that are responsible
for PyLink and for PyProcStyle.
Somehow I missed the whole bundle thing that's called Perspector.
I guess it's a bit less popular.
So we started using it.
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 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 weren't even familiar with,
such as the McCabe complexity analysis,
which points out some kind of a,
like in case you have a very big function
with nested conditions and stuff.
Nice.
Is that like cyclometric complexity
and stuff like that?
Exactly, yes.
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 nice.
You cannot always follow it through because sometimes
you have a complex function in the legacy code and you don't necessarily
want to mess with it. But it's nice to have this information or you can
put it in a backlog.
So that's something we discovered.
There's also Pyroma
if you're developing packages.
So if you have some missing
let's say contributor
RFC or so it will
point out all the stuff
there. You have
the dodgy package
that points out
if you have some
sensitive data, such as passwords
or AWS keys
or some things you
not necessarily want to include
in your codeway.
So a lot of goodies
that come with this
perspective that actually
bundles a lot of analysis tools,
which is cool, but as I said,
for us, it really improves our experience
because it's one output and one profile configuration,
which means instead of having a configuration file
for each of the tools,
you have only one tool demo,
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 eject vulnerabilities at that point, but not on every commit because they're still developing. So super useful.
And surprisingly, it runs faster than each tool on its own.
I mean, it takes some time.
It takes some time.
I mean, it's not super fast because, first of all,
it installs all the required tools just in one bundle.
And the execution is still the same installs all the required tools just in one bundle.
And the execution is still the same execution for all the tools.
But yeah, it really simplifies things.
So highly recommended.
Cool, good recommendation.
Out in the live stream, Paul Ansell has a question.
Not sure if you know the answer.
Is there a way to add a comment to your code?
For 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?
So prospector is just a bundle.
It's like behind the scene,
it just executes the same tool.
So you would use the same disable pylint
or disable Python style or no QA.
So the rules there
apply to each tool
differently. Got it. Makes sense.
Cool.
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, um, on talk Python. So that was really fun.
So here's something from Avi Pearl, not Avi Python, but you know, we'll still accept it.
Just get that 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 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.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,
import prettify, and then just prettify your
data frame and that's it done like so you 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 this 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.
If you're going to say, give me 20 columns, there's 2,000.
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.
I love them.
Love it, love it.
Raw Inta out in the live stream says,
whoa, 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 they,
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. Is that Brian? Definitely. Go for it. So yeah. I'm going to go back to 310 for
now. So I'm like, one of the things I'm excited about is the union types. Like you said, for
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 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 like bummed
because 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 had 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 if you want to uh and so then
i was excited to to see that adam johnson put out and i was actually i want to shout out who told me
about this um oh i lost it somebody else told me about this uh so sorry but adam johnson wrote an
article about uh type hints how to upgrade syntax with pi upgrade so uh anthony uh satili wrote a
pi upgrade uh tool and what it'll do is it does a lot of stuff but one of the things it does is it
changes this um this union operator or this yeah for 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.
So 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 nice article on how to upgrade your syntax.
This is a tool, like an automatic tool you just run?
Yeah, it's a PyUpgrade.
Very nice.
Frederick out in the live stream says the UnionPipe really makes everything a lot less noisy and more readable.
Love it.
Yeah, 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... I thought you were going to have a comment
on that. Yeah, I actually have a little
comment because I really like the
PyUpgrade stuff because
I kind of feel that lately
we have...
I enjoy PyPanotations
but with each version
we have a little bit of change,
and then you have to comply to the previous one.
And then what I would love to see is some kind of a convention
on how to do type hinting correctly,
because there are so many versions.
And 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,
I use tools like MontyPy and sometimes PyAnnotate.
So they just add type annotations
during runtime.
And then it's a kind of,
then I kind of have
some kind of a convention
there because I feel
like with hyperlabelation
you can do it in so many ways.
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? But right now we're kind of in a wild west with cyberversations
because we have those 3.3, I think.
But they're evolving.
Like H, Neo, Python, Verbenin have something new,
and then they all become obsolete or frowned upon
and then, oh, you shouldn't do it like that.
But what I would like to see
maybe a tool such as the
PyUpgrade that will tell me,
okay, this is the convention.
This is how you should be doing
your type
hinting from now on.
We saw you're doing the old way. Here's the new way. Do that.
Yeah. Yeah, and I'm a good idea. We saw you're doing the old way. Here's the new way. Do that. Yeah.
Yeah.
And I'm a bit confused.
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 installs
that's 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 PyUpgrade is the
trick. So it does do a lot of these,
like going from uppercase
list to lowercase list and
switching away from optional and
things like that. I may be running this
later today. This is looking good.
Some kind of a type
hinting that formater
just makes it like it
should be. That's what I
would like to see.
Exactly. Brian, you know what
time it is? Extra time.
Extra time. You got anything
you want to put up there?
Yeah, actually I don't have any links
for it, but I should have had
links up.
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 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 it's going to be fun.
Very cool.
Hey, I just realized we skipped Yael's final thing.
Oh, right.
Oh, no.
Sorry.
Tell us about that before we get to the rest of the extras.
That's fine.
I feel like you've got these cool ways
to 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 do all these different things.
Yeah, 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 was
recommended by a friend after
describing
a problem
or my resentment
even to Black Formatr.
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 get sometimes over into the app.
Like, okay, I've started 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 review such code, I would say, okay, but where do I start?
Where do I begin?
Because I don't know what changed.
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 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.
At some point, 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 and said, okay, you should use
darker. And the darker is really tiny. It's not a big package. It's 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 ready.
And then it will format only the changes you made in the file.
Okay.
So here's, I think, let's see.
Nice example here.
I love that it runs on the last git changes.
It's actually that. It's very simple. I can't believe no one thought of it before.
Like, so simple. Because what it does, it just those git diffs get changes and then just front 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
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 when 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 ESCode. I think even Vim
for people who are fond of Vim and stuff. I think there's some kind of a plugin as
well.
I don't know who would do that.
Yeah, I don't know. Who aren't those people? Anyways. But yeah, so it's simple.
It's
made by
I hope
it's the name right.
It's
Anticohoida.
Yeah.
I think this is great.
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 he works 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, you know, kind of see the history. Yeah.
Because 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, y'all, you have a couple of things that you want to give a shout yeah you could all right i i know y'all you have a couple
of things that you want to give a shout out to at the end here as well so uh let's just keep going
with those yeah sure um so um i have two things the first one is actually a colleague of mine
and he's been writing a book very interesting book uh a bit of a controversial book, if you dive into it.
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 we present some kind of a new way to deal with the data
and how we process data so it does data oriented programming uh i i have to admit i read
some of the chapters not all i didn't finish the book it's still it's almost still work in progress
but most of it completed but and you can 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 are some benefits to it, and some complex problems can be so faster and
easier and with less debugging strength.
For me, 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 the something with the code is 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 MixSynth.
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
that okay
object oriented
should be gone
from the world
it's not
it's not my stand
but I think
some people have made that stand
but it still
it still is around
isn't it
yeah but
I'm not
I'm not
completely on board with that 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
rewires your brain a bit after you read a chapter or two. Yeah, maybe it's kind of it kind of changes your brain a bit
after you read
the chapter
or two
like makes you
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
and oh yeah
a little bit
self-promotion
here
so a few months ago I released my first open source project, Cornell,
which was actually covered by Brian, I think, two months ago.
Yeah.
Yeah, so I just wanted to do a little shout-out to all the developers out there
who are looking to contribute to a little, out to all the developers out there who are looking to contribute to
a little, but nice,
very nice documentation
project.
It's only the beginning.
What it does is
it's actually
a record and a replay server
for mock.
It's a mock server that
we call call real data
and then can be used as part of a 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.
Um, my previous company and I'm trying to now integrate it in my current, uh,
in our 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.
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?
Black Hole 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. Right on. All right. Well, I got a few more extras more confident in my answer. Yeah, you are correct. Indeed. Right on. Right on.
All right. Well, I got a few more extras to share with the world.
Let's see. I just like literally midnight last night released a new course,
HTMX plus Flask, Modern Web Apps, hold the JavaScript.
So this is a three-hour course that like dives into cool ways of putting HTMX and Flask together.
And it also brings together some of the other things
we've talked about on the podcast before.
Like 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
uh course does cost money but you can go and get the github repo and check out the the stuff there
so that's really cool we build like a really fun little app there and add a bunch of htmx things
to it so link in the show notes check that out uh auto optional we've got an update uh update from
dan so um 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 colon int 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 pipe none
instead of optional of x,
which is really cool.
Nice.
Yeah.
I love it. I love how the podcast helps bring some of this feedback is really cool. Nice. 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 xPipeNone.
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 third-party packages are automatically ignored,
which could be a big change for some people.
All right, a bunch of other stuff.
You can check it out if you care a lot.
Django 3.2.8 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 and
you get the different panels. You 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, uh, I guess it would, I would guess the traffic light.
Nope. Does the gray pixel in the corner also belong to the street sign? And on and on it goes.
A sad statement on our, our digital existence. There's been some where I'm stumped i'm like i don't know uh i know next next question
please sometimes i just roll three times in a row it's so embarrassing am i 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 more of them 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 all right well that's the joke i brought for you all well thanks um and i appreciate you finding
them that's uh it's cool so thanks a lot everybody um and finding them. That's 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 at Python Bytes.
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 Ocken,
this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and
colleagues.