That's an interesting case; I'm planning on including code in our library to handle `NewType` at runtime, to: a) enforce types of parameters and dataclass attributes, and b) use its underlying type for serialization and deserialization of values.

On Mon, 2022-01-17 at 19:55 +0000, Luis Miguel Morera De La Cruz wrote:
To add to this, you could potentially consider `typing.NewType` as precedent. Whilst it is an introspectable class at runtime, `NewType.__call__` is just also just a no-op and only gains meaning when a type checker is applied.

(forgive the bad example)
```
Volume = NewType("Volume", int)
type(N)  #  <class 'typing.NewType'>

tv_volume = Volume(50)
type(tv_volume)  #  <class `int`>
```

On Mon, Jan 17, 2022 at 7:19 PM Eric Traut <eric@traut.com> wrote:
It's similar to `typing.cast`, which is part of stdlib. The `cast` call acts as a no-op at runtime but has special meaning to type checkers.
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: capruce@gmail.com