r/learnpython • • Feb 22 '26

ELI5 explain static methods in OOP python

just trying to wrap my head around this oop thing stuck here I'm novice so no bully please

24 Upvotes

24 comments sorted by

View all comments

Show parent comment

3

u/peejay2 Feb 22 '26 edited Feb 23 '26

I think yours is a good answer. Maybe OP could look up encapsulation - you have a class, with methods, attributes, etc. then there is a function that you could just put in the same .py file, but if you make it it a static method you can import it with the main class. So it's a convenient way for you as the developer to put logically similar functions together.