Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "D'Arcy J.M. Cain" Newsgroups: comp.lang.python Subject: Re: increment/decrement operators Date: Sat, 5 Dec 2015 09:41:15 -0500 Organization: Vybe Networks Inc. Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de u3sH+5Q+Ez2RVTMmlJnqZAcR8QkW/G9bCekE0WaHBAfw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'works.': 0.07; 'cc:addr :python-list': 0.09; '"def"': 0.16; '(well,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:operators': 0.16; 'wrote:': 0.16; '>>>': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'cc:no real name:2**0': 0.22; 'dec': 0.23; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; '+0100': 0.27; 'does,': 0.29; 'objects': 0.29; 'subject:/': 0.30; 'but': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'special': 0.73; 'received:98.158': 0.84 In-Reply-To: X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100039 On Sat, 5 Dec 2015 13:56:47 +0100 Robin Koch wrote: > x += y works. (Well, it should.) It does, even on objects other than numbers. >>> x = "abc" >>> y = "def" >>> x += y >>> x 'abcdef' > x++ doesn't. No but it's just a special case of the above. >>> x = 1 >>> x += 1 >>> x 2 -- D'Arcy J.M. Cain Vybe Networks Inc. http://www.VybeNetworks.com/ IM:darcy@Vex.Net VoIP: sip:darcy@VybeNetworks.com