4 ms·
Mixing types in an array/list is not remotely stupid. How exactly would you suggest expressing the lack of a value in a series of numbers without None/null? The
by ris 4y ago
Mixing types in an array/list is not remotely stupid. How exactly would you suggest expressing the lack of a value in a series of numbers without None/null? There's your mixed types.
Don't let weird dogma get in the way of practicality.
- insanitybit 4y agoJSON has a `null` value already, and null is its own special case in most languages where `null` is a universal type. Otherwise you tag your data so that it's an array of objects.
- qwefsdf 4y agoThat's an Optional[int]. It's not "mixed types", it's a union type.
- ris 4y agoThat is merely a detail of how the typing module has decided to set up convenient aliases. Treated by the language (and likely compilers) as different types.