"""Representation of a period of time."""


class Period(object):

    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __repr__(self):
        return "%s-%s" % (self.start, self.end)

"""Representation of a period of time."""


class Period(object):

    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __repr__(self):
        return "%s-%s" % (self.start, self.end)

    def __eq__(self, other):
        return ((other.start == self.start) and
                (other.end == self.end))

Add __eq__ method to Period object
Add __eq__ method to Period object

Ultimately we probably want to reuse Python objects
like timestamps.

  """Representation of a period of time."""
  
  
  class Period(object):
  
      def __init__(self, start, end):
          self.start = start
          self.end = end
  
      def __repr__(self):
          return "%s-%s" % (self.start, self.end)
  
+     def __eq__(self, other):
+         return ((other.start == self.start) and
+                 (other.end == self.end))
+ 
Add __eq__ method to Period object
## Code Before:
"""Representation of a period of time."""


class Period(object):

    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __repr__(self):
        return "%s-%s" % (self.start, self.end)

## Instruction:
Add __eq__ method to Period object
## Code After:
"""Representation of a period of time."""


class Period(object):

    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __repr__(self):
        return "%s-%s" % (self.start, self.end)

    def __eq__(self, other):
        return ((other.start == self.start) and
                (other.end == self.end))
