Frederico Caroli

Results 7 comments of Frederico Caroli

For reference, this is my implementation: ```python def evolve_as(__inst: Any, __cls: Type[_S], **changes: Any) -> _S: inst_cls = type(__inst) inst_field_names = {field.name for field in attrs.fields(inst_cls)} for cls_field in attrs.fields(__cls):...

> Heh wait, so what you're doing is taking a base class and fill out the rest such that it becomes a super class? Not a super class, a subclass....

> For well-behaved subclasses (which for attrs-generated ones should be all of em unless you did init=False and wrote a "bad" subclass __init__ yourself), isn't your example equivalent to: Well...

Not sure what you mean by "that breaks with multiple inheritance"... ```python @attrs.define(slots=False) class Foo: a: int @attrs.define(slots=False) class Bar: b: int @attrs.define(slots=False) class Baz(Foo, Bar): a: int = attrs.field(alias="c")...

+1 This is quite annoying when I'm using cattrs' hook factories... e.g. the snake_case to camelCase cattrs example doesn't work with generic classes

For those that, like me, got stuck trying to make this work. Here's my complete solution for file uploads and downloads. `openapi-typescript` version 6.x and OpenAPI 3.0.3 # openapi-typescript types...

This still doesn't work. `[email protected]` This is also not working for me: ```ts import _Ajv from 'ajv'; const Ajv = _Ajv as unknown as typeof _Ajv.default; const ajv = new...