(no title)
presz | 7 months ago
type UserId = string & { readonly __tag: unique symbol };
In Python you can use `NewType` from the typing module: from typing import NewType
from uuid import UUID
UserId = NewType("UserId", UUID)presz | 7 months ago
type UserId = string & { readonly __tag: unique symbol };
In Python you can use `NewType` from the typing module: from typing import NewType
from uuid import UUID
UserId = NewType("UserId", UUID)
movpasd|7 months ago
12_throw_away|7 months ago
[1] https://typing.python.org/en/latest/spec/aliases.html