Hacker News new | past | comments | ask | show | jobs | submit login

The existing alternative to `a | b` was

  {**a, **b}
You could see this as an improvement.



as pointed out elsewhere in this thread, `"a" or "b"` evaluates to "a", which kind of makes me think that `a | b` (with a and b as dicts) would take values for overlapping keys from a, not from b.

The dict literal with dict-splats conveys a sense of ordering that makes the behavior of taking values for overlapping keys from the lattermost dict make more sense to me.


Oh my god yes.


As someone who started out in C I love the pointer style syntax


But it doesn't have anything to do with pointers....


Yeah but it’s the aesthetic (tho to be fair everything is a pointer in python.)


So.. you love asterisks?


No? I think the asterisks (two of which acts as a “pointer” to an expanded dict, instead of the dict itself) is straightforward and yes more aesthetic for my taste. Not sure what the circle jerk of non-sequitor comments and downvotes is for?




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

Search: