Python Programming - Polymorphism - Discussion

Discussion Forum : Polymorphism - General Questions (Q.No. 69)
69.
In Python, what is the purpose of the __call__() method in the context of polymorphism?
To customize the behavior when an instance is checked for membership using the in keyword
To customize the behavior when the instance is called as a function
To define class attributes
To create a new instance of the class
Answer: Option
Explanation:
The __call__() method is used to customize the behavior when an instance is called as a function, allowing for polymorphic behavior.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.