Hacker News new | ask | show | jobs
by emptysea 1255 days ago
If you have a tagged union type with Boolean literals as the tags, like in the slack api, then you can’t say ‘if not res.ok’ to narrow the type, you have to say ‘if res.ok == True’

Which isn’t very pythonic imho

Also I’m pretty sure ‘if res.ok is True’ doesn’t work