PyTupleType (@NotNull PsiElement anchor, @Nullable PyType elementType) { if (elementType instanceof PyUnpackedTupleTypeImpl unpackedTupleType) { return unpackedTupleType.asTupleType(anchor); } else if (elementType instanceof PyTypeVarTupleType) { return PyTupleType.create(anchor, Collections.singletonList(elementType)); } return PyTupleType.createHomogeneous(anchor, elementType); }