Back
For example:
requests.get() is a function with a period in it. How would I make my own function ex:
def foo(): return 'bar'
def foo():
return 'bar'
And call said to function like this:
x.foo()
Not like this:
foo()
You can simply use python classes for it:
class x: def foo(): return 'bar'
class x:
Or, simply use a staticmethod:
class x: @staticmethod def foo(): return 'bar'
@staticmethod
31k questions
32.8k answers
501 comments
693 users