Managing Attribute Access and Descriptors (Theory of Python) (Python Tutorial)

preview_player
Показать описание
If you want to control how attributes are accessed or assigned to, you can use the special methods __getattr__, __setattr__ and __delattr__. You can also use descriptors which use the special methods __get__, __set__ and __del__. There are three built-in descriptors that cover pretty much every special case: @property, @staticmethod and @classmethod.

Thank you!
Рекомендации по теме
Комментарии
Автор

A bit late to the party and sad to see that you are no longer uploading, but this a big thank you for every video that you've done.
Your videos are ridiculously good and left a mark on me as an engineer and a person.

anonniii
Автор

I like your tutorial, please keep doing great. I love the fact you're covering the part most tutors will skim this is what is needed to create real world software.

tochimclaren
Автор

Thank you very much for this video series. I Just started coding and this is the most helpful tutorial I have seen on youtube. You are great at explaining these concepts in a way that keeps me interested.

chuckytrue
Автор

let's collect money for his computer. If he makes such good videos on paper, what will he do on PC

Екатерина-брм
Автор

Good video.. 6min in: "[I'm not going to show you what you came here for]".

I appreciate the practical guidance -- I can't see ever modifying __getattribute__ in practice, except perhaps for the example below; but I am still learning. I want to modify it for the purposes of understanding it. I'll probably find what I'm looking for, but I welcome any good resources that do what this guy doesn't (for good reason). I found something about subclassing an immutable object (str) on stackexchange that modifies it.

joem
Автор

Are you gonna make new videos again? I'm from Indonesia and you actually manage to turn my life.

TheMap
Автор

Expression __setattr__(self, name, value): self.vector[0] = value will cause an infinite loop because it will refer to __setattr__ again and again. Won't it?

bunchathumbs
Автор

2024 still watching, not sure what happened to you but Thank you 💯👍

wargreymon
welcome to shbcf.ru