[Python-Dev] ++x oddnes

Skip Montanaro skip@pobox.com (Skip Montanaro)
Mon, 13 Aug 2001 08:53:23 -0500


    mal> David Ascher wrote:
    >> 
    >> Guido van Rossum wrote:
    >> 
    >> > IMO not worth it changing the language.  Train yourself to write x++
    >> > instead. :-)
    >> 
    >> Sounds like an excellent one for PyChecker =)

    mal> Why ? ++x can be put to some real use: I have a counter type which
    mal> actually uses ++x to increment the counter.

(I've been away for a few days, so perhaps this has been covered already.
I'm still catching up.)

How?  ++x compiles to

         LOAD_FAST         x
         UNARY_POSITIVE      
         UNARY_POSITIVE      

I don't see any incrementing going on...

Skip