What are static methods in Python and when to use them?

preview_player
Показать описание
In this video we talk about static methods, basically "functions grouped in classes".

We look at when and how to use them, namespacing + encapsulation they can provide, play with them, and show some practical examples in the wild.

We hope this helps you better understand them so next time you can more easily decide if you go with a plain function or a staticmethod in your class.

Links:

---

And last but not least, we appreciate any feedback to make our YouTube content better 💡
Рекомендации по теме
Комментарии
Автор

Love how you post on the weekends! This is beginning to turn into an extensive learning reference library! Thank-you for that !

sherryab
Автор

Nice @pybob. I was always curious about when to use static methods, and this was a nice video to demonstrate its use. I like that you showed the additional note on calling a static method from "self", as most examples I've seen were calling it from the class name.

VeronicaMedrano-ezcn
welcome to shbcf.ru