Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It operates similarly to bitwise or, combining all the set bits, or like the or operator on sets, combining all the set elements. "|" has never meant logical or in python nor in most other common programming languages.


They’re referring to duplicate keys’ precedence. `a or b` prefers `a` if truthy, but `a | b` prefers b’s values.


That's because it's replicating the behavior of the update function. Again | doesn't mean or, so it shouldn't be expected to behave the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: