def METHOD_NAME(cls, ty):
    contained_types = []
    type_resolved = ty.strip_typedefs()
    index = 0
    while True:
        try:
            arg = type_resolved.template_argument(index)
            index += 1
            contained_types.append(arg)
        except RuntimeError:
            break
    return contained_types