@Nullable
  public static PyType createWeakType(@Nullable PyType type) {
    if (type == null) {
      return null;
    }
    else if (type instanceof PyUnionType unionType) {
      if (unionType.isWeak()) {
        return unionType;
      }
    }
    return union(type, null);
  }
@Nullable
  public static PyType createWeakType(@Nullable PyType type)