A Deep Dive into Python's Dataclasses (Part 2)

Publicado em: 23 Maio 2023
no canal de: MathByte Academy
4,091
178

This is Part 2 of a two-part set of videos that takes a deep dive into Python dataclasses.

The goal of these videos is not to learn just the mechanics of defining classes using dataclasses, but rather to understand how dataclasses add functionality to classes, and understand the equivalent code we would have to write using regular classes. Understanding dataclasses at this fundamental level will help you understand why certain things may or may not work in your own dataclasses and how to solve your issues.

So, don't expect a 10-minute run down of how to create dataclasses!!

#mathbyteacademy #dataclass #dataclasses #python

Content
=======
00:00:00 - Introduction
00:01:33 - The _post_init_ Method
00:03:25 - Init-Only Variables
00:11:58 - Field Level Customizations
00:13:30 - Customizing the class representation
00:16:55 - Setting Default Values
00:17:37 - Non-Initialized Fields
00:23:10 - Frozen Classes and Non-Initialized Fields
00:27:25 - Customizing Comparison Fields
00:33:41 - Hashing Partially Mutable Classes
00:40:10 - Unsafe Hashing
00:47:51 - Keyword-Only Arguments
00:50:33 - Creating Dataclasses Programmatically
00:54:58 - Custom Metadata
00:58:16 - Init Factories
01:09:39 - Conclusion


Code for this Video
================
Available in GitHub blog repo: https://github.com/fbaptiste/python-blog
Direct link: https://tinyurl.com/mr2x6rpb

My Python Courses
=================

Python 3 Fundamentals (introduction to Python)
https://www.udemy.com/course/python3-...

Pydantic V2: Essentials
https://www.udemy.com/course/pydantic...

Python 3 Deep Dive (Part 1 - Functional)
https://www.udemy.com/course/python-3...

Python 3 Deep Dive (Part 2 - Iteration, Generators)
https://www.udemy.com/course/python-3...

Python 3 Deep Dive (Part 3 - Hash Maps)
https://www.udemy.com/course/python-3...

Python 3 Deep Dive (Part 4 - OOP)
https://www.udemy.com/course/python-3...

Fundamentals and Deep Dive Jupyter Notebooks
========================================
All fully-annotated Jupyter notebooks from my Udemy courses are freely available on GitHub:

https://github.com/fbaptiste/python-f...
https://github.com/fbaptiste/python-d...


Nesta página do site você pode assistir ao vídeo on-line A Deep Dive into Python's Dataclasses (Part 2) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário MathByte Academy 23 Maio 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 4,091 vezes e gostou 178 espectadores. Boa visualização!