What does the __call__ dunder method enable?

Python Developer Medium

Python Developer — Medium

What does the __call__ dunder method enable?

Key points

  • __call__ dunder method allows instances to be called like functions
  • Enhances flexibility and usability of the class
  • Not related to printing the class name or comparison operations

Ready to go further?

Related questions