# HG changeset patch # User paulb@localhost.localdomain # Date 1182381850 -7200 # Node ID 010ed9472152599fc4c28f04562beb4260a99637 # Parent 50317047854cd33edccf3e7b7a7d606f110175c6 Added missing methods. diff -r 50317047854c -r 010ed9472152 lib/builtins.py --- a/lib/builtins.py Tue Jun 19 01:39:05 2007 +0200 +++ b/lib/builtins.py Thu Jun 21 01:24:10 2007 +0200 @@ -197,6 +197,16 @@ else: raise TypeError + def __mod__(self, other): + if isinstance(other, int): + return float() + elif isinstance(other, long): + return float() + elif isinstance(other, float): + return float() + else: + raise TypeError + def __pow__(self, other): if isinstance(other, int): return float() @@ -367,6 +377,12 @@ else: raise TypeError + def __mod__(self, other): + if isinstance(other, int): + return int() + else: + raise TypeError + def __pow__(self, other): if isinstance(other, int): return int() @@ -577,6 +593,54 @@ else: raise TypeError + def __mul__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + + def __rmul__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + + def __div__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + + def __rdiv__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + + def __floordiv__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + + def __rfloordiv__(self, other): + if isinstance(other, int): + return long() + elif isinstance(other, long): + return long() + else: + raise TypeError + def __and__(self, other): if isinstance(other, int): return long() @@ -710,6 +774,12 @@ def __init__(self, x=None): x.__str__() + def __iadd__(self, other): + if isinstance(other, str): + return str() + else: + raise TypeError + def __add__(self, other): if isinstance(other, str): return str() @@ -722,6 +792,18 @@ else: raise TypeError + def __mul__(self, other): + if isinstance(other, int) or isinstance(other, long): + return str() + else: + raise TypeError + + def __radd__(self, other): + if isinstance(other, int) or isinstance(other, long): + return str() + else: + raise TypeError + def __mod__(self, other): "The format operator for strings."