tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code09:48

Which Python @dataclass is best? Feat. Pydantic, NamedTuple, attrs...

mCoding ↗

From the creator

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 --------------------------------------------------

Published 2021-10-16 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code