Anton Agestam

Results 134 comments of Anton Agestam

I don't think this is an issue, `.zero` is just a convenience property, you can still construct it with `Money(0, SEK)` and the runtime failure you point out can be...

As discussed offline, phantom-types advertises support for Pydantic, not for OpenAPI directly. Pydantic uses `"examples"` in their documentation so it feels like this should be opened as an issue there....

@apirogov I like the idea, though it's a distinct feature from this issue. I created a new issue here: https://github.com/antonagestam/phantom-types/issues/238 Feel free to copy-paste in your comment, and let's continue...

@flaeppe The documented caveat is only regarding JSON schema validation, e.g. `minItems`, `maxItems` and `items.type` aren't automatically set. I think you will want to use `NonEmpty[str]` and not `NonEmpty[list[str]]`, there's...

I'd be happy to include this. I think it would make sense to implement it in the same way as CountryCode, e.g. a union of a Literal and a phantom...

Perhaps it's possible to pair it with a CI job that checks for compatibility against this list? https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry (Assuming the reasoning here is correct: https://stackoverflow.com/a/37062190)

@flaeppe Did you land on anything with regards to the possibility of introducing types for describing the set of rules that locale codes adhere to? I don't remember all the...

Hi 👋 I'm happy that you're trying out phantom-types! I definitely think a resource/more examples/recipes section would be a good idea. I think the [Sized collections](https://phantom-types.readthedocs.io/en/main/pages/types.html#module-phantom.sized) section in the docs...

@espetro Cool! I just think it's nice that there are multiple things happening in this space within Python. Just a note on the `@refined` decorator in your library, I've deliberately...

@espetro I presented phantom-types to typing-sig, the group that brings forth most of the typing features that makes it into Python. There's a recorded presentation with slides, that I mention...