3 ms·
> I'm not a fan of 0===false===null for equality / truthiness tests. But "null is empty list" is categorically different and fine by me. Wat? You might want t
by bombolo 4y ago
> I'm not a fan of 0===false===null for equality / truthiness tests. But "null is empty list" is categorically different and fine by me.
Wat?
You might want to signify that you are not passing a list instead of you are passing an empty list. Same way that happens with any other type…
> The fact that in JavaScript (and Java)
Well in JS it's completely insane. With typed python if you say "list of XXX" null is not accepted by linters. You need to specify it's also an option.
- shadowgovt 4y agoJavaScript already has undefined as a primitive that could be used to signify you are not passing a list as opposed to passing an empty list. I think we are talking around agreement here, which is that JavaScript was not particularly well-designed.