Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 29)
29.
How does Python handle name mangling for attributes in a class?
All attributes are automatically private
Attributes with a single leading underscore are considered private
Attributes with a double leading underscore undergo name mangling
Name mangling is not supported in Python
Answer: Option
Explanation:
Attributes with a double leading underscore in Python undergo name mangling, which involves adding a prefix based on the class name to avoid naming conflicts.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.