The Real Python Podcast cover image

Exploring Functional Programming in Python With Bruce Eckel

The Real Python Podcast

00:00

Using the Frozen Data Class, You Can't Make Anything but a Star Between Value One Through Ten

Frozen adds the postinit because the data class does all the initialization for you. And so now you have a true type, which says, ok, it's a set of values, and values are one through ten. And that's the key, is that it has to be. I mean that because you're using this frozen data class, there's no way to make a star object that isn't between one and ten. But with the data class, you go, ok, you can never make anything but a star between value one through 10. That's kind of cool.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app