Dave Hirschfeld

Results 503 comments of Dave Hirschfeld
trafficstars

☝️ pseudo-code, doesn't _actually_ work, but could something like that be made to work?

> ☝️ pseudo-code, doesn't _actually_ work, but could something like that be made to work? IIUC the example code doesn't work because `enc_hook` isn't called for "known" types such as...

This is pretty critical functionality for me and could be a dealbreaker for my using `msgspec` to serialize arbitrary kwargs (with a finite set of known types). If I define...

It's possible in the `stdlib`: ```python @singledispatch def enc_hook(obj: Any) -> Any: raise NotImplementedError(f"Objects of type {obj!r} are not supported") @enc_hook.register def _(obj: DateTime) -> dict: return dict(type='DateTime', value=obj.isoformat()) @enc_hook.register...

Being able to disambiguate and hence roundtrip a `dict` with both string and date values (amongst others) is critical functionality for me so I'm going with the standard-library `json` module...

I came here looking for this functionality so I can store some extra metadata on a Struct that I don't want to be serialized or part of the `__init__`. I'm...

Another example, of something I'd like to do is to attach an `fsspec.AbstractFileSystem` to the class which would then be used in a `save` method to serialize itself and write...

This would be super valuable for e.g. not accidentally exposing secrets in logs.

Sure, I actually agree with that - I was just trying to follow existing convention. All I care about is that I can view a str object as a mermaid...

Maybe the issue title should be changed to: #### Allow displaying a string variable as a Mermaid diagram