(self, write_context, value: datetime.date)
| 413 | |
| 414 | class DateSerializer(Serializer): |
| 415 | def write(self, write_context, value: datetime.date): |
| 416 | if not isinstance(value, datetime.date): |
| 417 | raise TypeError("{} should be {} instead of {}".format(value, datetime.date, type(value))) |
| 418 | days = (value - _base_date).days |
| 419 | if self.type_resolver.xlang: |
| 420 | write_context.write_varint64(days) |
| 421 | else: |
| 422 | write_context.write_int32(days) |
| 423 | |
| 424 | def read(self, read_context): |
| 425 | if self.type_resolver.xlang: |
nothing calls this directly
no test coverage detected