Hi Tim, On Wed, Mar 29, 2006 at 08:45:10AM -0700, Tim Hochberg wrote: > Ouch. Assuming the same path is followed with tuples, I think that this > means the following behaviour will continue: > > >>> t = (1,2,3) > >>> a = array([4,5,6]) > >>> t += a > >>> t > array([5, 7, 9]) I fell into the same trap at first, but no: in fact, only lists have a special in-place addition among all the built-in objects. Tuples fall back to the normal addition, which means that you can only add tuples to tuples: >>> t = (1,2,3) >>> t += [4,5,6] TypeError: can only concatenate tuple (not "list") to tuple >>> t += array([4,5,6]) TypeError: ... This is current behavior and it wouldn't change. A bientot, Armin.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4