# Buggy code
def _initialize_attributes(self):
    self._short_url = self._fetch_default("short_url") or self.CONFIG_NOT_SET
    self.check_for_updates = self._config_boolean(
        self._fetch_or_not_set("check_for_updates")
    )
    self.kinds = {
        x: self._fetch("{}_kind".format(x))
        for x in [
            "comment",
            "message",
            "redditor",
            "submission",
            "subreddit",
            "trophy",
        ]
    }

    for attribute in (
        "client_id",
        "client_secret",
        "redirect_uri",
        "refresh_token",
        "password",
        "user_agent",
        "username",
    ):
        setattr(self, attribute, self._fetch_or_not_set(attribute))

    for required_attribute in ("oauth_url", "reddit_url", "timeout"):
        setattr(self, required_attribute, self._fetch(required_attribute))

    for attribute, conversion in {"timeout": int}.items():
        try:
            setattr(self, attribute, conversion(getattr(self, attribute)))
        except ValueError:
            raise ValueError(
                "An incorrect config type was given for option {}. The "
                "expected type is {}, but the given value is {}.".format(
                    attribute,
                    conversion.__name__,
                    getattr(self, attribute),
                )
            )


# Traceback (APIException)
---------------------------------------------------------------------------
APIException                              Traceback (most recent call last)
<ipython-input-14-5b88e4f8d60d> in <module>
1 while True:
----> 2     print(repr(s[1].reply("F")))
3

/usr/local/lib/python3.7/site-packages/praw/models/reddit/mixins/replyable.py in reply(self, body)
31         """
32         data = {"text": body, "thing_id": self.fullname}
---> 33         comments = self._reddit.post(API_PATH["comment"], data=data)
34         try:
35             return comments[0]

/usr/local/lib/python3.7/site-packages/praw/reddit.py in post(self, path, data, files, params)
553             "POST", path, data=data or {}, files=files, params=params
554         )
--> 555         return self._objector.objectify(data)
556
557     def put(

/usr/local/lib/python3.7/site-packages/praw/objector.py in objectify(self, data)
168             errors = data["json"]["errors"]
169             if len(errors) == 1:
--> 170                 raise APIException(*errors[0])
171             assert not errors
172         elif isinstance(data, dict):

APIException: RATELIMIT: 'you are doing that too much. try again in 5 seconds.' on field 'ratelimit'

# Fixed code
def _initialize_attributes(self):
    self._short_url = self._fetch_default("short_url") or self.CONFIG_NOT_SET
    self.check_for_updates = self._config_boolean(
        self._fetch_or_not_set("check_for_updates")
    )
    self.kinds = {
        x: self._fetch("{}_kind".format(x))
        for x in [
            "comment",
            "message",
            "redditor",
            "submission",
            "subreddit",
            "trophy",
        ]
    }

    for attribute in (
        "client_id",
        "client_secret",
        "redirect_uri",
        "refresh_token",
        "password",
        "user_agent",
        "username",
    ):
        setattr(self, attribute, self._fetch_or_not_set(attribute))

    for required_attribute in (
        "oauth_url",
        "ratelimit_seconds",
        "reddit_url",
        "timeout",
    ):
        setattr(self, required_attribute, self._fetch(required_attribute))

    for attribute, conversion in {
        "ratelimit_seconds": int,
        "timeout": int,
    }.items():
        try:
            setattr(self, attribute, conversion(getattr(self, attribute)))
        except ValueError:
            raise ValueError(
                "An incorrect config type was given for option {}. The "
                "expected type is {}, but the given value is {}.".format(
                    attribute,
                    conversion.__name__,
                    getattr(self, attribute),
                )
            )