programming-languageクラスオーバーライド.子での実装を必須にする(abstract,purevirtual)On this pageオーバーライド.子での実装を必須にする(abstract,purevirtual) Python py@abstractmethoddef method01(self): pass Python3 : @abstractmethod を使用 Python2 には文法的には無いので、親の定義で raise NotImplementedException みたいにしておく Swift swiftclass Class01 { func method01() -> String { preconditionFailure("Implement this!") }} 📩 ご意見・ご感想はこちらから