<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_extension(self, klass, extension):
 """Register an extension for a class. :param klass: Class to register an extension for :param extension: Extension (arbitrary type) """

        klass = self._get_class_path(klass)

        # TODO: Take order into account.
        self._extensions.setdefault(klass, []).append(extension)