home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 February / maximum-cd-2011-02.iso / DiscContents / digsby_setup85.exe / lib / ZSI / wstools / UserTuple.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-11-24  |  3.1 KB  |  88 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4.  
  5. class UserTuple:
  6.     
  7.     def __init__(self, inittuple = None):
  8.         self.data = ()
  9.         if inittuple is not None:
  10.             if type(inittuple) == type(self.data):
  11.                 self.data = inittuple
  12.             elif isinstance(inittuple, UserTuple):
  13.                 self.data = inittuple.data[:]
  14.             else:
  15.                 self.data = tuple(inittuple)
  16.         
  17.  
  18.     
  19.     def __repr__(self):
  20.         return repr(self.data)
  21.  
  22.     
  23.     def __lt__(self, other):
  24.         return self.data < self._UserTuple__cast(other)
  25.  
  26.     
  27.     def __le__(self, other):
  28.         return self.data <= self._UserTuple__cast(other)
  29.  
  30.     
  31.     def __eq__(self, other):
  32.         return self.data == self._UserTuple__cast(other)
  33.  
  34.     
  35.     def __ne__(self, other):
  36.         return self.data != self._UserTuple__cast(other)
  37.  
  38.     
  39.     def __gt__(self, other):
  40.         return self.data > self._UserTuple__cast(other)
  41.  
  42.     
  43.     def __ge__(self, other):
  44.         return self.data >= self._UserTuple__cast(other)
  45.  
  46.     
  47.     def __cast(self, other):
  48.         if isinstance(other, UserTuple):
  49.             return other.data
  50.         return other
  51.  
  52.     
  53.     def __cmp__(self, other):
  54.         return cmp(self.data, self._UserTuple__cast(other))
  55.  
  56.     
  57.     def __contains__(self, item):
  58.         return item in self.data
  59.  
  60.     
  61.     def __len__(self):
  62.         return len(self.data)
  63.  
  64.     
  65.     def __getitem__(self, i):
  66.         return self.data[i]
  67.  
  68.     
  69.     def __getslice__(self, i, j):
  70.         i = max(i, 0)
  71.         j = max(j, 0)
  72.         return self.__class__(self.data[i:j])
  73.  
  74.     
  75.     def __add__(self, other):
  76.         if isinstance(other, UserTuple):
  77.             return self.__class__(self.data + other.data)
  78.         if isinstance(other, type(self.data)):
  79.             return self.__class__(self.data + other)
  80.         return self.__class__(self.data + tuple(other))
  81.  
  82.     
  83.     def __mul__(self, n):
  84.         return self.__class__(self.data * n)
  85.  
  86.     __rmul__ = __mul__
  87.  
  88.