Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it make sense to make a class in python when it would never get instantiated?

I have some methods in a file and all of them are defined in the global scope (a module). I did not bother to make a class because the class would never get instantiated and everything would still have to be accessed statically if I defined a class. Does it make sense to leave it as it is, or is it better design to make a class and make all my methods static? and why?
FYI: My script methods will get accessed by third party users.

like image 948
theRealWorld Avatar asked Jan 19 '23 23:01

theRealWorld


1 Answers

Python is not Java, use module-level methods without worry.

like image 163
Evpok Avatar answered Jan 21 '23 12:01

Evpok