That tidbit about "variables with default values must come after the ones without them", just explained a big problem I was having. Thank you!
@pankuang-q1k8 ай бұрын
your explaination is very helpful for understanding the question 'why we need to do that ', and i like your explaination for reading a json file to an object. Thank you very much for this good video.
@FrocketGaming6 ай бұрын
Thanks for this. As I was watching and working on a selenium web scraping script I realized I could make a config dataclass to store all the css_selectors / xpaths I need for this script!
@mecrayavcin4 ай бұрын
Nice video
@kostasmessinis9 ай бұрын
good
@davidl3383 Жыл бұрын
Thank you. Very clear like your udemy couse ;)
@chromery Жыл бұрын
Great video as always! Have you by any chance made a video about Pydantic (couldn't find it), or are you maybe planning to?
@velicihanates3288 Жыл бұрын
You could have used two asterix operators to insert json in your person class 'bob = Person(**json)'
@Indently Жыл бұрын
Only if your dataclass fits PERFECTLY the data from the JSON, otherwise it will throw an error.
@velicihanates3288 Жыл бұрын
@@Indently thanks for telling, I really enjoy your python tutorials!
@thepackbot Жыл бұрын
that's called unpacking.
@kamurashev Жыл бұрын
Nice! Named tuple vs dataclass for the next video?
@Indently Жыл бұрын
Possibly someday!
@forethiocodingstaff Жыл бұрын
Young, energetic python developer
@enricoroselino7557 Жыл бұрын
bob job nice
@smanzoliАй бұрын
It's important to talk about __post_init__ because real code WILL need it, dataclass cannot do all the __init__ most times.
@MrGeordiejon26 күн бұрын
bob = Person(**json) print(bob) >>> Person(name='Bob', age='30', job='Salesman', friends=['Mario', 'Luigi'])
@jeyosman18 ай бұрын
I just wanted to take a moment to express my sincere appreciation for your exceptional explanations and the engaging speed at which you communicate. Your clarity and enthusiasm truly stand out, making learning from you an absolute pleasure. Thank you for your dedication and talent-I genuinely admire the way you convey information
@MathewGuest29 күн бұрын
How do data classes compare to pydantic third-party library?
@NoidoDev Жыл бұрын
Is it better to use that for data or some dict? For example, It seem that I won't be able to get "keywords". Also, there's a difference between __slots__ and slots=True, which is that you can use default value with the new method.
@aryandatla51882 ай бұрын
can we implement linked lists using dataclass?
@SanwicklithMkalinga-g6h Жыл бұрын
Do u have a course… or mentoring program
@Indently Жыл бұрын
I have a couple of courses at: indently.io
@losco_arti Жыл бұрын
Cool. Thanks!
@superyngo11 күн бұрын
why not using **json as arguments?
@DrDeuteron Жыл бұрын
Don't forget the dataclasses.Field object...can be very useful when dealing with telemetry. There's also the "astuple" method that is attached to the class.
@nargileh14 ай бұрын
bob = Person(json['name'],json['age'],json['job'],json['friends']) why not use this instead? bob = Person(**json)
@lostsoul8634 Жыл бұрын
I'm learning python... bob= Person(**json) is better?
@MathewGuest29 күн бұрын
That is a good way to do it. If the data structures ever go out of sync, they would need updated
@betapacket Жыл бұрын
5th
@Timmie_Tudor Жыл бұрын
Why are you teaching people how to use me?
@Indently Жыл бұрын
Because you're great and deserve to be treated with respect.