3 ms·
Actually, not really. In this case UserId is still an integer, which means any method that takes an integer can also take a UserId. Which means your co-workers
by sdeframond 1y ago
Actually, not really. In this case UserId is still an integer, which means any method that takes an integer can also take a UserId. Which means your co-workers are likely to just use integer out of habit.
Also, you can still do integer things with them, such as
> nonsense = UserId(1) + UserId(2)
- chaz6 1y agoIt will not stop you doing this at runtime of course. It is only intended for type checking.