9. Dunder call Method
The __call__ method makes an instance of a class callable like a function.
Example
class Greeter:
def __init__(self, name):
self.name = name
def __call__(self):
return f"Hello, {self.name}"
g = Greeter("Alice")
print(g())
Wrap-Up
Implement __call__ when you want objects to behave like functions.