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

Опубликовано: 05 Октябрь 2024
на канале: Pybites
638
24

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:
Definition:   / 1598243053336133632  
Use cases:   / 1390926278476304384  
Were they a mistake? https://mail.python.org/pipermail/pyt...
Classmethods video last week:    • Python Class Methods: Practical Use C...  
Pybites OOP learning path: https://codechalleng.es/bites/paths/oop

---
Learn more about Pybites / what we do: https://pybit.es

Get our weekly developer / mindset emails: https://pybit.es/friends/

Join our Slack community: https://pybit.es/community/

And last but not least, we appreciate any feedback to make our YouTube content better 💡
https://form.jotform.com/230941798741062 🙏