3 ms·
The `?` operators also fit better within TypeScript's overall syntax, whereas Python traditionally prefers English words over punctuation characters. In a lang
by pansa2 4y ago
The `?` operators also fit better within TypeScript's overall syntax, whereas Python traditionally prefers English words over punctuation characters.
In a language which considers `and` and `or` more readable than `&&` and `||`, surely `is not None` is more readable than `??`.
- phailhaus 4y agoTrue, but it is tricky because `is not None` doesn't work here. For example, `my_var ?? 0` would become `my_var if not None 0` which doesn't really make sense and also collides with the pre-existing ternary syntax (`my_var if not None else 0`).