KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I was reading 'Dive Into Python' and in the chapter on classes it gives this example: class FileInfo(UserDict): "store file metadata" def __init__(self, filename=None): UserDict.__init__(self) self["name"] = filename The author then says that if you want to override the __init__ method, you must explicitly call the parent __init__ with the correct parameters. What if that FileInfo class had more than one ancestor class? Do I have to explicitly call all of the ancestor classes' __init__ methods? Also, do I have to do this to any other method I want to override?
Tags (comma-separated)
Save Edits
Cancel