On 7 September 2024 17:23:13 BST, Davey Shafik <m...@daveyshafik.com> wrote:
>
>My point is that if you talk about type DEFs, you now have this feature where 
>you can input one type and get something that encapsulates it, and it seems 
>weird that enums would LOOK similar In type hint usage and function 
>differently.

Personally, I would prefer to go the other way: make typedefs, like enums, 
something you explicitly construct / cast to, rather than something that 
implicitly coerces any compatible value. 

Like enums, I would want to use typedefs to prevent accidental mixing of values 
(e.g. a name where a reference number was expected, or a size in pixels where a 
size in centimetres was expected). That use is compromised if every scalar 
value is silently accepted for any matching typedef.

Regards,
Rowan Tommins
[IMSoP]

Reply via email to