Postfix/Prefix Operators (++,--)

Nick Vargish nav at adams.patriot.net
Sat Jun 7 15:28:46 CEST 2003


Zath <zathras_DESP at M_thwackey.com> writes:

>    def pp(self): # Version 1
>       return self
>       self=self+1 # This also needs executing...

def pp(self):
    while True:
        yield self.val
        self.val += 1

With an implicit :^),

Nick

-- 
#include<stdio.h> /* SigMask 0.3 (sig.c) 19990429 PUBLIC DOMAIN "Compile Me" */
int main(c,v)char *v;{return !c?putchar(*v-1)&&main(0,v+ /* Tweaks welcomed. */
1):main(0,"Ojdl!Wbshjti!=obwAqbusjpu/ofu?\v\1");}  /* build: cc -o sig sig.c */







More information about the Python-list mailing list