

class DiyLangError(Exception):
    """General DIY Lang error class."""
    pass


class Closure:

    def __init__(self, env, params, body):
        raise NotImplementedError("DIY")

    def __repr__(self):
        return "<closure/%d>" % len(self.params)


class Environment:

    def __init__(self, variables=None):
        self.bindings = variables if variables else {}

    def lookup(self, symbol):
        raise NotImplementedError("DIY")

    def extend(self, variables):
        raise NotImplementedError("DIY")

    def set(self, symbol, value):
        raise NotImplementedError("DIY")


class String:
    """
    Simple data object for representing DIY Lang strings.

    Ignore this until you start working on part 8.
    """

    def __init__(self, val=""):
        self.val = val

    def __str__(self):
        return '"{}"'.format(self.val)

    def __eq__(self, other):
        return isinstance(other, String) and other.val == self.val



class DiyLangError(Exception):
    """General DIY Lang error class."""
    pass


class Closure(object):

    def __init__(self, env, params, body):
        raise NotImplementedError("DIY")

    def __repr__(self):
        return "<closure/%d>" % len(self.params)


class Environment(object):

    def __init__(self, variables=None):
        self.bindings = variables if variables else {}

    def lookup(self, symbol):
        raise NotImplementedError("DIY")

    def extend(self, variables):
        raise NotImplementedError("DIY")

    def set(self, symbol, value):
        raise NotImplementedError("DIY")


class String(object):

    """
    Simple data object for representing DIY Lang strings.

    Ignore this until you start working on part 8.
    """

    def __init__(self, val=""):
        self.val = val

    def __str__(self):
        return '"{}"'.format(self.val)

    def __eq__(self, other):
        return isinstance(other, String) and other.val == self.val

Fix Old-style class, subclass object explicitly.
Fix Old-style class, subclass object explicitly.

  
  
  class DiyLangError(Exception):
      """General DIY Lang error class."""
      pass
  
  
- class Closure:
+ class Closure(object):
  
      def __init__(self, env, params, body):
          raise NotImplementedError("DIY")
  
      def __repr__(self):
          return "<closure/%d>" % len(self.params)
  
  
- class Environment:
+ class Environment(object):
  
      def __init__(self, variables=None):
          self.bindings = variables if variables else {}
  
      def lookup(self, symbol):
          raise NotImplementedError("DIY")
  
      def extend(self, variables):
          raise NotImplementedError("DIY")
  
      def set(self, symbol, value):
          raise NotImplementedError("DIY")
  
  
- class String:
+ class String(object):
+ 
      """
      Simple data object for representing DIY Lang strings.
  
      Ignore this until you start working on part 8.
      """
  
      def __init__(self, val=""):
          self.val = val
  
      def __str__(self):
          return '"{}"'.format(self.val)
  
      def __eq__(self, other):
          return isinstance(other, String) and other.val == self.val
  
Fix Old-style class, subclass object explicitly.
## Code Before:


class DiyLangError(Exception):
    """General DIY Lang error class."""
    pass


class Closure:

    def __init__(self, env, params, body):
        raise NotImplementedError("DIY")

    def __repr__(self):
        return "<closure/%d>" % len(self.params)


class Environment:

    def __init__(self, variables=None):
        self.bindings = variables if variables else {}

    def lookup(self, symbol):
        raise NotImplementedError("DIY")

    def extend(self, variables):
        raise NotImplementedError("DIY")

    def set(self, symbol, value):
        raise NotImplementedError("DIY")


class String:
    """
    Simple data object for representing DIY Lang strings.

    Ignore this until you start working on part 8.
    """

    def __init__(self, val=""):
        self.val = val

    def __str__(self):
        return '"{}"'.format(self.val)

    def __eq__(self, other):
        return isinstance(other, String) and other.val == self.val

## Instruction:
Fix Old-style class, subclass object explicitly.
## Code After:


class DiyLangError(Exception):
    """General DIY Lang error class."""
    pass


class Closure(object):

    def __init__(self, env, params, body):
        raise NotImplementedError("DIY")

    def __repr__(self):
        return "<closure/%d>" % len(self.params)


class Environment(object):

    def __init__(self, variables=None):
        self.bindings = variables if variables else {}

    def lookup(self, symbol):
        raise NotImplementedError("DIY")

    def extend(self, variables):
        raise NotImplementedError("DIY")

    def set(self, symbol, value):
        raise NotImplementedError("DIY")


class String(object):

    """
    Simple data object for representing DIY Lang strings.

    Ignore this until you start working on part 8.
    """

    def __init__(self, val=""):
        self.val = val

    def __str__(self):
        return '"{}"'.format(self.val)

    def __eq__(self, other):
        return isinstance(other, String) and other.val == self.val
