1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lib/builtins.py Mon Mar 24 23:53:18 2008 +0100
1.3 @@ -0,0 +1,234 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"""
1.7 +Simple built-in classes and functions.
1.8 +
1.9 +Copyright (C) 2005, 2006, 2007, 2008 Paul Boddie <paul@boddie.org.uk>
1.10 +
1.11 +This program is free software; you can redistribute it and/or modify it under
1.12 +the terms of the GNU General Public License as published by the Free Software
1.13 +Foundation; either version 3 of the License, or (at your option) any later
1.14 +version.
1.15 +
1.16 +This program is distributed in the hope that it will be useful, but WITHOUT
1.17 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.18 +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.19 +details.
1.20 +
1.21 +You should have received a copy of the GNU General Public License along with
1.22 +this program. If not, see <http://www.gnu.org/licenses/>.
1.23 +"""
1.24 +
1.25 +class object:
1.26 + def __init__(self): pass
1.27 + def __bool__(self): pass
1.28 + def __iadd__(self, other): pass
1.29 +
1.30 +class bool:
1.31 + def __bool__(self): pass
1.32 + def __str__(self): pass
1.33 +
1.34 +class buffer:
1.35 + def __init__(self, size): pass
1.36 + def append(self, s): pass
1.37 + def __str__(self): pass
1.38 +
1.39 +class dict:
1.40 + def __init__(self, *args): pass
1.41 + def __setitem__(self, key, value): pass
1.42 + def __getitem__(self, key): pass
1.43 +
1.44 +class file:
1.45 + def write(self, s): pass
1.46 +
1.47 +class float:
1.48 + def __init__(self, number_or_string=None): pass
1.49 + def __iadd__(self, other): pass
1.50 + def __isub__(self, other): pass
1.51 + def __add__(self, other): pass
1.52 + def __radd__(self, other): pass
1.53 + def __sub__(self, other): pass
1.54 + def __rsub__(self, other): pass
1.55 + def __mul__(self, other): pass
1.56 + def __rmul__(self, other): pass
1.57 + def __div__(self, other): pass
1.58 + def __rdiv__(self, other): pass
1.59 + def __floordiv__(self, other): pass
1.60 + def __rfloordiv__(self, other): pass
1.61 + def __mod__(self, other): pass
1.62 + def __pow__(self, other): pass
1.63 + def __rpow__(self, other): pass
1.64 + def __lt__(self, other): pass
1.65 + def __gt__(self, other): pass
1.66 + def __le__(self, other): pass
1.67 + def __ge__(self, other): pass
1.68 + def __eq__(self, other): pass
1.69 + def __ne__(self, other): pass
1.70 + def __neg__(self): pass
1.71 + def __pos__(self): pass
1.72 + def __str__(self): pass
1.73 + def __bool__(self): pass
1.74 +
1.75 +class int:
1.76 + def __init__(self, number_or_string=None): pass
1.77 + def __iadd__(self, other): pass
1.78 + def __isub__(self, other): pass
1.79 + def __add__(self, other): pass
1.80 + def __radd__(self, other): pass
1.81 + def __sub__(self, other): pass
1.82 + def __rsub__(self, other): pass
1.83 + def __mul__(self, other): pass
1.84 + def __rmul__(self, other): pass
1.85 + def __div__(self, other): pass
1.86 + def __rdiv__(self, other): pass
1.87 + def __floordiv__(self, other): pass
1.88 + def __rfloordiv__(self, other): pass
1.89 + def __mod__(self, other): pass
1.90 + def __pow__(self, other): pass
1.91 + def __and__(self, other): pass
1.92 + def __rand__(self, other): pass
1.93 + def __or__(self, other): pass
1.94 + def __ror__(self, other): pass
1.95 + def __xor__(self, other): pass
1.96 + def __rxor__(self, other): pass
1.97 + def __lt__(self, other): pass
1.98 + def __gt__(self, other): pass
1.99 + def __le__(self, other): pass
1.100 + def __ge__(self, other): pass
1.101 + def __eq__(self, other): pass
1.102 + def __ne__(self, other): pass
1.103 + def __neg__(self): pass
1.104 + def __pos__(self): pass
1.105 + def __str__(self): pass
1.106 + def __bool__(self): pass
1.107 +
1.108 +class list:
1.109 + def __init__(self, args=()): pass
1.110 + def __getitem__(self, index): pass
1.111 + def __setitem__(self, index, value): pass
1.112 + def __getslice__(self, start, end=None): pass
1.113 + def __setslice__(self, start, end, slice): pass
1.114 + def append(self, value): pass
1.115 + def __len__(self): pass
1.116 + def __add__(self, other): pass
1.117 + def __iadd__(self, other): pass
1.118 + def __str__(self): pass
1.119 + def __iter__(self): pass
1.120 + def __bool__(self): pass
1.121 +
1.122 +class long:
1.123 + def __init__(self, number_or_string=None): pass
1.124 + def __iadd__(self, other): pass
1.125 + def __isub__(self, other): pass
1.126 + def __add__(self, other): pass
1.127 + def __radd__(self, other): pass
1.128 + def __sub__(self, other): pass
1.129 + def __rsub__(self, other): pass
1.130 + def __mul__(self, other): pass
1.131 + def __rmul__(self, other): pass
1.132 + def __div__(self, other): pass
1.133 + def __rdiv__(self, other): pass
1.134 + def __floordiv__(self, other): pass
1.135 + def __rfloordiv__(self, other): pass
1.136 + def __and__(self, other): pass
1.137 + def __rand__(self, other): pass
1.138 + def __or__(self, other): pass
1.139 + def __ror__(self, other): pass
1.140 + def __xor__(self, other): pass
1.141 + def __rxor__(self, other): pass
1.142 + def __lt__(self, other): pass
1.143 + def __gt__(self, other): pass
1.144 + def __le__(self, other): pass
1.145 + def __ge__(self, other): pass
1.146 + def __eq__(self, other): pass
1.147 + def __ne__(self, other): pass
1.148 + def __neg__(self): pass
1.149 + def __pos__(self): pass
1.150 + def __str__(self): pass
1.151 + def __bool__(self): pass
1.152 +
1.153 +class none:
1.154 + def __bool__(self): pass
1.155 + def __str__(self): pass
1.156 +
1.157 +NoneType = none
1.158 +
1.159 +class slice:
1.160 + def __init__(self, start_or_end, end=None, step=None): pass
1.161 +
1.162 +class str:
1.163 + def __init__(self, x=None): pass
1.164 + def __getitem__(self, index): pass
1.165 + def __getslice__(self, start, end=None): pass
1.166 + def __iadd__(self, other): pass
1.167 + def __add__(self, other): pass
1.168 + def __radd__(self, other): pass
1.169 + def __mul__(self, other): pass
1.170 + def __radd__(self, other): pass
1.171 + def __mod__(self, other): pass
1.172 + def __lt__(self, other): pass
1.173 + def __gt__(self, other): pass
1.174 + def __le__(self, other): pass
1.175 + def __ge__(self, other): pass
1.176 + def __eq__(self, other): pass
1.177 + def __ne__(self, other): pass
1.178 + def __len__(self): pass
1.179 + def __str__(self): pass
1.180 + def __bool__(self): pass
1.181 + def join(self, l): pass
1.182 +
1.183 +class tuple:
1.184 + def __init__(self, args): pass
1.185 + def __getitem__(self, index): pass
1.186 + def __getslice__(self, start, end=None): pass
1.187 + def __len__(self): pass
1.188 + def __add__(self, other): pass
1.189 + def __str__(self): pass
1.190 + def __iter__(self): pass
1.191 + def __bool__(self): pass
1.192 +
1.193 +class xrange:
1.194 + def __init__(self, start_or_end, end=None, step=1): pass
1.195 + def __iter__(self): pass
1.196 + def next(self): pass
1.197 +
1.198 +class Exception:
1.199 + def __init__(self, *args): pass
1.200 +
1.201 +class AssertionError(Exception):
1.202 + pass
1.203 +
1.204 +class AttributeError(Exception):
1.205 + pass
1.206 +
1.207 +class IndexError(Exception):
1.208 + pass
1.209 +
1.210 +class StopIteration(Exception):
1.211 + pass
1.212 +
1.213 +class TypeError(Exception):
1.214 + pass
1.215 +
1.216 +class NotImplementedType:
1.217 + pass
1.218 +
1.219 +# General functions.
1.220 +
1.221 +def isinstance(obj, cls): pass
1.222 +def issubclass(cls1, cls2): pass
1.223 +def len(x): pass
1.224 +def max(*l): pass
1.225 +def range(start_or_end, end=None, step=None): pass
1.226 +
1.227 +# Special values.
1.228 +
1.229 +True = bool()
1.230 +False = bool()
1.231 +None = none()
1.232 +stdin = file()
1.233 +stdout = file()
1.234 +stderr = file()
1.235 +NotImplemented = NotImplementedType()
1.236 +
1.237 +# vim: tabstop=4 expandtab shiftwidth=4