In TypeScript you can enable this by using BrandedTypes like this:
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)