You can also leave the undefined method in the base class to achieve the same effect.
import os
class File(object):
def __init__(self, filename):
if os.path.isfile(filename):
self.filename = filename
self.file = open(filename, 'rb')
self._read()
else:
raise Exception('...')
class FileA(File):
def _read(self):
pass
file = FileA('myfile.a')
To understand Python classes, it is invaluable to have such an understanding of class inheritance.