David Hewitt

Results 1495 comments of David Hewitt

> I guess the issue is that we can't validate the type of the values this way? I guess exactly this, yes. Validation may in general lead to coercions (e.g....

It seems the case that all the keyword argument (extraction) in `SchemaSerializer` methods make the native stack frames huge (especially in debug mode), hence the segfault. I will see if...

Interestingly, replacing ```python message: pydantic.BaseModel | Base ``` with ```python message: pydantic.BaseModel ``` gets the empty value in `2.12.3` also. EDIT: of course it does, there is no "serialize as...

`Base` is an arbitrary type, so we will always use type inference to serialize it. The 2.12.3 behavior therefore seems correct.

Yes, you're correct, sorry. I was just reaching similar conclusions. The behavior change has come from https://github.com/pydantic/pydantic-core/pull/1857/files#diff-6a585ccfa8f15256fde9fddfa8d1c651a69b9f20d4d320a916cbef5ab6d4ae48L97-L117, where we started passing the full extra from the current serialization into model...

> ... or of course, could set it in the model config which might be totally fine too. I just attempted to verify this, it doesn't currently apply because `polymorphic_serialization`...

... and trying the runtime value shows a bug on #12518, it breaks stdlib dataclasses. ``` Traceback (most recent call last): File "/Users/david/Dev/pydantic/pydantic/test.py", line 45, in print(container_network.model_dump(polymorphic_serialization=True)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/david/Dev/pydantic/pydantic/pydantic/main.py",...

With latest pushes to #12518, can confirm that branch would fix this case: ```python print(container_network.model_dump(polymorphic_serialization=True)) #> {'message': {'error': {'code': 'network_error', 'message': 'test'}}} ```

I just discovered that this issue is not unique to Alacritty: if `TERM` is set in Windows Terminal then the output is broken in the same way as with Alacritty....

I get the impression from discussion on microsoft/terminal that they're working very hard to support VT (and considering the Windows console APIs mostly for legacy programs). If we can identify...