Head to https://ultahost.com to host your website or application for less!
—
Metaclasses are considered one of the hardest, if not THE hardest, thing in Python's core functionality. But is it really as bad as people claim? In this video we'll cover the basics of metaclasses, look at a real-world example, and discuss when they should be used.
00:00 - Intro [1]
02:11 - Dynamically creating classes using the type built-in
05:51 - Creating custom metaclasses [2]
11:14 - Metaclasses aren't always the answer [3]
14:26 - Creating classproperties using metaclasses [4-7]
19:47 - Outro
[1] https://www.youtube.com/post/UgkxXZqXR8_K_D7zV0fTVSffiYbsu7ZwVfcz
[2] https://youtu.be/ChRDzldOz8g
[3] https://python-patterns.guide/gang-of-four/singleton
[4] https://youtu.be/l0T4jvuP0H8
[5] https://discuss.python.org/t/add-a-supported-read-only-classproperty-decorator-in-the-stdlib/18090
[6] https://docs.python.org/3/whatsnew/3.11.html#language-builtins
[7] https://github.com/python/cpython/issues/89519
—
If you want to see more of me, join my Discord server!
https://discord.gg/5vVgQpK
I get a lot of people asking, so here's my setup!
• Visual Studio Code: https://youtu.be/PBQspYkkksU
• Terminal: https://youtu.be/4RuGK3w6Mbs
• Desk/recording gear: https://kit.co/Carberra
• PC build: https://uk.pcpartpicker.com/list/TmzGYN
Affiliations (I may earn a commission):
• Codecrafters -- 40% off any plan: https://app.codecrafters.io/join?via=parafoxia
• Keeper Password Manager -- 30% off your first year: https://keeper.io/r/EX4FB1C
—
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto