If you're not using Python DATA CLASSES yet, you should 🚀
Video Statistics and Information
Channel: ArjanCodes
Views: 114,575
Rating: 4.9665856 out of 5
Keywords: python data classes, python data class, python dataclass, python data class tutorial, dataclasses python 3.6, dataclasses python 3.7, data classes python, data classes, data class, python storing data, data-oriented class, struct c#, tutorial data class, data vs behavior class, python, python tutorial, learn python, python 3.9 tutorial, python 3.8, python 3.7, python 3.9.1, python 3.9, python 3.9.2, data classes python 3.7, data classes vs data
Id: vRVVyl9uaZc
Channel Id: undefined
Length: 10min 55sec (655 seconds)
Published: Fri May 07 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Well, risky move pronouncing Geralt and Yennefer in a recording shared with nerds in public.
Great content as always! Really hitting the sweet spot of where I am as an intermediate.
For small scripts I use
dataclasses
, for everything else there'spydantic
.Clarification: I'm using a sort_index variable in the example. Strictly speaking, that's not needed, because a data class uses the first attribute in the class definition as the default for sorting. I'm not a fan of this kind of hidden behavior, so I prefer to do it explicitly (using something that is called sort_index in this case). Another advantage of using a separate field, is that you can do more complicated ordering, using for example a weighted combination of age and strength.
Hi arjan , I totally liked ur video , precise to the point.just subscribed. If I want to create a model class why not just use named tuple ?
Ah, I love his videos. He teached me a lot.
Can you use this approach to emulate SQL's "ORDER BY column_a ASC, column_b DESC, column_c DESC ...'? For those unfamiliar with SQL, the question is if you can order by a specified field, then in case of equal value compare based on another field (possibly with reversed ordering) and have an arbitrary number of such sorting conditions.
I enjoy your videos, the way you explain the topics take my attention
Python and Witcher. What's not to like?
Like his accent