          """
          Read-only fields should not be writable, even with default ()
          """
          serializer = self.Serializer()
          assert len(serializer._writable_fields) == 1
  
      def test_validate_read_only(self):
          """
          Read-only serializers.should not be included in validation.
          """
 
</s> remove         return [
            field for field in self.fields.values()
            if not field.write_only
        ]
 </s> add         for field in self.fields.values():
            if not field.write_only:
                yield field </s> remove     @cached_property
 </s> add     @property </s> remove         return [
            field for field in self.fields.values() if not field.read_only
        ]
 </s> add         for field in self.fields.values():
            if not field.read_only:
                yield field </s> remove     @cached_property
 </s> add     @property
        assert len(list(serializer._writable_fields)) == 1
          """
          Read-only fields should not be writable, even with default ()
          """
          serializer = self.Serializer()
        assert len(list(serializer._writable_fields)) == 1
  
      def test_validate_read_only(self):
          """
          Read-only serializers.should not be included in validation.
          """
keep keep keep keep replace keep keep keep keep keep
 Don't cache _readable_fields and _writable_fields (#6689)

It might be useful for a serializer with many many fields which uses
read_only and write_only on a large percentage of the fields. But the
memory usage and statefulness it adds are not worth it for the common
case. 
tests/test_fields.py