PyType (@NotNull TypeEvalContext context) { final PyType parameterType = getType(context); if (isPositionalContainer() && parameterType instanceof PyTupleType tupleType) { // *args: str is equivalent to *args: *tuple[str, ...] // *args: *Ts is equivalent to *args: *tuple[*Ts] // Convert its type to a more general form of an unpacked tuple PyUnpackedTupleType unpackedTupleType = tupleType.asUnpackedTupleType(); if (unpackedTupleType.isUnbound()) { return unpackedTupleType.getElementTypes().get(0); } return unpackedTupleType; } else if (isKeywordContainer() && parameterType instanceof PyCollectionType dictType) { return ContainerUtil.getOrElse(dictType.getElementTypes(), 1, null); } return parameterType; }