<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def console_list_load_xp( filename: str ) -> Optional[List[tcod.console.Console]]: """Return a list of consoles from a REXPaint `.xp` file."""

    tcod_list = lib.TCOD_console_list_from_xp(filename.encode("utf-8"))
    if tcod_list == ffi.NULL:
        return None
    try:
        python_list = []
        lib.TCOD_list_reverse(tcod_list)
        while not lib.TCOD_list_is_empty(tcod_list):
            python_list.append(
                tcod.console.Console._from_cdata(lib.TCOD_list_pop(tcod_list))
            )
        return python_list
    finally:
        lib.TCOD_list_delete(tcod_list)