<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def default(self, obj):
 """Encode more types."""

        if isinstance(obj, UUID):
            return obj.hex
        elif isinstance(obj, datetime.datetime):
            return obj.isoformat()

        return super().default(obj)