Postfix/Prefix Operators (++,--)

Jp Calderone exarkun at intarweb.us
Fri Jun 6 02:15:57 EDT 2003


On Fri, Jun 06, 2003 at 01:49:00PM +0800, hostmaster wrote:
> Hi,
> 
> Python doesn't seems to support postfix/prefix operators (e.g. i++,
> --i).  Why?

  Because

    i = i + 1
    i = i - 1

  and because

    >>> import this
    ...
    There should be one-- and preferably only one --obvious way to do it.
    ...

  and because Python is not C or Java, it is Python.

  Jp





More information about the Python-list mailing list