public static @NotNull List<@Nullable PyType> substituteExpand(@Nullable PyType type,
                                                                 @NotNull GenericSubstitutions substitutions,
                                                                 @NotNull TypeEvalContext context,
                                                                 @NotNull Set<PyType> substituting) {
    PyType substituted = substitute(type, substitutions, context, substituting);
    if (substituted instanceof PyUnpackedTupleType unpackedTupleType && !unpackedTupleType.isUnbound()) {
      return unpackedTupleType.getElementTypes();
    }
    return Collections.singletonList(substituted);
  }
public static @NotNull List<@Nullable PyType> substituteExpand(@Nullable PyType type,
                                                                 @NotNull GenericSubstitutions substitutions,
                                                                 @NotNull TypeEvalContext context,
                                                                 @NotNull Set<PyType> substituting)