The Magic that Makes Python Tick

preview_player
Показать описание
—————————————————————————————————————————
In this video, we implement Python's range object in pure Python. We use this as a case study to explore Python's data model and learn how to create rich objects that interact naturally with Python's built-in operators and functions.

#python #objectorientedprogramming

Chapters
---------------
0:00 Introduction
1:02 What does range() do?
2:17 How will we test our implementation?
3:02 Start with a basic dataclass
3:27 Initialization
5:16 Iter
5:54 Contains
7:37 Len
9:35 Count & Index
10:26 Hash & Repr
10:59 Get Item
13:29 Reversed
13:56 Sequence
14:33 Final Thoughts
Рекомендации по теме
Комментарии
Автор

Thank you for this video. Your video format is highly professional, and you truly deserve more subs. Please continue making these videos.

andrewwang
Автор

Fantastic video! This really shows me that I have no idea how to write good python.

anselmschueler
Автор

This is legitimately one of the best Python videos on YouTube. You managed to basically cram the first 5 chapters of Fluent Python into 15 minutes.

Everyone else is focused on showing recipies and minimal working examples, but you just showed an incredibly well explained implementation of something everyone knows about.

It's hard to understand *how* 'magic'/dunder methods actually help with implementation when just being shown small recipes, but a series of videos explaining exactly how to re-implement Python builtins with pure Python is a great idea.

Even in enterprise code (looking at you Esri) there's a massive lack of understanding of how to write Python code to work within the framework of the language.

I know 'pythonic' code is a bit of a meme now, but helping people understand that building classes that follow the Python datamodel interfaces is important is a good thing.

The whole reason to write interfaces that follow the builtin models is to get free upgrades to your code as optimizations implemented in the base language. It also allows for other libraries that dont know anything about your code to immediately understand what and object is and you once again get free optimization as that library is developed.

Anyways, rant over. Just wanted to thank you for explaining this moderately complex topic so efficiently.

Allenrythe
Автор

Underrated cool channel 😎 👌 please don't stop like this vedios

project
Автор

Wow, this video is fantastic! I especially loved the list animation. By any chance, did you use Manim for that part? I'm a Manim animation enthusiast myself, and I'm very interested to see how you achieved that effect. No worries at all if you'd prefer to keep it private, but I truly appreciate your work! Keep up the amazing content!

mustafa.marzouk
Автор

"Your users will thank you" — that is, if I had any users! I jest though, this video was great. I love the thoroughness and the idiomaticity you showed us; I didn't know there were all these types and interfaces that we could use. I realize there's still plenty for me to learn about this language.

spaghettiking
Автор

Could you go into how you wrote the tests more?

markconnolly
Автор

thank you for the video. Can you do the same with lists?

sebastiannarvaez
Автор

You sound like the guy from reaper video

Daveooooooooooo
Автор

This is not really teaching anything it's just infotainment

DiegoDiego