Тёмный

The Art of Subclassing 

Next Day Video
Подписаться 68 тыс.
Просмотров 39 тыс.
50% 1

Raymond Hettinger
All problems have simple, easy-to-understand, logical wrong answers. Subclassing in Python is no exception. Avoid the common pitfalls and learn everything you need to know about making effective use of inheritance in Python.

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

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 19   
@SpomenkoJabucar
@SpomenkoJabucar 7 лет назад
Raymond Hettinger - the man who decided to have a child to make his subclassing examples easier for us to understand.
@karthickb1973
@karthickb1973 9 месяцев назад
😀
@arunprasath9586
@arunprasath9586 10 лет назад
Raymond Hettinger is a legend! You learn 10 times more watching him talk than reading a book!!
@asmeurer
@asmeurer 12 лет назад
Great talk. One thing that should be pointed out is that if you do want to subclass a built-in type like dict and avoid gotchas like __getitem__() not affecting get(), you can use abstract base classes from the standard library abc module, which take care of overriding all the methods for you.
@adamhendry945
@adamhendry945 2 года назад
FYI, when he says the "Framework" pattern, this is actually the "Template" pattern in the original GoF book. The principle explained is correct, just the name is off. It's also referred to as the "Hollywood principle" (i.e. "Don't call us, we'll call you") or Inversion of Control (IoC) principle. Great talk!
@salkdjfasldkfjsdlk
@salkdjfasldkfjsdlk 9 лет назад
Great video as always. You definitely changed my UML relationships from "inherits from" to "delegates to". Cheers
@joelcastellon9129
@joelcastellon9129 8 лет назад
I don't understand why python is presented as "easy" or "novice" language. If you come from the "status quo" of programming (Java, C++) you really have appreciate beautiful design of Python. I actually believe, doing serious coding in Python requires MUCH more care and thought than Java (from my experience).
@liesdamnlies3372
@liesdamnlies3372 7 лет назад
I completely agree. A long time ago I fiddled with Python for fun but I didn't really get much of anywhere. Now I'm returning to it, after having taken formal (i.e. in an actual college) Java and C++ courses, and holy fuck, it's beautiful. The decisions they made become a lot clearer once you have a better grasp of the "under the hood" logic that goes on in a computer. Python may be the epitome of "easy to learn, difficult to master".
@jorgegimeno3869
@jorgegimeno3869 8 лет назад
I really don't know why I didn't watch this earlier. A lot of the talks on classes in Python now make sense to me.
@otter-pro
@otter-pro 11 лет назад
Excellent talk. I learned a lot and I raised my hands at interval
@yoyoyoyoyoyo907
@yoyoyoyoyoyo907 10 лет назад
Great presentation. Very useful for someone coming from Java/C++ background. OOP in Python is quite different from what is being taught in today's CS curricula, this clears few things up.
@pedlezelnip
@pedlezelnip 12 лет назад
"The class with the most reusable code should be the top-most parent" I disagree. Part of the benefit of having a heirarchy match a taxonomy is knowledge transfer. By arguing that code reuse is the only metric that matters he misses one of the key benefits of OO thinking. He would argue that you need to "unlearn" that, but there's a cost associated with that he doesn't account for (my knowledge of the natural world I'm trying to model no longer applies to my code). This hurts readability ALOT.
@matthewzeller5026
@matthewzeller5026 6 лет назад
This is awesome! Thank you.
@sotirisf
@sotirisf 8 лет назад
what does the man from the audience shout at 31:59 ??
@davidedwards5069
@davidedwards5069 8 лет назад
+sotirisf "Amen!"
@sotirisf
@sotirisf 8 лет назад
+Dave Edwards hahahaha thanks!!!
@SalsaTiger83
@SalsaTiger83 12 лет назад
Your sentence structure hurts readability a lot. Taxonomic thinking is a convention in other languages. In Python, reusability trumps object orientation or taxonomy.
@AlexanderArtemenko
@AlexanderArtemenko 12 лет назад
Boring. I've had much more fun from "Stop Writing Classes".
@MMABeijing
@MMABeijing 5 лет назад
I know it's been a long time but that was a good one, thank you for that daily dose of sarcastic humor
Далее
Stop Writing Classes
27:29
Просмотров 934 тыс.
Python's Class Development Toolkit
45:56
Просмотров 238 тыс.
Loop like a native: while, for, iterators, generators
29:15
When Booleans Are Not Enough... State Machines?
21:50
Alex Gaynor: Fast Python, Slow Python - PyCon 2014
36:11
The Clean Architecture in Python
49:54
Просмотров 109 тыс.
Transforming Code into Beautiful, Idiomatic Python
48:51