PyNamedTupleType (@NotNull Map<String, PyType> fieldNameToType) { if (!myTyped) { final LinkedHashMap<String, FieldTypeAndDefaultValue> newFields = new LinkedHashMap<>(myFields); for (Map.Entry<String, PyType> entry : fieldNameToType.entrySet()) { final String fieldName = entry.getKey(); if (newFields.containsKey(fieldName)) { newFields.put(fieldName, new FieldTypeAndDefaultValue(entry.getValue(), null)); } } return new PyNamedTupleType(myClass, myName, newFields, isDefinition(), false, myDeclaration); } return this; }