
class Animation(object):
    def __init__(self, frame_period_sec):
        if frame_period_sec < 0: raise ValueError
        self._frame_period_sec = frame_period_sec

    @property
    def frame_period_sec(self):
        return self._frame_period_sec

    def begin(self):
        pass

    def next_frame(self):
        pass

    def end(self):
        pass


class Animation(object):
    def __init__(self, frame_period_sec):
        if frame_period_sec < 0: raise ValueError
        self._frame_period_sec = frame_period_sec

    @property
    def frame_period_sec(self):
        return self._frame_period_sec

    @property
    def finished(self):
        raise NotImplementedError('Animation must implement finished property')

    def begin(self):
        pass

    def next_frame(self):
        raise NotImplementedError('Animation must implement next_frame method')

    def end(self):
        pass

Add abstract method exceptions to make Animation inheritance easier
Add abstract method exceptions to make Animation inheritance easier

  
  class Animation(object):
      def __init__(self, frame_period_sec):
          if frame_period_sec < 0: raise ValueError
          self._frame_period_sec = frame_period_sec
  
      @property
      def frame_period_sec(self):
          return self._frame_period_sec
  
+     @property
+     def finished(self):
+         raise NotImplementedError('Animation must implement finished property')
+ 
      def begin(self):
          pass
  
      def next_frame(self):
-         pass
+         raise NotImplementedError('Animation must implement next_frame method')
  
      def end(self):
          pass
  
Add abstract method exceptions to make Animation inheritance easier
## Code Before:

class Animation(object):
    def __init__(self, frame_period_sec):
        if frame_period_sec < 0: raise ValueError
        self._frame_period_sec = frame_period_sec

    @property
    def frame_period_sec(self):
        return self._frame_period_sec

    def begin(self):
        pass

    def next_frame(self):
        pass

    def end(self):
        pass

## Instruction:
Add abstract method exceptions to make Animation inheritance easier
## Code After:

class Animation(object):
    def __init__(self, frame_period_sec):
        if frame_period_sec < 0: raise ValueError
        self._frame_period_sec = frame_period_sec

    @property
    def frame_period_sec(self):
        return self._frame_period_sec

    @property
    def finished(self):
        raise NotImplementedError('Animation must implement finished property')

    def begin(self):
        pass

    def next_frame(self):
        raise NotImplementedError('Animation must implement next_frame method')

    def end(self):
        pass
