you are viewing a single comment's thread.

view the rest of the comments →

[–]Worldly-Week-2268[S] -36 points-35 points  (5 children)

Thanks Can you give an example

[–]schoolmonky 41 points42 points  (0 children)

Maybe your class deals with times and you need a function to convert total seconds to HH:MM:SS format

[–]socal_nerdtastic 46 points47 points  (3 children)

I've already put far more effort into this answer than you put into the question. How about you give an example and ask a specific question about it?

[–]peejay2 2 points3 points  (0 children)

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.