Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9521

Re: Python ++ Operator?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'operator': 0.05; 'python?': 0.05; 'subject:Python': 0.06; 'python': 0.08; 'operator,': 0.09; 'programmer': 0.11; 'received:209.85.214.174': 0.13; 'received:mail- iw0-f174.google.com': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'twice.': 0.16; 'unary': 0.16; 'useless.': 0.16; 'variable.': 0.16; "doesn't": 0.22; 'header:In- Reply-To:1': 0.22; 'received:209.85.214': 0.28; 'all,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'fairly': 0.30; 'subject:?': 0.31; 'does': 0.32; "what's": 0.33; 'to:addr:python-list': 0.34; 'but': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'meaning': 0.40; 'received:209': 0.40; 'legal': 0.69; 'expects': 0.84; 'rafael': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=IGOZHfMuQynfWvsjpOI+x15xQ+kD+cr9tixx0FduPcU=; b=qc2c7Di6xU2wN4IRwxShrU8bXUCcKp34ylzy+y00zXxhkNotMauo69oJvKKXINRQ57 o0ITrQo124XX3VYpdB0sMe8HrVYXxpk6dcQrL01j+QCgm6GS1dPrFWl0gT4sEvOpqIQ0 5J+gtA6gg57l4fKgw75T0pSbRE/OgLbjeOc6c=
MIME-Version 1.0
In-Reply-To <CAH+GN=3PDVnzEp7PJZk7y9BH=vbbsPs7UJoyRcJO3o2wCg-iag@mail.gmail.com>
References <CAH+GN=3PDVnzEp7PJZk7y9BH=vbbsPs7UJoyRcJO3o2wCg-iag@mail.gmail.com>
Date Fri, 15 Jul 2011 17:55:33 +1000
Subject Re: Python ++ Operator?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1055.1310716536.1164.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310716536 news.xs4all.nl 23942 [2001:888:2000:d::a6]:34579
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:9521

Show key headers only | View raw


2011/7/15 Rafael Durán Castañeda <rafadurancastaneda@gmail.com>:
> Hello all,
> What's the meaning of using i++? Even, does exist ++ operator in python?

++i is legal Python but fairly useless. It's the unary + operator,
applied twice. It doesn't increment the variable.

Now, i+=1 IS valid Python, and WILL do what a C programmer expects it to.

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Python ++ Operator? Chris Angelico <rosuav@gmail.com> - 2011-07-15 17:55 +1000
  Re: Python ++ Operator? Chris Torek <nospam@torek.net> - 2011-07-15 20:48 +0000

csiph-web