Peter Otten wrote: >>>> class Int(object): [snip] > ... def __pos__(self): > ... if self.half: > ... self.value += 1 > ... self.half = not self.half > ... return self [snip] >>>> i = Int()
which leads us to: >>>> i > 0 >>>> +i > 0 >>>> +i > 1 >>>> +i > 1 >>>> +i > 2 Now that is absolutely lovely. Looks like it's time to join the ranks of Perl and C with an Obfuscated Python Contest. ;) -- Edward Elliott UC Berkeley School of Law (Boalt Hall) complangpython at eddeye dot net -- http://mail.python.org/mailman/listinfo/python-list