Тёмный

Python Descriptors 

InfoQ
Подписаться 231 тыс.
Просмотров 29 тыс.
50% 1

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@MichaelHeyns
@MichaelHeyns 4 года назад
Great talk! Thanks for sharing. Worth noting is PEP 487 that introduced a hook that calls ___set_name___ on all descriptors upon class creation, meaning descriptors now can have knowledge of the field names they are associated with.
@chesterVonWinchester
@chesterVonWinchester 3 года назад
Cool, thanks. Also, usage examples here: docs.python.org/3/howto/descriptor.html#customized-names
@salkdjfasldkfjsdlk
@salkdjfasldkfjsdlk 10 лет назад
This talk makes me not want to write my own descriptors. Needs work to simplify it for daily users. GL
@gena8414
@gena8414 8 месяцев назад
I really like the way you model your explanations: and clearly define what level of abstractions you are dealing with. Quite clear, no space for ambiguities. I would lve to see a full OO course in Python from you.
@alexd7466
@alexd7466 Год назад
Talking about Descriptors is a great way to make Java developers realize they don't really understand Python, @property and @classmethod.
@MasterSergius
@MasterSergius 7 лет назад
Probably, the best explanation I've ever seen!
@iamsantosh
@iamsantosh 9 лет назад
The Guy is genious man #simonFranklin and teaching style awesome
@novicesim3642
@novicesim3642 5 лет назад
Gosh.. my level of understanding on python doesnt reach the level where i could understand this video
@OttoFazzl
@OttoFazzl 4 года назад
I can relate. A year ago I wouldn't understand it, too. Just keep working on it, and everything will make sense. Read more books like "Powerful Python" or "Python Cookbook", and you will understand it.
@Guinhulol
@Guinhulol 3 года назад
Give yourself a tap in the back, not everybody made it this fair, I mean most Python dev they stick to the basic stuff
@ko95
@ko95 4 года назад
some notes from the lectures in @23:49 Descriptors: A generic mechanism to create getters and setter that you can resuse. A descriptor encapulates attribute getting/setting logic in a reusable way. (what is a reusable way?) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-81S01c9zytE.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-81S01c9zytE.html - In order for a descriptor to do its magic, it needs to be a class attribute, not an instance attribute. AFAIK Properties implements the descriptor protocol, properties provides an interface to instance attributes (properties intercept access to attributes). The descriptor protocol is tied to scoping and has a execution precedence ("7 simple rules") Cant really connect more dots than this right now... What is a descriptor ? How do i use it? When do i use it? Why do i use it?
@VannaVolga
@VannaVolga 4 года назад
For people watching this now: PEP 487 (Python 3.6) introduced a __set_name__ hook on the descriptor which is called upon class creation. This makes it possible to store values in the instance `__dict__` with this name. See www.python.org/dev/peps/pep-0487/.
@mobilkonto__free__9726
@mobilkonto__free__9726 4 года назад
Great professor
@mobilkonto__free__9726
@mobilkonto__free__9726 4 года назад
Amazing man
@jonathanhexner
@jonathanhexner 9 лет назад
Excellent explanation of descriptors!
@muh_guts
@muh_guts 3 года назад
man, basically you saved me
@ald7248
@ald7248 7 лет назад
I do not understand the praise for this talk. Raymond Hettinger's excellent "Descriptor HOWTO" is clearer in all respects and more comprehensive to boot.
@michaeljohnson4833
@michaeljohnson4833 5 лет назад
Shill
@shawnc7800
@shawnc7800 6 лет назад
Awesome video!Thanks very very much!
@diodin8587
@diodin8587 4 года назад
Didn't mention `__getattr__` and `__getattribute__`?
@arkster00
@arkster00 10 лет назад
Awesome talk.
@kevinl7139
@kevinl7139 6 лет назад
this shit is way over my head
@robinarora3999
@robinarora3999 Год назад
And someone said python is easy!!
Далее
Metaclasses in Python
19:20
Просмотров 28 тыс.
The Art of Subclassing
39:48
Просмотров 39 тыс.
7 Python Code Smells to AVOID at All Costs
22:10
Просмотров 372 тыс.
Understanding Python: Descriptors
23:42
Просмотров 6 тыс.
Describing Descriptors
24:23
Просмотров 4,1 тыс.
Transforming Code into Beautiful, Idiomatic Python
48:51
python descriptors! (advanced) anthony explains #519
19:04
Thinking Like an Architect
49:34
Просмотров 2,4 тыс.