How to prevent a function from being overridden in python [duplicate]
问题 This question already has an answer here: Making functions non override-able 5 answers Is there a way to make a class function unoverriddable? something like java's final keyword. i.e, any overriding class cannot override that method. 回答1: The issue is you are trying to write in Python using Java philosophies. Some thing carry over, but not all of them. In Python you can do the following and it is perfectly fine, but completely goes against how Java thinks of objects. class Thing(object): x =