I think we can safely assume that all items in self.named_values are of type NamedValue. Maybe add an assert instead?