Brought to you by Talk Python Courses and Six Feet Up consulting

#359: gil--;

Published Thu, Nov 2, 2023, recorded Thu, Nov 2, 2023
0:00
00:43:04
Watch this episode on YouTube
Play on YouTube
Watch the live stream replay

About the show

Sponsored by Scout APM

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.

Michael #1: PyCon 2024 is up?

  • May 15 - May 23, 2024 - Pittsburgh, Pennsylvania
  • Conference breakdown:
    • Tutorials: May 15 - 16, 2024
    • Main Conference and Online: May 17 - 19, 2024
    • Job Fair: May 19, 2024
    • Sprints: May 20 - May 23, 2024
  • Tickets aren’t on sale yet
  • Unfortunately, I’m not going (see health and safety guidelines)
  • Attendance numbers over time on Wikipedia

Brian #2: Ruff formatter is production ready

Michael #3: gil--;

  • The Python Steering Council has now formally accepted PEP 703 ("Making the Global Interpreter Lock Optional in CPython")
  • The global interpreter lock will remain the default for CPython builds and python.org downloads.
  • A new build configuration flag, --disable-gil will be added to the configure script that will build CPython with support for running without the global interpreter lock.
  • "In short, the SC accepts PEP 703, but with clear provisio:
    • that the rollout be gradual and break as little as possible,
    • that we can roll back any changes that turn out to be too disruptive – which includes potentially rolling back all of PEP 703 entirely if necessary (however unlikely or undesirable we expect that to be)."
  • Removing the global interpreter lock requires substantial changes to CPython internals, but relatively few changes to the public Python and C APIs.
  • The implementation changes can be grouped into the following four categories:
    • Reference counting
    • Memory management
    • Container thread-safety
    • Locking and atomic APIs

Brian #4: Why is the Django Admin “Ugly”?

  • Vince Salvino
  • Some great quotes from the article:
    • "The Django admin is not ugly, rather, no effort was made to make it a beautiful end-user tool.” - Ken Whitesell
    • “The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around.” - Django docs
    • “The Django admin was built for Phil.” - Jacob Kaplan-Moss
    • “Even in the 0.9x days we used to have a image that said “Admin: it’s not your app”.” - Curtis Maloney
  • As Curtis put it, “encouraging people to build their own management interface, and treat admin as a DB admin tool, has saved a lot of people pain... the effort to customise it grows far faster than the payoffs.”

Extras

Brian:

Michael:

Joke: Searching YouTube for bug fixes

Episode Transcript

Collapse transcript

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

00:04 This is episode 359, recorded November 2nd.

00:08 And I am Brian Okken.

00:10 And I'm Michael Kennedy.

00:11 This episode is sponsored by Scout APM.

00:14 Listen to more about them a little later in the show.

00:17 Also, you can connect with us, Michael, Brian, and Python, Python Bytes.

00:23 So we're at mkennedy, @brianokken, and at Python Bytes, all on fostadon.org.

00:28 And if you're listening in just your earbuds, you can join us live at pythonbytes.fm/live, and you can be part of the audience.

00:37 So, Michael, what do you got for us?

00:39 Well, I have a quick follow-up to your Fosstodon Mastodon statement real quick before we dive into the first item, which is very exciting.

00:47 I know a lot of people will be excited to hear about it.

00:49 But fosstodon.org, the instance of Mastodon that many of us Python people are on, has gone invite only.

00:58 Of course, you don't need to be on Fossedon to participate in talking with us or interact.

01:03 That's the whole point of Mastodon.

01:05 However, a couple of people have said, hey, I'd really like to be on Fossedon and around

01:09 you guys in that community, but it's invite only.

01:12 I have a short-lived invite code for the listeners who promptly listen to our show if they want

01:18 to join that later.

01:19 Cool.

01:20 Yeah, because it's invite only now.

01:22 Okay.

01:22 All right.

01:23 On to the first item.

01:24 PyCon.

01:25 We all love PyCon, right?

01:26 Yeah.

01:26 And this is one of the things I look forward to most in the year in terms of events.

01:32 More on that in a minute.

01:33 But this is going to be, it's time for it to be in Pittsburgh, Pennsylvania.

01:38 So you can see there's a little airplane with a banner flying by on the website that's saying

01:43 Pittsburgh.

01:44 So, and there's a snake on a building.

01:46 Only once, it's not really the Python snake though.

01:48 Its eye is like more eardroppy, not circular.

01:51 Anyway, it's, there's a snake there by the community for the community.

01:55 All excellent.

01:56 and it's going to be a little later this year.

01:57 I think it was April last year.

01:59 It's going to be May 15th to 23rd in Pittsburgh, Pennsylvania, Tutorials.

02:03 What was really nice this year is they actually have the subschedule time

02:08 like prominently listed.

02:09 I think the last time it was like, if you dug in, you could find what days the actual main conference was,

02:16 but I'm not really sure if I want to do the sprints when are they, you know, like it just had the whole broad range.

02:21 So this is like the main conference is May 17 to 19, Two days before that are tutorials and so on.

02:28 Okay.

02:28 So it was in a Salt Lake City in the last two years, previous prior to that, it was in Cleveland, Ohio.

02:35 I do have a minor beef with the location here, like nothing against Pittsburgh.

02:39 Pittsburgh is awesome.

02:40 You know, I would love to go to Pittsburgh and meet people, but the goal of kind of moving PyCon around.

02:47 So that different people, at least within the, within North America, have a chance to have PyCon sometimes near them.

02:53 Seems like, well, it spent two years in Cleveland.

02:56 Pittsburgh is only a two-hour drive from Cleveland.

03:00 So it feels like it's kind of back in the same place again for now four years.

03:03 And I would love to see it move more locations, right?

03:07 Like maybe it could be in Mississippi or in somewhere like really, you know,

03:11 different than a sort of short upper Midwest, you know, just outside of the East Coast there.

03:19 On the other hand, East Coast, that's kind of the densest part of the U.S.

03:23 So it does give a lot of people a chance to go to it.

03:25 Are you calling people on the East Coast dense?

03:29 Yes.

03:29 They like to live in dense places.

03:31 Okay.

03:32 There's just, if you look at like light maps of the U.S. or just population maps, like there's way more people on the Eastern half than the Western half.

03:40 And that's how we like it.

03:41 All of us in Oregon.

03:43 Don't, don't, don't move to Oregon.

03:44 It's horrible here.

03:45 Yeah.

03:45 It's horrible.

03:46 It's rain.

03:46 It's really cold and rainy.

03:48 I haven't seen the sun for six years, Brian.

03:50 So people shouldn't come here.

03:51 Terrible.

03:52 Yeah.

03:52 Okay.

03:52 But the super excited, the call for proposals is open.

03:55 There's like a bunch of instructions under this little permanent, collapse menu,

04:00 but you can go to speaking and it says, proposing a talk, proposing a tutorial, a Sharla posters,

04:05 et cetera.

04:05 All this is good.

04:07 One other thing I did want to highlight, and this, this makes me honestly really disappointed.

04:12 So I hope people don't take this the wrong way.

04:14 Health and safety guidelines.

04:16 Okay.

04:16 So we're nice people.

04:18 It says, but us nice people are sick and diseased.

04:22 many of us uh and masks are going to be 100 required and 100 enforced and i don't know you

04:31 and i we were both there last year brian i kind of felt like you know from the cdc guidelines and

04:38 from just the general society like kind of people have vaccines at least as options um i've had i

04:45 just talked two weeks ago last week about how i got my fifth covid vaccine and i had kind of a

04:52 health crisis is kind of over and i feel like this is not ideal i i would like to see it just be i

04:58 i've seen other conferences like i think uh um the european ones often do whatever the local the

05:06 local rules are um and i think that's what it ought to be if if the local rules are open then

05:13 i mean i i guess my thoughts are if people are really concerned about it and i i legitimately

05:20 understand if you're caring for somebody that's uh immunocompromised or if you are you're going to

05:25 be concerned but your entire route to this place um like the airplane and everything there's going

05:32 to be full a bunch of people not wearing masks and so uh i think max mass optional seems to make

05:39 sense to me but i i think it yeah i agree with you 100 and i think this so let me just take a step

05:45 back last year, I feel like the experience of PyCon was quite degraded.

05:50 I had a great time.

05:51 I really appreciated the spending the time with people I got to and meeting

05:54 the people that I got to, but the ability to meet people, people and have

05:58 conversations on like loud expo floor halls.

06:00 It's hard to hear them because they were talking like this, you know?

06:07 Okay.

06:07 And so you want to interview people there?

06:10 Like people are like, why are you taking your mask off?

06:12 Like, well, I can't do a podcast with a mask on.

06:14 it's not going to come out right.

06:15 And so for me, 80% of the reason I go to PyCon is to meet people, to network, to record podcasts.

06:22 I did like the seven different company series of, the startup row and the awesome

06:29 episode with Sebastian Ramirez and Samuel Colvin and, and those types of things.

06:33 Like, that's why I go.

06:34 And I feel like the mass stuff takes away a lot of it.

06:37 I'm a hundred percent supportive.

06:38 If people want to wear a mask, it doesn't bother me.

06:41 I think it would even be totally good to say there's a section of the conference where if you feel uncomfortable and you want to get away from all those non-mask people, like you can go over there.

06:52 But I think, I know there's a bunch of people.

06:54 I know there are people who are very still freaked out about COVID, very freaked out about traveling.

07:00 But I think for every one of them, there's 10 people that are like, we can't live this way for the rest of our lives.

07:05 We just got to get back to it.

07:06 So the reason I care more than it just bothers me personally is I think this is not going

07:13 to be healthy for Python, the PSF in the long term.

07:18 I think it's going to cut.

07:19 A lot of people I spoke to are like, I don't want to last year.

07:22 They're like, I'm not sure if I'm going next year.

07:24 If it's like this again, this is not great.

07:26 The attendance, I looked.

07:28 Do I have it pulled up here?

07:29 No.

07:30 But you can look on Wikipedia and I linked to it in the show notes.

07:33 The prior years, it was like 3000 something, you know, 3,200 year over year over year was the attendance.

07:42 And it was 2000 last year.

07:44 Right.

07:45 Yeah.

07:45 And I think this is going to discourage more people from coming more than it will encourage the people who are really nervous about coming.

07:52 And if it, you know, PyCon is the vast majority of income and revenue for the PSF, like not a little bit, almost all of it.

08:02 And so when policies affect who's going, who's not that also, yeah, you found it right there.

08:08 I think people have to really consider like, okay, is there some sort of middle ground?

08:13 So I don't know the way it is right now.

08:15 I'm probably not going to PyCon, which makes me a little bummed out, but it was just, I

08:20 was so wiped out and worn out trying to have all those conversations, loud spaces through

08:26 masks, et cetera.

08:27 So we'll see.

08:28 I'm not a hundred percent sure, but if you look at the, you look at the final thing here,

08:34 it says there will be no rolling back.

08:36 This is the most lenient version of the health and safety standards we're going to have.

08:42 The only possibility is that we will have more restrictions potentially by the time

08:46 the conference comes up.

08:48 And for me, I don't know, it's makes me sad.

08:51 I'm not, I'm not anti-mask.

08:53 I'm not anti-vax as I already pointed out.

08:55 I wore a mask happily when there was an emergency, but you know, COVID is not going away.

09:00 Like is PyCon for the rest of our lives going to be this restrictive?

09:06 Seems not like the best path, but I'm not in charge and no one asked me, Brian.

09:12 Well, so anyway, this is my thoughts.

09:14 I'm excited that PyCon's here.

09:16 I hope people who want to go submit their talks.

09:19 There's an online option, but there's a very small chance with this level of

09:25 you must wear a mask you must stay away from people that it's going to be valuable for me to go

09:29 and i'm probably not going to okay i haven't decided myself yet so yeah all right well well

09:35 i'm sure this will come back it's in uh eight months from now seven months from now okay um

09:40 for people wanting to to submit a talk uh the again the call for proposals is open and it is open

09:46 until the uh end of the day anywhere so um on december 18th so you got from now or just december

09:53 18 but don't wait until the 17th submit early because uh these poor people that are reviewing

09:59 uh reviewing all of the proposals um i think it's good to get feedback early and start getting things

10:05 in early so yeah i think they even they have traditionally had like submission meant as a

10:11 mentor the right word but people to help you if you were doing your first time submission

10:14 to work with you i don't know i didn't see that this time but i haven't dug into all the details so

10:19 okay yeah yep awesome over you well uh we covered uh the Ruff formatter in september i believe

10:27 and it's only been a month later a month and a half um but um the Ruff formatter is now

10:33 we covered it when it was alpha it was like you can play with it um and now uh it is um i'll

10:39 scroll to the bottom they say um it is uh production ready so um the formatter is in a

10:47 is still beta release but they consider it production ready and i've played with it enough

10:52 it's pretty awesome so um what are some of the highlights uh it is so the black form or black

10:58 formatter the Ruff formatter is mostly like black but faster so it's how much faster it's like 30

11:05 times faster um and then there's other uh and black's already pretty darn fast there's like yapf

11:11 which I never use, but apparently it's 100 times faster than YAPF.

11:17 And very compatible.

11:19 It's very compatible with black, but also they list some of the differences.

11:22 So we've got was it?

11:24 Oh, this is a different different one.

11:26 So there's a link.

11:28 It's on this document also of of what is different.

11:31 So there's differences from black and in it.

11:34 So it's very thoughtful to go through and none of these I would disagree with.

11:40 So some reasonable changes from black, but just having a formatter for your entire team is what is really important, I think.

11:48 So I also really like that recently rough is supported.

11:54 So this is not part of the formatter, but that rough is built, brought in a lot more flake eight support and and and flake eight extensions.

12:03 And then also I sort and PI upgrade are part of rough now also.

12:06 But the Ruff format is just kind of like black, but faster.

12:10 So why not?

12:12 Anyway, there's some cool stuff about it.

12:14 It's a little more configurable.

12:16 There's a couple extra configurations you can do.

12:19 I think that you covered that not too long ago.

12:22 Yeah, I covered just the string side of things, which is nice.

12:26 But yeah, it's not massively configurable, but there's a few areas that people seem to really care about changing or not changing.

12:35 I also, since it's been widely adopted, we also have extensions for VS Code and PyCharm

12:44 that you can, and IntelliJ PyCharm, that you can add on so that you can have the formatting done

12:50 just right in your editor, which is great.

12:53 Yeah, and you can do things like when you, I think in the PyCharm one, if you just hit the reformat code,

12:58 I think it might even use Ruff format.

13:00 I'm not entirely sure, but I think you can make Ruff format be the format,

13:04 my code for me.

13:05 Yeah.

13:06 So I'm pretty excited about this.

13:09 I wasn't going to roll it out to the team when it is in alpha, but if they say it's good,

13:15 I'm good with it.

13:17 I trust Charlie and team.

13:20 Charlie and team now, so it's pretty exciting.

13:24 Also, in the article we're linking to, he talks about why they wanted to do a formatter,

13:31 but also it's kind of cool.

13:34 talks about the astral tools tool chain so the company is called astral now and they talk about

13:40 um how this is the first non-linting uh you know application that they've done so they are that

13:47 they were planning on branching out and doing more things around python tool chains uh but um faster

13:54 with building it with the rest so um this is this is the first so i i'm excited to see where they go

14:00 with this. So excellent. Yeah. So, you know, they go on and on about how much faster it is.

14:07 And that's, it's, it's interesting to me because the faster aspect is kind of a, it's like a

14:14 sideshow amazing, but not necessarily why I would pick it. I know if you had 5 million lines of

14:20 Python, yeah, it super, super matters, but most people don't, right? Like running across 350

14:28 Python files that make up talk by then training, for example, website and APIs and stuff.

14:33 And it literally is instant, which is like mind boggling.

14:36 You say format this, that applies all these rules, all these changes.

14:39 And it's just like done 27 files changed 324 not changed or whatever it says.

14:45 So it's awesome that it's fast.

14:46 I mean, if it were too slow, I would maybe not use it.

14:49 But to me, it's the configurability, right?

14:51 Like you can set the line length, you can set the string style if it really matters to you.

14:57 Yeah, I think like for me, that's why I'm so excited about the Ruff formatter more than the actual speed, because I have a 32 inch 4K monitor. Do I want like a little thin column of code? Because, you know, I want 80 columns. No, like I've got it set to 120. And it still is only two thirds of the screen on a large font. You know, it's, it just makes me more productive. Right. And I think I last time I talked about this, I talked about how using the single quote is, you know,

15:26 significantly fewer characters potentially when you're you're typing and if you have rsi like you

15:31 always think about like keystrokes and all that kind of stuff so yeah so for me that's that's

15:37 what counts yeah i uh for the string side i haven't talked about this for a while but there are

15:43 there are some applications where you're using a lot of double quotes and you cannot use single

15:48 quotes in in the thing that you're using in the string that you're passing so um if you're using

15:53 a lot of double quotes and stuff.

15:54 And I have a, so I have an application where the API itself uses a lot of,

15:59 a lot of, we have to pass in double quotes into the API.

16:03 So all of the strings that we're past setting up is single quoting makes way more sense.

16:09 So yeah.

16:10 And I also double checked one of the, one of the reasons I use double quotes

16:13 is if I'm going to say, and it's the way it should be in your code where you need an apostrophe, right?

16:20 Or possessiveness or whatever.

16:21 So then you could have a single quote, but then backslash escape the single quote.

16:26 But if you put double quotes, there's no need to escape it.

16:28 And I check that if that, if it would go from double quotes and a back to a quote over to

16:34 needing the escaped backslash rough, won't change it.

16:38 So it'll be single quote, single quote, double quotes.

16:40 It's fun.

16:41 Double quote and keep going.

16:43 I think that black does the same thing.

16:44 I don't think that I'll have to check, but I don't think black will change it if there's

16:48 an embedded one.

16:49 So yeah.

16:49 Yeah.

16:50 I'm not sure.

16:50 I wasn't necessarily.

16:51 I don't know at all whether it will, but just thinking like if you say, please use single quotes,

16:55 it's not like it starts putting escapes everywhere.

16:58 - Yeah.

17:00 - Whereas you can't do that in black.

17:02 Marco out there also points out that Ruff has a plugin to help upgrade from NumPy one to two,

17:08 which is pretty awesome.

17:09 Okay, didn't know that.

17:10 - Oh yeah.

17:10 - That's cool.

17:11 - Yeah, that's really cool.

17:12 - That's pretty great actually.

17:14 So cool.

17:14 - Sure is.

17:15 All right, well, what's next, Brian?

17:16 - Well, we'd like to thank our sponsor.

17:19 So this episode is brought to you by Scout APM.

17:22 Are you tired of spending hours trying to find the root cause of issues impacting performance?

17:27 Then you owe it to yourself to check out our sponsor this week, Scout APM.

17:31 Scout APM is a leading application performance monitoring tool that helps you identify and solve performance abnormalities faster and easier.

17:40 Scout APM ties bottlenecks such as memory leaks, slow database queries, background jobs, the dreaded N plus one queries problem common with ORMs and more directly to source code so that you can spend less time debugging and more time building.

17:53 You'll love Scout because it's built for developers by developers. Scout makes it easy to get set up and deliver insights in less than four minutes. Seriously, you could pause this episode, set up Scout and be back at it without missing a beat.

18:07 And the best part, Scout's pricing is affordable and straightforward.

18:10 Only pay for the data you use.

18:12 No hidden overage fees or per seat pricing.

18:15 Start your free trial and get instant insights today.

18:19 Visit pythonbytes.fm/scout.

18:22 Please use our link because that truly supports the show.

18:25 Thank you to Scout APM for supporting Python Bytes.

18:28 Yeah, that's awesome.

18:29 Thank you, Scout.

18:30 And being able to look at your code and see like, okay, here's, these are the parts of

18:35 my API or wherever else you're running that are slow or fast and it's in the data layer right now,

18:40 like awesome stuff. So very, very cool service. Now, a couple of bits of feedback from Kim here.

18:47 One is having been on the talk reviewing side several times of smaller regional conferences,

18:53 picons, indeed, please submit your stuff as early as possible. It makes it better for the reviewers

18:59 as well as you can get feedback sooner. And confirmation black will leave strings alone

19:04 that have one type of quote inside of the other, which is cool as it should.

19:08 Yeah.

19:09 Thanks, Kim.

19:09 All right.

19:11 What do we got for the next one?

19:12 This is so big, Brian.

19:14 Is it really big?

19:16 It's really big.

19:17 This is what I'm, the title I put, nowhere is it written, but in our show notes, the

19:23 title of the section will be gil minus minus semicolon because it's CPython and Python

19:30 has the GIL but the python steering council has now formally accepted the removal of the GIL in

19:37 python oh cool that is massive right well i thought it was i guess it is massive but i thought it was

19:42 already decided but was it oh it was kind of like tentative that maybe or something i don't know

19:47 there was i think pretty i think there was some pretty serious opposition to doing it because

19:52 it has massive effects on all the c extensions which you know why did we have this whole two

19:58 two to three drama.

19:59 We had it because a bunch of the libraries that people use, right?

20:04 When you say Python, you might mean the language or you might mean plus the 400, 500,000 other

20:09 libraries you can use the ecosystem and the ecosystem would say, well, this thing that

20:14 my library depends on doesn't support Python three.

20:18 So I have to stay on Python two.

20:19 And that went on insanely long.

20:21 The same similar type of deal would be here on anything that has like a C layer that has

20:28 form of concern of concurrency or being used in a library that might now use it concurrently when

20:33 it wasn't designed for it. So it's, it is pretty significant knock on effects. Yeah. Okay. So this

20:39 is PEP 703. It has officially been accepted, sort of, sort of. In short, this comes from,

20:47 comes from Hugo on Mastodon. So again, follows on Mastodon. That's where a lot of the action is,

20:53 But quotes the discussion over on discuss.python.org says, in short, the steering council accepts PEP 703, but with clear provisio that the rollout will be gradual and break as little as possible.

21:06 And that we can roll back any change that turns out to be too disruptive, which includes potentially 100% rollback of PEP 703.

21:15 So 100% rejection and reversal, if necessary, however unlikely or desirable, undesirable we expect that to be.

21:23 Okay.

21:24 Okay.

21:24 So there's a couple of things to note, like go over to the discuss here.

21:29 I had already pulled up, didn't I go to this guy?

21:31 Let's go to the PEP.

21:32 Now this is by Sam gross.

21:34 And I've talked several times about how excellent.

21:36 I think some of the work that he's been doing, because it's not just the Gil stuff, but

21:40 a lot of the kind of Cinder and speed stuff has been inspired by, Sam gross and the

21:46 folks over there.

21:47 So it says CPython's global interpreter lock.

21:50 the gil prevents multiple threads from executing python code at the same time you can have all the

21:55 threads you like in python only one of them will execute a python um instruction instruction code

22:03 like what you get out from when you say disassemble thing right like load adder or add to list that

22:09 kind of thing um so this PEP to be very clear this is a very um small subset that only affects people

22:17 that ask it to affect them this it proposes that adding a build not runtime but a compilation for

22:24 the cpython runtime that will let python code run without the global interpreter lock and the

22:31 necessary changes to make this possible right so when you compile it if you pass --disable

22:38 GIL then you'll get a special output of python that doesn't have the GIL that's pretty wild isn't

22:43 Yeah, I'm hoping that we'll like mere humans that don't want to recompile it can get a distro somewhere with it.

22:51 Yeah, I'm sure there'll be a like click here to alternative downloads, get the concurrent Python or something like that.

22:58 Right.

22:58 But the fact that it's not a not even a runtime flag, but a compile time flag is pretty wild.

23:04 So let's see.

23:05 There's a couple of things worth covering here.

23:08 It's a really long, it's a really long path.

23:10 So let's see.

23:11 So the GIL effects Python library usability.

23:14 And this is one of the things that's pretty interesting.

23:16 It says, look, there's a lot of libraries like they, they just go on and on about machine

23:21 learning libraries and the concurrency machine learning libraries need.

23:24 Get the strong sense that Sam Gill and people he's working with do stuff with machine learning

23:29 libraries of Python.

23:30 And that's their main motivation here, but obviously it has broader implications.

23:33 But the example here is PyTorch exposes a multi-processing based API called DataLower

23:40 for building data input pipelines.

23:43 It uses fork on Linux because it's better, et cetera, et cetera.

23:47 And basically, if you're going to do the weird tricks you got to do underneath the covers in Python

23:52 to make the async stuff truly parallel, as in I have 10 cores on my machine,

23:58 I want to use them all with threads or something like that.

24:01 However, the top-level API that you interact with is kind of janky.

24:07 It has to take into account certain things like objects can't be shared across multi-processing processes, right?

24:13 If it was threads, they could be, but they're not.

24:15 So they can't be, et cetera.

24:17 It says accessing GPUs within a data loader or worker quickly leads out of memory errors

24:24 because of context, like unlike threads within a process and all these different things, right?

24:28 So basically one of the motivations is allow people building libraries to build cleaner,

24:33 more self-contained, i.e. like sharing objects within a process better, right?

24:38 Not just I want better performance, which is obvious.

24:41 More stuff about this.

24:42 So yeah, you can look through it.

24:44 Like I said, it's quite the deal.

24:46 But one of the things that's interesting, as I touched on, a lot of the things in Cinder actually make sense here.

24:52 So this immortalization stuff about objects that have to have reference counting.

24:58 Because remember, the reference counting is what the GIL is about.

25:00 The GIL is all about memory, not concurrency.

25:03 It doesn't care about concurrency.

25:04 It just needs the memory management to not be concurrent.

25:09 So, well, that's a bit of a problem if you have more than one thread.

25:12 So it's about limiting.

25:13 It's about managing memory stuff, but making that not concurrent to make that better.

25:20 So a lot of the changes here are like, well, how can we allow the memory stuff to be concurrent,

25:25 basically?

25:25 So one of them is immortalized objects.

25:28 So for example, true, false, none, seven.

25:31 None of those need to have a reference count.

25:34 because they just get created at the start of the process.

25:37 There's only one of them, right?

25:38 There's no reason to like, oh, true's gone now.

25:40 No one's using true.

25:41 Oh, true's back, right?

25:42 There's just one true.

25:44 There's just one true.

25:45 It's a singleton.

25:45 And so all of those are what are now going to become what are called immortal objects.

25:50 And pi increment and pi decrement, so basically adding and removing the number of users

25:55 of that variable or object is a no op now, right?

25:58 Okay.

25:59 And that's good for you and me.

26:00 When we pass true and false around, even if we're not doing it concurrently,

26:04 It's just less instructions to like, yeah, use the structures.

26:08 Right.

26:08 And it's more shared memory, all those kinds of things.

26:10 They also are adding this thing called biased reference counting, which allows, basically

26:16 it says, look, we, the problem before was we had like one number that said number of references

26:22 to this object.

26:22 And when somebody wants to change it, you could either lock the thread, take a lock and lock

26:26 it every time per object, which is kind of crazy, or you just don't allow anybody to change

26:31 it more than one at a time.

26:33 Hence the GIL.

26:33 So this one says, well, let's change it so that on the thread that created the object,

26:39 it behaves the same, right?

26:41 There's no locks, none of that kind of stuff.

26:43 It just works on it, references it directly.

26:45 But if it's shared, there's like a secondary count, like others, other references or something

26:51 called bias reference counting, where those are managed in a thread safe way.

26:57 Because most of the time objects and things are not shared across threads,

27:01 Even in a multi-threaded app, the little temporary variables and loop variables,

27:04 those are still just on the one thread, right?

27:06 Stuff that shared is way less.

27:08 So the reference counting is changing to make that work.

27:11 And what else?

27:13 There's a bunch of pseudo code telling you this is some intense stuff.

27:16 A bunch of things about memory management, how that works, garbage collection,

27:20 et cetera, et cetera.

27:21 So I'm going to stop.

27:23 People can dive into it, but this is the big deal.

27:25 I think some of these changes will find their way just into Python period,

27:29 like the immortal objects.

27:31 Yeah.

27:32 There's no reason for that not to be in there.

27:34 That would just be useful for everyone.

27:35 But other ones like this by reference counting, maybe you'd be slower, maybe take more memory.

27:39 So maybe you don't want that, for example.

27:41 Yeah, maybe.

27:42 What do you think?

27:43 Oh, I think that removing the gil will be a sea change in Python.

27:48 Sorry.

27:49 I think you're right.

27:51 I think you're right.

27:51 I think it's exciting.

27:53 I think, you know, I've said this a bunch of times, like I haven't even looked recently.

27:58 I'm pretty sure this computer here has, I think, 10 cores that I'm on right now.

28:05 And if I run Python code, as hard as it can possibly go, it's 10%, right?

28:10 And that's just, it would be better if that wasn't completely baked into the runtime.

28:14 I actually hope that it's just kind of a non-event.

28:18 Like, it's a just, we just don't have a GIL anymore, and people can stop complaining about that.

28:22 And I don't care if things get a little, I mean, I like things to go faster.

28:26 I don't care if it goes a little slower because of this.

28:29 It's going to go faster eventually anyway.

28:31 Wait till the next round of CPUs coming out.

28:34 Right.

28:34 It's the next faster CPython release as well.

28:39 And then also just having people in Python being able to get used to doing more asynchronous and threaded things.

28:49 I think that's a good thing for the language.

28:51 So, yeah, I'm excited.

28:53 But a big part of me, I understand the going slow and we don't want to break everybody.

28:58 But part of me was like, just, oh, just do it and we'll clean up the mess afterwards.

29:03 Yeah.

29:04 Yeah.

29:04 I understand the caution.

29:06 Well, if they get it as a compilation flag, it's nothing there to say that, oh, you couldn't

29:12 possibly like that the way we compile Python that gets distributed in a few versions, right?

29:18 Right.

29:18 But eventually we're going to, eventually that won't be the case.

29:22 Eventually, we're going to try to get rid of that.

29:24 If it all goes well in a couple versions later or something, the default will be the no-gil version or something, with my guess.

29:33 And there'll be a flag to say to add the GIL if you really need it still for a while.

29:38 And then they'll work.

29:39 Yep, excellent.

29:40 Anyway.

29:41 I agree.

29:42 We'll see where it goes.

29:44 There was just this thread on Mastodon, which you were copying on.

29:46 I don't know if you saw it today, but asking what is Python 3.14 going to be called?

29:54 Of course, it's going to be the symbol Python because it's 3.14, right?

29:59 It's so incredible.

30:00 So maybe in Python, it'll be the default.

30:04 You never know.

30:06 Yeah.

30:07 You have to pause and do the I thing.

30:10 Python.

30:12 Exactly.

30:13 Yeah.

30:14 It's going to be fun to have.

30:15 that episode is going to be nonstop when we, when it's time to talk about the upcoming release of Pi.

30:23 Yeah.

30:24 Yeah.

30:24 The, the other follow on is like trying to guess when, when, when the release of 3.14.15 will come out.

30:34 Like that'll be maybe a couple of years after it'd be like a security release or something.

30:40 Yeah.

30:40 So, ah, oh, well, it'll be good.

30:44 Speaking of, I don't know what I was speaking of, but I want to cover why the Django admin is so ugly.

30:53 I didn't say it was ugly.

30:55 Vince Salvino says it's ugly.

30:57 You're going to get mail.

30:58 No, Vince will.

31:01 Anyway, I've noticed this before and kind of I understand it now, but I remember trying.

31:07 So I'm doing a Django project now.

31:09 I remember jumping into Django like years ago, and I was surprised when I jumped in again

31:16 and saw that the admin kind of looks the same as it did a long time ago.

31:21 And it was kind of, you know, there's been some minor changes and stuff,

31:24 but okay, this is actually a great article.

31:26 Why is the Django admin ugly?

31:29 There's some great quotes in here.

31:31 I'm going to jump down to them.

31:33 The Django admin is not ugly.

31:35 Rather, no effort was made to make it beautiful, a beautiful end user tool.

31:38 it looks like a developer made it oh okay i understand and that's from ken uh whitesel um

31:45 the another one uh the admins recommended use is limited to an organization's internal management

31:52 tool it's not intended for building your entire front end around um so the yeah yeah so that's

31:57 basically the gist of this also the django admin was built for phil one of my favorite quotes um

32:03 This is from Jacob Kaplan Moss.

32:05 Phil being the, what, Phil was the Phil Cothen?

32:10 Then editor of Lawrence.com.

32:12 Yeah, because the history of Django is it's around like newspaper publishing.

32:18 And so basically it's a database front end for people that are adminning a site.

32:27 It's not intended for end user stuff.

32:30 So I'm going to jump down.

32:33 There was apparently a quote from 0.9 days of admin.

32:36 It's not your app.

32:38 And the gist of it, where am I going to find it?

32:41 It comes from Curtis Maloney.

32:43 It says, encouraging people to build their own management interface and treat the admin as a DB admin tool has saved a lot of people pain.

32:51 The effort to customize it grows far faster than the payoffs.

32:55 So the gist of it is it's intentionally not that pretty because they don't want you to intentionally try to make it pretty

33:03 to expose it to end users.

33:05 It's supposed to be ugly.

33:07 It's not ugly.

33:08 It's just not supposed to be pretty.

33:10 Chris also says it's meant to be ugly.

33:13 Yeah.

33:13 Anyway, I appreciate the honesty of like, yeah, we know it looks like that,

33:20 but it works.

33:22 It's like the Craigslist of admin interfaces.

33:26 Oh, it's fancy for Craigslist.

33:28 Yeah.

33:28 - Yeah, anyway, good write up, Vince, so thanks.

33:32 - It is, and I think it's also pretty interesting to remind people, like, you know, really,

33:36 it's meant for people running the website, not something that should be user-facing.

33:40 - Well, yeah, and even that, like, if you're, you wouldn't, you'd have another interface

33:45 for like writers writing stuff, but if there was like a quick typo or something like that,

33:50 and somebody can just hop in and change the database, so.

33:55 - Yeah.

33:55 - And I have appreciated it.

33:57 There's been a lot of things that I've put together that having the admin interface there

34:02 is better than going right into the database, using SQL to change stuff.

34:08 And often, I don't have any user-facing admin.

34:11 It's just showing the data that's stored in there.

34:16 So anyway, it's fine.

34:18 Yeah.

34:18 Blaze out there suggests maybe using Textual to create a TUI admin.

34:23 That'll do it.

34:25 Yeah.

34:25 Let's replace it with something.

34:27 Yeah.

34:28 I'm not going to say you won't get normal.

34:30 You definitely won't get regular users to fire up an SSH session and do we

34:34 into it?

34:35 No.

34:35 Yeah.

34:36 But I'm, I'm, I'm waiting for somebody to build like, cause textual can build textual can have web interfaces now too.

34:43 Actually.

34:44 Yeah.

34:44 So you could have a, a, you could do a, a, like a skin on top of the Django admin and have it be a textual based

34:52 thing.

34:52 That'd be fun.

34:53 Yeah.

34:54 Indeed.

34:54 Waiting for that.

34:55 all right uh that's our items um uh do you have any extras for us i'm feeling extra today i do

35:02 okay let's see first of all this is a two points in time sort of thing andy mckay on mastodon says

35:10 uh what was it before it said the psf as in at the psf no longer is going to use x twitter i've

35:20 you know so many places are saying x the place you know formerly known as twitter like what an

35:26 insanely big fumble with branding like after six months that people can't just say the name like

35:31 people say meta and people know what they're talking about they don't have they don't say

35:35 x you know the thing that used to be twitter so i propose we just call it x twitter because a lot

35:39 of us are not on x twitter as much and it has x and it also tells you it's twitter so anyway how

35:44 How about Zitter?

35:45 Like, just take off the TW.

35:47 Just be a Zitter.

35:48 Yeah, there you go.

35:50 So the big news, really, the reason I bring this up is the at the PSF is now on Bostadon.org.

35:56 So therefore on Mastodon in general.

35:59 Nice.

35:59 And I encourage you to go follow them.

36:01 They have a lot of followers, I believe, already right away.

36:03 Let's see.

36:04 Yeah, 9,000 followers, which that might not sound like a lot.

36:07 But for Mastodon, that's a lot.

36:09 So we can get them a few more today.

36:11 Check that out.

36:12 Yeah.

36:12 It's like dog years.

36:14 Yes, exactly.

36:15 So now the post is updated saying, oh, they might actually come back because they originally said they're leaving Twitter.

36:22 They're leaving ex-Twitter.

36:23 But they actually might still use it.

36:25 Nobody's really sure anymore.

36:26 But at least they are on Faucet On.

36:28 So that's cool.

36:28 Check them out.

36:29 Yeah.

36:30 I have a feeling that there's a lot of like Twitter people that are, it's right only.

36:34 Like I'm a right only.

36:35 I've got a Twitter account, but it's right only.

36:37 I check it like once a month or something.

36:40 Yeah, mine's kind of like regular expressions as well.

36:42 Right only.

36:43 yeah so I I will I do people do send me messages there and I appreciate that

36:49 and I go check them out but in terms of like having conversations yeah okay

36:54 so that's one I have others big new announcement for a new course data science jumpstart

36:59 with 10 projects this is awesome yeah a little over 3 hours put together by Matt Harrison

37:05 who knows his his data science things so a lot of cool stuff that you can learn through here

37:10 basically exploring 10 different data sets like working with student CSV information Excel integration merging merging

37:20 data across different data sets like an Airbnb data set example and so on and so on so if people

37:25 want to check that out they can see the link in the show notes so that's a really really fun one

37:31 definitely encourage you to check it out all right we talked a lot about AI's chat AI's ChatGPT etc

37:36 et cetera.

37:37 Have you played with GPT for all?

37:40 No, I believe this might even be some Python going strong here.

37:45 Let me double check really quick.

37:46 Yeah.

37:46 13% at least.

37:47 So GPT for all is, kind of a ChatGPT interface, but it's open source.

37:54 It's free.

37:54 It runs on the three main platforms.

37:56 Windows OS, since OS X or OS X, no it's macOS, but whatever.

38:01 And Ubuntu.

38:02 so you can get a get for those, three platforms.

38:06 And basically it gives you a list of maybe eight or nine different models that you can

38:12 download and run locally without sharing your data with anyone else, just run them locally.

38:18 And you could also try out the different, like the llama models versus the OpenAI type

38:22 models and others.

38:24 So if you want like a local and free and pretty good, actually, I tried it out and it gave

38:29 me some really good answers for a couple of questions.

38:32 I use the wizard model, which it gives you the, like it says, hey, give me some bullet points about this

38:37 or give me some ideas on this.

38:38 And it will like give you the thing.

38:39 Then it gives you, like says hash.

38:41 Here's why I suggested that.

38:42 It highlights this and it features this aspect.

38:45 This other thing does it in this way.

38:47 And here's why I chose that one.

38:48 And it's pretty interesting.

38:51 And open source and free.

38:52 So, you know, easy to try.

38:54 Let's see.

38:55 That's the same one.

38:56 Finally, Brian, my last extra is in.

38:59 I already handed this at the beginning.

39:01 but in the show notes I have an invite if you want to be on Fosstodon again there's like a thousand

39:06 instances on Mastodon go crazy pick the one that's for you but if Fosstodon like the at PSF folks

39:12 they're on Fosstodon you require it's requiring an invite now so I have an invite that is good until

39:17 November 7th and you can go and click it and accept this if you long as you like the policies

39:24 don't make us look bad be nice that's what it's about that's why it's invite only yeah and when

39:30 Can you take advantage of that?

39:31 Be sure to subscribe or follow all of us.

39:34 Yeah, absolutely.

39:35 Follow us.

39:36 Cool.

39:36 Nice.

39:38 Are you done with your extras?

39:40 I'm done with my extras.

39:40 You got anything?

39:41 Okay.

39:42 We're talking about PyCon, and I want to plug local conferences.

39:45 So when people are thinking about the footprint of traveling across the country or traveling to a different country,

39:52 I like the idea of more local conferences.

39:55 And I like that, like, Pie Cascades is great, and it travels between Vancouver and Seattle and in Portland.

40:04 It's going to be in Seattle next.

40:06 This article I'm highlighting is talking about Copenhagen, Django Day Copenhagen, which has already passed,

40:12 so don't try to go there.

40:14 But it's just basically talking about how maybe it's better, maybe it would be better to,

40:19 instead of shipping the people around to see speakers, maybe we could just ship the speakers around to the people.

40:25 and doing that.

40:27 I actually think it'd be great to have more local conferences that have more sponsorships

40:31 that actually help out with the travel for speakers.

40:34 That'd be great.

40:35 So that's one of my extras.

40:36 Yay, local conferences.

40:38 I wanted to highlight what I was doing at 11 o'clock on Tuesday.

40:41 I was getting ready for Halloween.

40:43 Oh, that's spooky.

40:44 On Fosstodon, I've got some pictures of our decorations.

40:49 So we're getting ready for that.

40:50 Speaking of Fosstodon, something I saw today was this awesome crossword puzzle

40:58 with hints in regular expression.

41:01 No way.

41:03 This is great.

41:05 We'll got a link to this person refreshing apathy.

41:10 Got it from a MIT mystery hunt puzzle index, which includes both the puzzle, a puzzle link,

41:18 but also the answer sheet is there.

41:20 So this is just insane as far as the crossword puzzle goes.

41:25 And it's not words.

41:26 So in several years when you solve it, you can check and see if you got it right.

41:29 Yeah, but it's not words.

41:30 It's just random.

41:31 I'd like to see it have actual words be fun to do that.

41:35 So those are my extras.

41:37 Excellent.

41:38 That crossword puzzle is nuts.

41:40 It reminds me of 25-way rock, paper, scissor.

41:45 Yeah.

41:45 Have you seen that?

41:46 It's amazing.

41:47 Yeah, it's pretty good.

41:48 Yeah.

41:49 All right.

41:49 You ready for a joke?

41:50 I am.

41:51 So this one, says when you search YouTube for days to fix a specific bug.

41:57 Okay.

41:58 You know, my, my slogan is you're never hardcore enough for YouTube.

42:02 Like if you search, if you watch three videos on something like 50% of what it's

42:06 going to show you the rest of the time is just that.

42:08 And like, I was just trying to assemble my furniture.

42:11 I'm not the world's biggest fan of like furniture construction.

42:15 Like all YouTube things you are now.

42:16 So it's kind of that version.

42:18 Like when you search YouTube for days to fix a specific bug, once it starts the video,

42:23 it suggests not everyone should code recommended for you.

42:29 That's good.

42:33 So bad.

42:35 You don't want me to code?

42:36 In eight minutes of 47 seconds, you should abandon all hope.

42:40 Says the video.

42:40 How long it is.

42:41 I kind of want to watch that video now though.

42:44 Just trying to find out.

42:44 I do too.

42:46 It's not everyone should code by polymatter, apparently is what it says in the screenshot.

42:50 Yeah.

42:50 And they've got a black checkmark.

42:52 Yeah.

42:52 Awesome.

42:53 Well, thanks again for a wonderful episode.

42:56 And thanks Scout APM for sponsoring.

42:59 And thanks everybody for showing up and watching the show.

43:02 Yeah, you bet.

43:02 Bye everyone.

43:03 Bye.


Want to go deeper? Check our projects




Subscribe to Python Bytes