class Config(object):
    """
    Base configuration class.  Contains one method that defines the database URI.

    This class is to be subclassed and its attributes defined therein.
    """

    def __init__(self):
        self.database_uri()

    def database_uri(self):
        if self.DIALECT == 'sqlite':
            self.DATABASE_URI = r'sqlite://{name}'.format(name=self.DBNAME)
        else:
            self.DATABASE_URI = r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
                dialect=self.DIALECT, user=self.DBUSER, passwd=self.DBPASSWD,
                host=self.HOSTNAME, port=self.PORT, name=self.DBNAME
            )

class Config(object):
    """
    Base configuration class.  Contains one property that defines the database URI.

    This class is to be subclassed and its attributes defined therein.
    """

    @property
    def database_uri(self):
        return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqlite' else \
            r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
                dialect=self.DIALECT, user=self.DBUSER, passwd=self.DBPASSWD,
                host=self.HOSTNAME, port=self.PORT, name=self.DBNAME
            )

Replace database_uri method with a property
Replace database_uri method with a property

  class Config(object):
      """
-     Base configuration class.  Contains one method that defines the database URI.
+     Base configuration class.  Contains one property that defines the database URI.
  
      This class is to be subclassed and its attributes defined therein.
      """
  
+     @property
-     def __init__(self):
-         self.database_uri()
- 
      def database_uri(self):
+         return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqlite' else \
-         if self.DIALECT == 'sqlite':
-             self.DATABASE_URI = r'sqlite://{name}'.format(name=self.DBNAME)
-         else:
-             self.DATABASE_URI = r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
+             r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
                  dialect=self.DIALECT, user=self.DBUSER, passwd=self.DBPASSWD,
                  host=self.HOSTNAME, port=self.PORT, name=self.DBNAME
              )
  
Replace database_uri method with a property
## Code Before:
class Config(object):
    """
    Base configuration class.  Contains one method that defines the database URI.

    This class is to be subclassed and its attributes defined therein.
    """

    def __init__(self):
        self.database_uri()

    def database_uri(self):
        if self.DIALECT == 'sqlite':
            self.DATABASE_URI = r'sqlite://{name}'.format(name=self.DBNAME)
        else:
            self.DATABASE_URI = r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
                dialect=self.DIALECT, user=self.DBUSER, passwd=self.DBPASSWD,
                host=self.HOSTNAME, port=self.PORT, name=self.DBNAME
            )

## Instruction:
Replace database_uri method with a property
## Code After:
class Config(object):
    """
    Base configuration class.  Contains one property that defines the database URI.

    This class is to be subclassed and its attributes defined therein.
    """

    @property
    def database_uri(self):
        return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqlite' else \
            r'{dialect}://{user}:{passwd}@{host}:{port}/{name}'.format(
                dialect=self.DIALECT, user=self.DBUSER, passwd=self.DBPASSWD,
                host=self.HOSTNAME, port=self.PORT, name=self.DBNAME
            )
