In below example, the object of random is not created
from random import randint
print(randint(0, 10))
the definition of the randint function is as follow
import _random
class Random(_random.Random):
def randint(self, a, b):
return self.randrange(a, b+1)
Now in my case:
class XYZ:
def func(self):
do something
to call func, I have to create object of XYZ and then call function XYZ().func()else it throws error...
But I want to do it like
XYZ.func()
simply like how standard library function works. is there any way to achieve this?