A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/048387.html below:

[Python-Dev] list += string??

[Python-Dev] list += string??David Abrahams dave at boost-consulting.com
Thu Aug 26 16:18:39 CEST 2004
I just discovered the following behavior:

  C:\Documents and Settings\dave>python
  Python 2.3 (#46, Aug 25 2003, 18:37:29) [MSC v.1200 32 bit (Intel)] on win32
  Type "help", "copyright", "credits" or "license" for more information.
  >>> prefix = ['foo', 'bar', 'baz']
  >>> prefix += 'bomb'  # meant to write prefix += [ 'bomb' ]
  >>> prefix
  ['foo', 'bar', 'baz', 'b', 'o', 'm', 'b']
  >>>

Is it new and/or intentional?  I would have expected an error from the
+=.  I was very surprised when my error "passed silently".

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

More information about the Python-Dev mailing list

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