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

All my students disagree with you. They all try addition, and all expect a resulting dict with keys from both dicts. The fact the keys from the one side are prioritized is something they will learn once, just like with dict.update().


That's something a student may learn. But there will be plenty of people reading Python code that don't know how "+" works on dicts; and it is difficult to find out what it does because you can't easily Google/grep for the function name. Doing experiments with dicts is not something you want to be doing while you are reading other people's code.




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

Search: