Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 340, recorded June 13th, 2023.
I'm Michael Kennedy.
And I'm Brian Okken.
And this episode is brought to you by InfluxDB from Influx Data.
Awesome real-time DB, so time series database.
So we're excited to tell you about that later.
If you want to connect with us, you can find us all on Fostadon.org,
at MKennedy, at Brian Okken, and at Python Bytes.
Join us for the live show at pythonbytes.fm/live.
If you want to be part of the live stream and be in the audience,
all the older video versions are there as well.
And Brian, before we jump into your first topic, I've got some ideas, a request from the audience.
Okay.
So we are going to do an Ask Me Anything episode.
And really, that should be Ask Us Anything.
But the EWA is not typically how people announce it.
It's the AMA.
Not EWA.
So following convention standard acronyms there, Ask Us Anything.
I put together a Google form.
It is super short.
It says, what is your name?
What is your question?
And if you want, there's a few other fields for like second question, you know, and things like that.
But they're optional.
So if you're listening and you've ever wondered like, I wonder if Brian has a thought on an opinion on this.
Does he have an opinion on pytest plugins?
I don't know.
Does Michael have a thought on podcasting?
Whatever.
You know, please take the time and put that in there.
And, you know, we'll give you credit on the show as well.
If you don't want to have your name in there, just put anonymous or something.
So everyone check that out.
It is at, I created a short URL for it.
Let's see.
Pythonbys.fm slash AMA 2023.
So people can just go over there and check it out.
So that's going to be a lot of fun, Brian.
I don't know when we're scheduling it.
Probably pretty much when we get enough questions.
And that link will be in the show notes, right?
Absolutely.
Let's talk GUIs.
We haven't been on a GUI rant for a while.
Yeah.
I don't know if we've ever talked about GUIs.
I think maybe we have.
Perhaps.
It's been a while.
It has.
So I ran across this website called Python GUIs.
And it's like a whole website dedicated to Python GUIs.
And it's from a fellow named Martin Fitzpatrick.
He does consulting and some other stuff.
And this is pretty kind of cool.
This is fairly comprehensive.
There's, he has tutorials and references to books and everything like that.
But it's kind of a neat walkthrough, just the website itself.
Like, for instance, where do I begin?
His recommendation is doing PyQT 6 to start with if you don't have a preference.
However, there's, so let's like walk through a couple.
So if you just kind of walk through and he talks about what you should look about,
look, learn what tutorials are available.
And then it says continue.
So if you continue on with the PyQT 6, you just sort of walk through a tutorial around how to get QT Designer up and everything.
But there's a lot more than just QT here.
He's got tutorials on PyQT 6, QT 5, PySide, TK Ender.
There's even a tutorial, most recent tutorial I saw was getting started with Kivy for GUI development.
And it's a pretty lengthy getting started with Kivy thing.
So, and it covers Mac, Windows, Linux.
So it's pretty comprehensive.
It's kind of nice.
Yeah, this looks really nice.
I think choosing, I always feel like there's this paradox of choice.
And when I'm thinking about Python GUIs and it's like, well, there's no real clear answer.
And they're all kind of got their own oddities into them or their own restrictions.
But this is really cool to see them put all side by side and different tutorials helping you get started.
Yeah.
And yeah, I kind of like it.
I think a lot of people start with like TK Enter.
It's not TK in there.
It's a, you know, whatever, Tinker?
I forget what they call it with Python.
But it's not, I don't think that's a great place to start.
If you want something to look really nice, if you're going to support it, I think I kind of agree with them.
Maybe starting with Qt or Qt, sorry.
I grew up using Qt without knowing how to pronounce it.
People do pronounce it Qt, but yeah.
Anyway.
So if you want to learn about Python GUIs, maybe check out pythonguies.com.
So what do you got for us?
Oh, you're muted.
Before we move on, Brian, I do want to also just sort of second that, that I think Qt, those look like native applications that belong on your platform, right?
When you're not going to go like, oh, what, clearly some funky cross-platform API is what we're working with here right now.
This stuff looks pretty solid, right?
Yeah.
But it is TK Enter.
Why do we call it TK Enter?
Or TK Enter?
I don't know.
Because it's not TK.
Oh, because it's from the TK toolkit.
Got it.
Makes sense.
Got it.
That makes sense.
All right.
I have something for all the data scientists out there.
How about that?
Okay.
JupyterLab, which is the more capable, the more IDE-like experience for Jupyter Notebooks, 4.0 is here.
And it looks like a pretty mega release.
So they say, they being Jason Weil, say the next major release of the full feature development environment for Jupyter is here.
It is available for install right off PyPI in Conda Forge.
So if you have it, all you got to do is pip install --upgrade JupyterLab or Conda install dash C Conda Forge JupyterLab.
And it'll just upgrade in place for you.
So that's pretty excellent.
That's low maintenance, low effort upgrade.
I suspect there's a lot of stuff happening when you run those commands.
One of the big deals is JupyterLab is now faster.
There's a bunch of different ways in which they made that happening.
They made that happen where that's happening.
Notebook windowing is one of them where for a long notebook, instead of trying to process and load the whole thing, it'll just show the web browser viewport in terms of rendering, which will make some of the rendering faster.
Got CSS rule optimizations.
CodeMirror.
CodeMirror is the editor, text editor of the cell.
So CodeMirror 6 is out and MathJax 2 as well.
So if you're working with large notebooks, it should be much more efficient than JupyterLab 3, they say.
Awesome.
That's encouraging, right?
Yeah.
So cool.
Cool.
Let's see what else.
There's additional performance improvements, but you have to turn these on.
So you can get faster tab switching on Chromium-based browsers, which is unfortunately almost all of them, but that's the world we live in.
So you can do it.
But you've got to go settings, JupyterLab shell, switch hidden mode to content visibility.
And for even more better performance with long notebooks, you've got to go settings, notebooks, switch on a windowing mode to full.
So those are all options.
I told you there's a new CodeMirror.
That's the text editor for cells and file editors.
And it's upgraded to CodeMirror 6, which has a bunch of accessibility and performance improvements.
So people can check that out.
Let's change there.
Also, JupyterLab, I'm not sure I knew this, comes with a real-time collaboration, a.k.a. Google Docs style of collaboration.
Okay.
I didn't know that they'd do that.
I did not either.
I knew there were some notebook platforms that did, but I didn't realize JupyterLab did.
So they moved this RTC, real-time collaboration, to a separate package, Jupyter collaboration.
And that's available.
It's its own sort of thing.
Includes support for multiple cursors and selections.
New shared types.
And, yeah.
There's also a new extension manager for JupyterLab extensions.
Improved document search.
UI enhancements.
Like, more hotkeys and other styles.
Accessibility improvements.
Dev tool updates.
You know, like, how they build JupyterLab.
So TypeScript v5 and React v18.
Most people won't care about that.
But if you work on or try to customize the JupyterLab itself, then, like, you create an extension or something.
You probably care.
And finally, finally, finally, more than 100 bugs have been addressed and resolved, making it more stable and faster.
So that sounds like a pretty big deal, doesn't it?
Yeah.
Yes.
I think addressed means fixed and not just said hello to.
Exactly.
Hello, bug.
How shall I address you?
You shall call me a CVE, remote code executioner.
Oh, hey.
Nice to meet you.
No, probably not like that, right?
Yeah.
So that's cool.
Yeah.
Yeah, that is cool.
Getting some thumbs up from the audience as well.
Now, before we move on, I want to just talk about our sponsor real quick, InfluxDB.
So thanks to Influx for supporting the show.
So this episode of Python Bytes is brought to you by Influx Data, the makers of InfluxDB.
InfluxDB is the database purpose built for handling time series data at a massive scale for real-time analytics.
And developers can ingest, store, and analyze all types of time series data, metrics, events, traces in a single platform.
So how would boundless cardinality and lightning-fast SQL queries impact the way you develop real-time applications?
Check out Influx.
InfluxDB processes large time series data sets and provides low-latency SQL queries, making it the go-to choice for developers building real-time apps and seeking crucial insights.
For developer efficiency, InfluxDB helps you create IoT, analytics, and cloud applications using timestamped data rapidly and at scale.
It's designed to ingest billions of data points in real-time with unlimited cardinality.
InfluxDB streamlines building ones and deploying across the various platforms and environments from the edge, on-premises, and to the cloud.
So try them for free at pythonbytes.fm/InfluxDB.
The link is in your podcast player show notes.
Thank you to Influx Data for supporting the show.
Yeah, thank you.
I would like to talk about data, but not databases, but data types.
So this is kind of early to talk about, but hey, Brett Cannon can write about it on his blog.
I think it's fair game to talk about.
Brett Cannon had a proposal for a new kind of data type in Python called a struct.
Structs are new things.
We've lived with them in C for a long time, and other languages have other types.
I want to take a slight detour before I talk about the struct proposal from Brett.
And by proposal, I don't mean it's a PEP.
I don't think it's a PEP yet.
I think it's just an idea that he had.
But I think it's a cool idea.
But one of the things he talked about was algebraic data types.
And I got to admit, I haven't run across that term, algebraic data types, before like a week ago or so.
And then I've read two articles referring to it.
I'm used to ADTs being abstract data types, which are user-defined data types.
I don't know what the abstract means.
But anyway, algebraic ones are things that you can compose.
They're like abstract data types, but they're the things that you can compose like a list is a nil plus I don't know what that means.
But anyway, or tree is either is composed of empty or leaf or a node or something.
I'm still not quite sure how this makes anything to do with it.
Side diversion.
Anyway, so what does this look like?
And it's kind of a neat idea.
So jumping down to an example, with a struct, you could just say a point is a struct that takes X and Y and they're both integers, say.
And they have to be named or either positional or named, but they cannot be unnamed only.
I don't know why.
And then it'd be kind of like named classes or named tuples.
So you just access the stuff.
So you just declare this point.
And then you can get at it with like, say, P dot X or P dot Y.
And that's it, really.
And that's it.
And that's it, really.
And that's it.
And that's it, really.
And that's it.
And that's it, really.
And that's it.
And that's it, really.
So what is, what is this?
Why would we need this?
And I think it'd be really pretty cool to have something that simple.
And these structs would be, they'd not allow inheritance.
They would have no methods currently.
No methods, no inheritance.
And they're not mutable.
So you can't change the thing in it.
Why is that important?
Well, you then you can, you can use these things for keys and dictionaries and things like that.
And I just think this would be kind of cool because I use, I still with data types, even with data types and all the other goodies and adders and other goodies we have within Python, I still use name tuple a lot.
And I would totally use this for a lot of stuff and make it, especially if it was super fast.
So that's the idea.
Got any ideas?
It looks interesting.
And the, the, the, the defining syntax is kind of a one liner, a little bit, as you pointed out, like a named tuple, but it actually redefines class like thing with these optimizations, for example, dunder slots and kind of an data classes type thing with dunder equal and dunder hash.
So for people listening, you just say all in one line struct point a capital P for the type parentheses X comma Y.
That's the whole thing, right?
Yeah.
Tony out in the audience does wonder if it actually requires type annotations or if those are optional.
I would guess they're optional, but I like them.
So I don't know.
No, Brett says in his article, he would propose that they'd be, that they would be optional if you, if you just had two elements in something.
I mean, it's.
Yeah.
It seems consistent with Python that it would be optional, right?
Yeah.
And Tony also says, oh boy, I just started writing some Rust code at work.
So I'm interested in this for Python.
Yeah.
And that like the example that Brett gave of this, this point, he then showed the example of what, what would, what under the hood that would give you that you don't have to write.
And this example of like being able to, to convert it to a dictionary and replace parameters and using slots.
And I mean, there's a lot of code here that you don't need to write.
And yes, we do kind of have a data type data classes that sort of do this, but data classes are not, they're not optimized for data for having lots and lots of them.
So this would be like an optimization to have just like huge, huge data structure full of these things and have it still be fast.
So I think it'd be cool.
Having it be part of the language and maybe they could do optimizations around it for, for Python 3, 14 or whatever, you know, the faster CPython story.
Like for example, if you know, it's immutable, could you, could you make it allocate on just the stack and not actually go to the heap or things like this?
Right.
It'd be interesting.
Maybe that's a bridge too far, but I'm also interesting in how this, how this maps to like hardware because dealing with registers and, and hardware interfaces, there's in using C, we often have structs that we overlay over, over the top of like shared memory systems.
And, and this might be great use for something like that.
So, yeah.
A few more thoughts out there.
Grant says this is in line with what Mojo expresses.
We recently spoke about them.
I would love, love to have a struct in Python and blaze points out waiting for Hennick's opinion.
Maybe something like this.
We'll get into adders.
Yeah.
We'll see.
Yeah.
So, you know, sometimes Brian, it's about putting new stuff, new things into Python.
Sometimes, however, it's about ripping it out.
Yes.
So my next item is the realization of PEP 594.
So PEP 594, for those of you who don't know, I interviewed,
um, in Himes and Brett Cannon.
Speaking of Brett Cannon, it gets a back to back mention here about removing Python's dead batteries and this PEP 594.
And the idea is there is stuff in Python that makes no sense to be in Python.
It made sense when we had a world without the internet, when there was no concept of pip install and you really needed to kind of have Python come with a lot of its capabilities.
But now, if you go over to pypi.org, what is the current number?
We have 460,000 packages that are evolving like a larger definition of what Python is really, really fast.
Right.
Yeah.
So, for example, do you think it would make sense potentially to have an implementation of an async chat client built into the standard library of Python?
Maybe not.
I didn't know we had that.
Well, apparently we did.
We did until 3.12.
So that's not actually out yet, but it's gone.
Or like an SMTP daemon built into Python.
Right.
Do we, who is going to, who should be running their own mail client as part of Python itself?
You know, not even a separate package.
But more importantly, as was discussed over on the podcast, like this is overhead for all the core devs.
Do we want them working on things like the struct or do we want them still managing AIFC?
Yeah.
Like audio parsing for expired.
Nobody uses any more audio formats or CGI or telnet libraries or, you know, like chat clients.
So this basically is the announcement by Victor Stinner, I believe, saying we just removed 19 modules from Python 3.13 standard library.
These are the ones that have already been deprecated in 3.11 by PEP 5.9.4.
So, yeah, it's a big long list of them.
Like I said, like you pointed out some CGI image header, you know, mail stuff.
Also talks a little bit about the 3.12 and 3.11 ones, which are gone.
And then finally, it does say like, if this affects you, here's what you can do.
Do nothing.
Just stay on 3.11.
It says, in my opinion, it is a dangerous long-term choice.
However, you can do nothing.
You could create a group of volunteers to give life to this module, right?
The module is open source in the sense that Python's standard library is open source.
So, you go in there, you copy the files out, you make a PyPI package for it, and you find people who want to keep it going.
Yeah.
Or you vendor it.
You could copy the removed module just into your code itself, right?
Often it's just a .py file.
So you just vendor it in if you have to.
Honestly, that kind of seems like a pretty decent idea if you're like going low-key and you don't want to take on an open source project to remain, to maintain CGI.
You're just like, I just need this to run.
So you can copy that over.
And then there's a whole discussion on stuff around this, right, if you want.
So, anyway, 20 standard lib modules, they're out.
Yeah.
I think it's a good thing.
Just like, yeah.
Changing your batteries, kind of like your smoke detectors.
Yeah, exactly.
One more audience comment on this before we move on.
Grant says, happy for the Python core devs to kill all these modules.
Nothing makes senior engineers happier than calling bodies of code that aren't worth their weight.
I totally agree.
Right.
I would be happy, honestly, to see even a thinner, smaller Python standard library and then have more of these as pip installed.
But then when you install Python, it could kind of come pre-installed with 20 or 30 packages that if you want to upgrade them separately or I don't know.
So for things like if I want to run this on MicroPython, I wouldn't run it on WebAssembly under PyScript.
Like those situations are like you don't, the whole huge standard library is a problem.
So I don't know.
I feel like there's interesting stuff happening here.
But this is a good start.
Yeah, definitely.
I think it is.
So.
It is.
And is that all of our items?
I believe it is, isn't it?
It is.
And so some of these decisions are made by some of the core Python people on the, maybe on the Python board have something to do with some of this, perhaps.
So if the elections for, so one of our extras, I'd like to mention that the PSF announced that you need, if you are, if you care about elections, you kind of need to affirm your PSF membership voting status before the 15th.
So the cutoff is only a couple of days from now.
So, and I'm glad somebody, somebody mentioned this.
I can't remember where I saw it because it sort of went in my email box, email inbox and forgot, I forgot to look.
So I just affirmed my voting status this morning.
Excellent.
Well, I, I definitely affirmed mine a couple of days ago.
So nice.
It's all good.
But yeah, thanks for pointing out here.
This is great.
Okay.
Do you have any extras?
I do.
I just released a video collab with Julian Siqueira and Bob Belderbos from the PyBytes guys.
About five tips for budding Python developers, five career tips for budding Python developers as a 25 minute YouTube video.
So people can check that out.
That link is in your show notes.
If that sounds interesting to you.
It looks like Julian and Iron Man are looking at the same thing.
They are.
Julian has an Iron Man painting in the background behind him and they've got the same basic expression.
Pretty awesome.
So people can check that out.
Also, PyCon US 2023.
Remember that, Brian?
It was a while ago.
Yeah.
All the videos are out.
The videos are out.
Yay.
So there are some that are unavailable that are hidden.
I'm wondering if that's intentional or if that's like they were uploaded and hidden and they just forgot to be set to public.
So whoever is in charge of this might want to look why there's hidden videos published to this playlist.
But I don't know how many there are.
There's 142 videos, possibly some others as well that are hidden on this playlist.
So people can check it out.
This is basically all of PyCon, including the tutorials, if you want to go and kind of be part of that side of PyCon, which is excellent.
Nice.
So some are white and some are kind of this gray color.
Do you know what the difference is?
No.
No idea.
I think it's just the font, just the opening slide they use for their presentation.
I don't know if there's more to read into it than that.
I would like to maybe, I don't know if the people who are organizing next year's PyCon are listening.
I would like to propose just some kind of suggestion that might make this a little easier for them because this seems to be like a huge challenge from what I can tell.
Right.
PyCon was in April.
It's the middle of June.
And now the videos have come out.
So somebody has spent, you know, like a month and a half working on these videos.
And the community has been waiting a month and a half to get them, right?
Brian, how quickly is our video for Python Bytes out when we're done with it?
Like right when we're done.
I mean, like literally you could seek around in it as you like part of the stream.
Right.
We're just live streaming this using something like StreamYard.
And I know that there's a pay to attend virtually.
So maybe you don't want to have a public stream that people can use.
Maybe there's, but there's kind of just live streaming it to YouTube, even if that's an unlisted URL that you then, when the conference is over, flip to public.
Because I know that kind of you want to them, you don't necessarily don't want that to be going, have that whole live experience if you're not part of the, like I signed up for the virtual pass, which is great.
It's fine. But I think we could get these videos in a lot quicker and help people a lot if you did something like, you know, just like kind of live streamed it.
I know people might worry about the connectivity and it cutting out and the quality.
But with like, for example, StreamYard, it records local video.
It's like maximum quality.
Right. So there's if you if they had a stream deck where they could switch to the views and they had this going and recording locally, like these videos would be out as quick as you could click from unlisted to public on YouTube.
I do want to, I guess, disagree with you on that.
OK.
So so so PyCascades, for one, did the I don't know if it was available right away, but it was available soon after the entire day recordings.
She had the day recordings.
So if you if you wanted to find yours or something or find somebody's, you could kind of scroll through and find it.
It was a little it was a little it was just sort of going.
There was there wasn't any editing.
So those it was kind of hard to deal with.
I don't know how many people really watch those.
But the PyCon U.S.
videos, I didn't realize this at first.
Somebody corrected me.
They were available to people that either attended live or attended virtually and but didn't get to go to all this.
All the videos you're the online experience included being able to go in and watch videos, the other videos that you missed.
So those were available right away.
I didn't know about it.
So maybe advertising it more.
And also, it was a little hard to get to.
I got to say, it wasn't it wasn't easy.
I kind of would like to have like the schedule that you go into if you're logged in and you can see the schedule.
Why not have that be able to just link to the video that you missed or something like that?
I don't know.
There's there's better ways to make it a little bit easier.
It was a little hard to deal with, but it was available.
And I also think like, for instance, I'm going back to Pike Cascades.
I did a talk that the recording, the full day one had like glitches and had me up there at the beginning trying to get the audio ready.
And, you know, there's this getting started stuff, whereas having somebody be able to clean that up a bit would be good.
It's just I do also.
But I don't think that this is a long time from from when PyCon really was to now.
That's that's what?
Month.
I think it's too long.
That's too long.
I think it's too long.
So last year, 2022 was three three months, I believe.
I mean, it's a long time.
And I know it's a lot of work, but maybe maybe we could do something either either having rough cut ones out there initially or maybe have some of us volunteer.
I mean, I think we could have some volunteers to help clean them, clean them up for like good enough for now or sort of things.
I don't know.
Something.
Yeah, yeah, I agree.
We should have made this a whole item, I suppose, if we're talking this much.
The final thought is like with StreamYard, I don't know about the other ones.
You can literally go in before you hit publish.
You can just say trim this and go to click, click.
Okay.
Put it on YouTube now.
And then like that would be.
Yeah.
You know, not very much.
I agree that you don't want all the setup in that junk.
You want to like, welcome.
I'm Brian.
I'm talking about extensions, et cetera.
Right.
Like straight away.
And I can't get the slides to work.
And you know.
Yeah, exactly.
I know.
You want to skip all that crap.
Okay.
But good news.
The videos are out and people can check them out.
Okay.
Next.
Next, next, next.
A couple of version updates for Python.
Python 3.11.4, 3.10.12, 3.9.17, 3.8.17, 3.7.17.
And importantly, 3.12.beta2 are all out.
And you might be interested to know that both the 3.11 and 3.10, I suppose the others, include security fixes.
So nice to meet you, Mr. CVE.
For example, some problems that were solved in OpenSSL are now included.
There's 1, 2, 3, 4, 5, 6, 7, 8, maybe.
7 or 8 CVEs that were addressed on OpenSSL and some URL parsing and UUDecode and things that might look like you want to get fixed.
So check that out and upgrade if you can.
Python Bytes is already running 3.11.4.
So hooray for that.
Python Bytes.
I had a friend say they were working on upgrading to 3.10.
And I'm like, I don't even remember 3.10.
I've been like on a 3.11 for so long.
Yeah, absolutely.
Absolutely.
All right.
And then final call.
Just remember the Python Bytes AMA form.
Please get out there and submit that one more time.
Link's in the show notes.
Yes.
Right at the top.
Yes.
Ready for a joke?
I am.
This one comes to us from Ken Van Wick.
And it's a follow on from the apple.com.
Where's their?
There it is.
Their Vision Pro.
Right?
Yeah.
This thing is super expensive.
It looks really amazing.
I just, I don't, I've not got faith that it's going to take off.
But the ability to say like, I want to sit, I want to stand on the sideline right at the goal line at the Super Bowl and be able to look around and watch that as if I was there.
Like that would be epic.
Is that worth a $3,500 device?
Now, Brian, it's expensive.
But did you know, just like the Mac Pro, which was also recently announced, the Mac Pro, super expensive, $7,000 minimum.
But it doesn't come with the wheels.
If you buy it with the wheels, the wheels are $400 separate, right?
To get the wheel for your case.
So this is kind of like that.
Here's your, this comes to us from Kim Benwick and he says, actually this is Paul Mason's thing.
So you've got your $3,499 Vision Pro and it comes with the Apple branded $899 snorkel.
What do you think of that?
I think that's cool.
And actually, no, yeah.
If you could, if this would actually work, would work underwater so that you could go back out in your swimming pool and it would, you could look like you're actually on a coral reef.
That'd be cool.
That would be awesome.
Imagine you were in here playing something like Subnautica, one of those types of games, which is just amazing.
Like a game where you're underwater and exploring.
Yeah.
But in VR with your, with your Apple snorkel on, think how real that would be.
Yeah.
But actually underwater.
Like, but they're probably not.
Yes, exactly.
Yeah.
That'd be cool.
Oh boy.
Well, that's what I got for y'all.
$899 Apple snorkel not included.
Yeah.
Cool.
All right.
Nice.
Well, yeah, very fun.
Thank you everyone for the active chat in the live stream.
Thank you for everyone who listened, no matter how you listen.
And Brian, thanks as always.
Thank you.
Bye.