Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 54)
54.
What is the purpose of the __annotations__ attribute in Python classes?
To define class attributes
To create a new instance of the class
To store type annotations for class attributes and methods
To access superclass attributes directly
Answer: Option
Explanation:
The __annotations__ attribute is used to store type annotations for class attributes and methods, providing information about the expected data types.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.