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

The inconsistency is that for immutable objects (or more generally, objects that have __add__ but not __iadd__), '+=' does create a name binding.

After 'a = 300; b = 50000',

    a += b
is exactly the same as

    a = a + b
In this case, a new object is created with the value of a + b which then gets bound to the name a.


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

Search: