paul@61 | 1 | #!/usr/bin/env python |
paul@61 | 2 | |
paul@61 | 3 | """ |
paul@61 | 4 | Simple built-in classes and functions. |
paul@61 | 5 | |
paul@61 | 6 | Copyright (C) 2005, 2006, 2007, 2008 Paul Boddie <paul@boddie.org.uk> |
paul@61 | 7 | |
paul@61 | 8 | This program is free software; you can redistribute it and/or modify it under |
paul@61 | 9 | the terms of the GNU General Public License as published by the Free Software |
paul@61 | 10 | Foundation; either version 3 of the License, or (at your option) any later |
paul@61 | 11 | version. |
paul@61 | 12 | |
paul@61 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT |
paul@61 | 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
paul@61 | 15 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
paul@61 | 16 | details. |
paul@61 | 17 | |
paul@61 | 18 | You should have received a copy of the GNU General Public License along with |
paul@61 | 19 | this program. If not, see <http://www.gnu.org/licenses/>. |
paul@61 | 20 | """ |
paul@61 | 21 | |
paul@61 | 22 | class object: |
paul@61 | 23 | def __init__(self): pass |
paul@61 | 24 | def __bool__(self): pass |
paul@61 | 25 | def __iadd__(self, other): pass |
paul@61 | 26 | |
paul@61 | 27 | class bool: |
paul@61 | 28 | def __bool__(self): pass |
paul@61 | 29 | def __str__(self): pass |
paul@61 | 30 | |
paul@61 | 31 | class buffer: |
paul@61 | 32 | def __init__(self, size): pass |
paul@61 | 33 | def append(self, s): pass |
paul@61 | 34 | def __str__(self): pass |
paul@61 | 35 | |
paul@61 | 36 | class dict: |
paul@61 | 37 | def __init__(self, *args): pass |
paul@61 | 38 | def __setitem__(self, key, value): pass |
paul@61 | 39 | def __getitem__(self, key): pass |
paul@61 | 40 | |
paul@61 | 41 | class file: |
paul@61 | 42 | def write(self, s): pass |
paul@61 | 43 | |
paul@61 | 44 | class float: |
paul@61 | 45 | def __init__(self, number_or_string=None): pass |
paul@61 | 46 | def __iadd__(self, other): pass |
paul@61 | 47 | def __isub__(self, other): pass |
paul@61 | 48 | def __add__(self, other): pass |
paul@61 | 49 | def __radd__(self, other): pass |
paul@61 | 50 | def __sub__(self, other): pass |
paul@61 | 51 | def __rsub__(self, other): pass |
paul@61 | 52 | def __mul__(self, other): pass |
paul@61 | 53 | def __rmul__(self, other): pass |
paul@61 | 54 | def __div__(self, other): pass |
paul@61 | 55 | def __rdiv__(self, other): pass |
paul@61 | 56 | def __floordiv__(self, other): pass |
paul@61 | 57 | def __rfloordiv__(self, other): pass |
paul@61 | 58 | def __mod__(self, other): pass |
paul@61 | 59 | def __pow__(self, other): pass |
paul@61 | 60 | def __rpow__(self, other): pass |
paul@61 | 61 | def __lt__(self, other): pass |
paul@61 | 62 | def __gt__(self, other): pass |
paul@61 | 63 | def __le__(self, other): pass |
paul@61 | 64 | def __ge__(self, other): pass |
paul@61 | 65 | def __eq__(self, other): pass |
paul@61 | 66 | def __ne__(self, other): pass |
paul@61 | 67 | def __neg__(self): pass |
paul@61 | 68 | def __pos__(self): pass |
paul@61 | 69 | def __str__(self): pass |
paul@61 | 70 | def __bool__(self): pass |
paul@61 | 71 | |
paul@61 | 72 | class int: |
paul@61 | 73 | def __init__(self, number_or_string=None): pass |
paul@61 | 74 | def __iadd__(self, other): pass |
paul@61 | 75 | def __isub__(self, other): pass |
paul@61 | 76 | def __add__(self, other): pass |
paul@61 | 77 | def __radd__(self, other): pass |
paul@61 | 78 | def __sub__(self, other): pass |
paul@61 | 79 | def __rsub__(self, other): pass |
paul@61 | 80 | def __mul__(self, other): pass |
paul@61 | 81 | def __rmul__(self, other): pass |
paul@61 | 82 | def __div__(self, other): pass |
paul@61 | 83 | def __rdiv__(self, other): pass |
paul@61 | 84 | def __floordiv__(self, other): pass |
paul@61 | 85 | def __rfloordiv__(self, other): pass |
paul@61 | 86 | def __mod__(self, other): pass |
paul@61 | 87 | def __pow__(self, other): pass |
paul@61 | 88 | def __and__(self, other): pass |
paul@61 | 89 | def __rand__(self, other): pass |
paul@61 | 90 | def __or__(self, other): pass |
paul@61 | 91 | def __ror__(self, other): pass |
paul@61 | 92 | def __xor__(self, other): pass |
paul@61 | 93 | def __rxor__(self, other): pass |
paul@61 | 94 | def __lt__(self, other): pass |
paul@61 | 95 | def __gt__(self, other): pass |
paul@61 | 96 | def __le__(self, other): pass |
paul@61 | 97 | def __ge__(self, other): pass |
paul@61 | 98 | def __eq__(self, other): pass |
paul@61 | 99 | def __ne__(self, other): pass |
paul@61 | 100 | def __neg__(self): pass |
paul@61 | 101 | def __pos__(self): pass |
paul@61 | 102 | def __str__(self): pass |
paul@61 | 103 | def __bool__(self): pass |
paul@61 | 104 | |
paul@61 | 105 | class list: |
paul@61 | 106 | def __init__(self, args=()): pass |
paul@61 | 107 | def __getitem__(self, index): pass |
paul@61 | 108 | def __setitem__(self, index, value): pass |
paul@61 | 109 | def __getslice__(self, start, end=None): pass |
paul@61 | 110 | def __setslice__(self, start, end, slice): pass |
paul@61 | 111 | def append(self, value): pass |
paul@61 | 112 | def __len__(self): pass |
paul@61 | 113 | def __add__(self, other): pass |
paul@61 | 114 | def __iadd__(self, other): pass |
paul@61 | 115 | def __str__(self): pass |
paul@61 | 116 | def __iter__(self): pass |
paul@61 | 117 | def __bool__(self): pass |
paul@61 | 118 | |
paul@61 | 119 | class long: |
paul@61 | 120 | def __init__(self, number_or_string=None): pass |
paul@61 | 121 | def __iadd__(self, other): pass |
paul@61 | 122 | def __isub__(self, other): pass |
paul@61 | 123 | def __add__(self, other): pass |
paul@61 | 124 | def __radd__(self, other): pass |
paul@61 | 125 | def __sub__(self, other): pass |
paul@61 | 126 | def __rsub__(self, other): pass |
paul@61 | 127 | def __mul__(self, other): pass |
paul@61 | 128 | def __rmul__(self, other): pass |
paul@61 | 129 | def __div__(self, other): pass |
paul@61 | 130 | def __rdiv__(self, other): pass |
paul@61 | 131 | def __floordiv__(self, other): pass |
paul@61 | 132 | def __rfloordiv__(self, other): pass |
paul@61 | 133 | def __and__(self, other): pass |
paul@61 | 134 | def __rand__(self, other): pass |
paul@61 | 135 | def __or__(self, other): pass |
paul@61 | 136 | def __ror__(self, other): pass |
paul@61 | 137 | def __xor__(self, other): pass |
paul@61 | 138 | def __rxor__(self, other): pass |
paul@61 | 139 | def __lt__(self, other): pass |
paul@61 | 140 | def __gt__(self, other): pass |
paul@61 | 141 | def __le__(self, other): pass |
paul@61 | 142 | def __ge__(self, other): pass |
paul@61 | 143 | def __eq__(self, other): pass |
paul@61 | 144 | def __ne__(self, other): pass |
paul@61 | 145 | def __neg__(self): pass |
paul@61 | 146 | def __pos__(self): pass |
paul@61 | 147 | def __str__(self): pass |
paul@61 | 148 | def __bool__(self): pass |
paul@61 | 149 | |
paul@61 | 150 | class none: |
paul@61 | 151 | def __bool__(self): pass |
paul@61 | 152 | def __str__(self): pass |
paul@61 | 153 | |
paul@61 | 154 | NoneType = none |
paul@61 | 155 | |
paul@61 | 156 | class slice: |
paul@61 | 157 | def __init__(self, start_or_end, end=None, step=None): pass |
paul@61 | 158 | |
paul@61 | 159 | class str: |
paul@61 | 160 | def __init__(self, x=None): pass |
paul@61 | 161 | def __getitem__(self, index): pass |
paul@61 | 162 | def __getslice__(self, start, end=None): pass |
paul@61 | 163 | def __iadd__(self, other): pass |
paul@61 | 164 | def __add__(self, other): pass |
paul@61 | 165 | def __radd__(self, other): pass |
paul@61 | 166 | def __mul__(self, other): pass |
paul@61 | 167 | def __radd__(self, other): pass |
paul@61 | 168 | def __mod__(self, other): pass |
paul@61 | 169 | def __lt__(self, other): pass |
paul@61 | 170 | def __gt__(self, other): pass |
paul@61 | 171 | def __le__(self, other): pass |
paul@61 | 172 | def __ge__(self, other): pass |
paul@61 | 173 | def __eq__(self, other): pass |
paul@61 | 174 | def __ne__(self, other): pass |
paul@61 | 175 | def __len__(self): pass |
paul@61 | 176 | def __str__(self): pass |
paul@61 | 177 | def __bool__(self): pass |
paul@61 | 178 | def join(self, l): pass |
paul@61 | 179 | |
paul@61 | 180 | class tuple: |
paul@61 | 181 | def __init__(self, args): pass |
paul@61 | 182 | def __getitem__(self, index): pass |
paul@61 | 183 | def __getslice__(self, start, end=None): pass |
paul@61 | 184 | def __len__(self): pass |
paul@61 | 185 | def __add__(self, other): pass |
paul@61 | 186 | def __str__(self): pass |
paul@61 | 187 | def __iter__(self): pass |
paul@61 | 188 | def __bool__(self): pass |
paul@61 | 189 | |
paul@61 | 190 | class xrange: |
paul@61 | 191 | def __init__(self, start_or_end, end=None, step=1): pass |
paul@61 | 192 | def __iter__(self): pass |
paul@61 | 193 | def next(self): pass |
paul@61 | 194 | |
paul@61 | 195 | class Exception: |
paul@61 | 196 | def __init__(self, *args): pass |
paul@61 | 197 | |
paul@61 | 198 | class AssertionError(Exception): |
paul@61 | 199 | pass |
paul@61 | 200 | |
paul@61 | 201 | class AttributeError(Exception): |
paul@61 | 202 | pass |
paul@61 | 203 | |
paul@61 | 204 | class IndexError(Exception): |
paul@61 | 205 | pass |
paul@61 | 206 | |
paul@61 | 207 | class StopIteration(Exception): |
paul@61 | 208 | pass |
paul@61 | 209 | |
paul@61 | 210 | class TypeError(Exception): |
paul@61 | 211 | pass |
paul@61 | 212 | |
paul@61 | 213 | class NotImplementedType: |
paul@61 | 214 | pass |
paul@61 | 215 | |
paul@61 | 216 | # General functions. |
paul@61 | 217 | |
paul@61 | 218 | def isinstance(obj, cls): pass |
paul@61 | 219 | def issubclass(cls1, cls2): pass |
paul@61 | 220 | def len(x): pass |
paul@61 | 221 | def max(*l): pass |
paul@61 | 222 | def range(start_or_end, end=None, step=None): pass |
paul@61 | 223 | |
paul@61 | 224 | # Special values. |
paul@61 | 225 | |
paul@61 | 226 | True = bool() |
paul@61 | 227 | False = bool() |
paul@61 | 228 | None = none() |
paul@61 | 229 | stdin = file() |
paul@61 | 230 | stdout = file() |
paul@61 | 231 | stderr = file() |
paul@61 | 232 | NotImplemented = NotImplementedType() |
paul@61 | 233 | |
paul@61 | 234 | # vim: tabstop=4 expandtab shiftwidth=4 |