Which Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs...
Get rid of boilerplate in writing classes.
Which dataclass alternative should you use though? In this video we test dataclasses, attrs, tuple, namedtuple, NamedTuple, dict, SimpleNamespace, and Pydantic BaseModel for speed, memory efficiency, and features.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
Previous dataclasses video: https://youtu.be/vBH6GRJ1REM
dataclasses: https://docs.python.org/3/library/dataclasses.html
attrs: https://www.attrs.org/en/stable/examples.html
namedtuple: https://docs.python.org/3/library/collections.html#collections.namedtuple
NamedTuple: https://docs.python.org/3/library/typing.html#typing.NamedTuple
SimpleNamespace: https://docs.python.org/3/library/types.html#types.SimpleNamespace
Pydantic: https://pydantic-docs.helpmanual.io/usage/models/
SUPPORT ME ⭐
---------------------------------------------------
Patreon: https://patreon.com/mCoding
Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Other donations: https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G, Pieter G, Krisztian M, Sigmanificient
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:04 dataclass
1:24 attrs
2:13 tuple, namedtuple, NamedTuple
4:05 dict
4:39 SimpleNamespace
4:58 Pydantic
6:39 Speed comparison
8:41 Memory comparison
9:15 Feature matrix and winners
Видео Which Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs... канала mCoding
Which dataclass alternative should you use though? In this video we test dataclasses, attrs, tuple, namedtuple, NamedTuple, dict, SimpleNamespace, and Pydantic BaseModel for speed, memory efficiency, and features.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
Previous dataclasses video: https://youtu.be/vBH6GRJ1REM
dataclasses: https://docs.python.org/3/library/dataclasses.html
attrs: https://www.attrs.org/en/stable/examples.html
namedtuple: https://docs.python.org/3/library/collections.html#collections.namedtuple
NamedTuple: https://docs.python.org/3/library/typing.html#typing.NamedTuple
SimpleNamespace: https://docs.python.org/3/library/types.html#types.SimpleNamespace
Pydantic: https://pydantic-docs.helpmanual.io/usage/models/
SUPPORT ME ⭐
---------------------------------------------------
Patreon: https://patreon.com/mCoding
Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE
Other donations: https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G, Pieter G, Krisztian M, Sigmanificient
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
1:04 dataclass
1:24 attrs
2:13 tuple, namedtuple, NamedTuple
4:05 dict
4:39 SimpleNamespace
4:58 Pydantic
6:39 Speed comparison
8:41 Memory comparison
9:15 Feature matrix and winners
Видео Which Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs... канала mCoding
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Brownian Motion Single Path Zoom](https://i.ytimg.com/vi/pJlmtdF0Ses/default.jpg)
![Return Value Optimization and Copy Elision in C++](https://i.ytimg.com/vi/HNYOx-Vh_VA/default.jpg)
![Match statement tips](https://i.ytimg.com/vi/-gf4z3g71Mg/default.jpg)
![The ins and outs of context managers and try-finally in Python](https://i.ytimg.com/vi/LBJlGwJ899Y/default.jpg)
![Python Iterators! COPY or NO COPY?](https://i.ytimg.com/vi/hVFKy9Gw95c/default.jpg)
![str vs bytes in Python](https://i.ytimg.com/vi/EimoZHDcQMA/default.jpg)
![Asynchronous Web Apps in Python](https://i.ytimg.com/vi/oYrnTQAFH1Q/default.jpg)
![Async application classes vs. functions](https://i.ytimg.com/vi/ai7y--6ElAE/default.jpg)
![Using except: is a HUGE mistake](https://i.ytimg.com/vi/zrVfY9SuO64/default.jpg)
![Introducing mZips! Python Zip and Zip Longest](https://i.ytimg.com/vi/HtvOsPY17qc/default.jpg)
![Automated Testing in Python with pytest, tox, and GitHub Actions](https://i.ytimg.com/vi/DhUpxWjOhME/default.jpg)
![Positional-only and keyword-only arguments in Python](https://i.ytimg.com/vi/R8-oAqCgHag/default.jpg)
![Python AST Parsing and Custom Linting](https://i.ytimg.com/vi/OjPT15y2EpE/default.jpg)
![Python Generators](https://i.ytimg.com/vi/tmeKsb2Fras/default.jpg)
![Magic Methods - Making Python builtins work with your classes](https://i.ytimg.com/vi/Zl-Vb1OIhCk/default.jpg)
![Unlocking your CPU cores in Python (multiprocessing)](https://i.ytimg.com/vi/X7vBbelRXn0/default.jpg)
![x to bool conversion in Python, C++, and C](https://i.ytimg.com/vi/fpN2ieYxXO0/default.jpg)
![What are Python __future__ imports?](https://i.ytimg.com/vi/7CRybttp0Uc/default.jpg)
![Python + YouTube API | Automating descriptions](https://i.ytimg.com/vi/0F9sdRtbwkE/default.jpg)
![Method Chaining Classes in Python](https://i.ytimg.com/vi/BY34Fe-2xgk/default.jpg)