1.1 --- a/lib/builtins.py Mon Mar 31 00:54:03 2008 +0200
1.2 +++ b/lib/builtins.py Sun Apr 06 02:53:43 2008 +0200
1.3 @@ -24,24 +24,48 @@
1.4 def __bool__(self): pass
1.5 def __iadd__(self, other): pass
1.6
1.7 -class bool:
1.8 +class basestring(object):
1.9 + def __init__(self, x=None): pass
1.10 + def __getitem__(self, index): pass
1.11 + def __getslice__(self, start, end=None): pass
1.12 + def __iadd__(self, other): pass
1.13 + def __add__(self, other): pass
1.14 + def __radd__(self, other): pass
1.15 + def __mul__(self, other): pass
1.16 + def __radd__(self, other): pass
1.17 + def __mod__(self, other): pass
1.18 + def __lt__(self, other): pass
1.19 + def __gt__(self, other): pass
1.20 + def __le__(self, other): pass
1.21 + def __ge__(self, other): pass
1.22 + def __eq__(self, other): pass
1.23 + def __ne__(self, other): pass
1.24 + def __len__(self): pass
1.25 + def __str__(self): pass
1.26 + def __bool__(self): pass
1.27 + def join(self, l): pass
1.28 +
1.29 +class bool(object):
1.30 def __bool__(self): pass
1.31 def __str__(self): pass
1.32
1.33 -class buffer:
1.34 +class buffer(object):
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 +class complex(object):
1.41 + def __init__(self, real, imag=None): pass
1.42 +
1.43 +class dict(object):
1.44 def __init__(self, *args): pass
1.45 def __setitem__(self, key, value): pass
1.46 def __getitem__(self, key): pass
1.47
1.48 -class file:
1.49 +class file(object):
1.50 def write(self, s): pass
1.51
1.52 -class float:
1.53 +class float(object):
1.54 def __init__(self, number_or_string=None): pass
1.55 def __iadd__(self, other): pass
1.56 def __isub__(self, other): pass
1.57 @@ -69,7 +93,10 @@
1.58 def __str__(self): pass
1.59 def __bool__(self): pass
1.60
1.61 -class int:
1.62 +class frozenset(object):
1.63 + def __init__(self, iterable): pass
1.64 +
1.65 +class int(object):
1.66 def __init__(self, number_or_string=None): pass
1.67 def __iadd__(self, other): pass
1.68 def __isub__(self, other): pass
1.69 @@ -102,7 +129,7 @@
1.70 def __str__(self): pass
1.71 def __bool__(self): pass
1.72
1.73 -class list:
1.74 +class list(object):
1.75 def __init__(self, args=()): pass
1.76 def __getitem__(self, index): pass
1.77 def __setitem__(self, index, value): pass
1.78 @@ -116,7 +143,7 @@
1.79 def __iter__(self): pass
1.80 def __bool__(self): pass
1.81
1.82 -class long:
1.83 +class long(object):
1.84 def __init__(self, number_or_string=None): pass
1.85 def __iadd__(self, other): pass
1.86 def __isub__(self, other): pass
1.87 @@ -147,37 +174,19 @@
1.88 def __str__(self): pass
1.89 def __bool__(self): pass
1.90
1.91 -class none:
1.92 - def __bool__(self): pass
1.93 - def __str__(self): pass
1.94 +class set(object):
1.95 + def __init__(self, iterable): pass
1.96
1.97 -NoneType = none
1.98 -
1.99 -class slice:
1.100 +class slice(object):
1.101 def __init__(self, start_or_end, end=None, step=None): pass
1.102
1.103 -class str:
1.104 - def __init__(self, x=None): pass
1.105 - def __getitem__(self, index): pass
1.106 - def __getslice__(self, start, end=None): pass
1.107 - def __iadd__(self, other): pass
1.108 - def __add__(self, other): pass
1.109 - def __radd__(self, other): pass
1.110 - def __mul__(self, other): pass
1.111 - def __radd__(self, other): pass
1.112 - def __mod__(self, other): pass
1.113 - def __lt__(self, other): pass
1.114 - def __gt__(self, other): pass
1.115 - def __le__(self, other): pass
1.116 - def __ge__(self, other): pass
1.117 - def __eq__(self, other): pass
1.118 - def __ne__(self, other): pass
1.119 - def __len__(self): pass
1.120 - def __str__(self): pass
1.121 - def __bool__(self): pass
1.122 - def join(self, l): pass
1.123 +class str(basestring):
1.124 + pass
1.125
1.126 -class tuple:
1.127 +class type(object):
1.128 + pass
1.129 +
1.130 +class tuple(object):
1.131 def __init__(self, args): pass
1.132 def __getitem__(self, index): pass
1.133 def __getslice__(self, start, end=None): pass
1.134 @@ -187,48 +196,141 @@
1.135 def __iter__(self): pass
1.136 def __bool__(self): pass
1.137
1.138 -class xrange:
1.139 +class unicode(basestring):
1.140 + pass
1.141 +
1.142 +class xrange(object):
1.143 def __init__(self, start_or_end, end=None, step=1): pass
1.144 def __iter__(self): pass
1.145 def next(self): pass
1.146
1.147 -class Exception:
1.148 +# Exceptions and warnings.
1.149 +
1.150 +class BaseException(object):
1.151 def __init__(self, *args): pass
1.152
1.153 -class AssertionError(Exception):
1.154 - pass
1.155 -
1.156 -class AttributeError(Exception):
1.157 - pass
1.158 -
1.159 -class IndexError(Exception):
1.160 - pass
1.161 -
1.162 -class StopIteration(Exception):
1.163 - pass
1.164 +class Exception(BaseException): pass
1.165 +class Warning(object): pass
1.166
1.167 -class TypeError(Exception):
1.168 - pass
1.169 -
1.170 -class NotImplementedType:
1.171 - pass
1.172 +class ArithmeticError(Exception): pass
1.173 +class AssertionError(Exception): pass
1.174 +class AttributeError(Exception): pass
1.175 +class DeprecationWarning(Exception): pass
1.176 +class EOFError(Exception): pass
1.177 +class EnvironmentError(Exception): pass
1.178 +class FloatingPointError(Exception): pass
1.179 +class FutureWarning(Warning): pass
1.180 +class GeneratorExit(Exception): pass
1.181 +class IndexError(Exception): pass
1.182 +class IOError(Exception): pass
1.183 +class ImportError(Exception): pass
1.184 +class ImportWarning(Warning): pass
1.185 +class IndentationError(Exception): pass
1.186 +class IndexError(Exception): pass
1.187 +class KeyError(Exception): pass
1.188 +class KeyboardInterrupt(Exception): pass
1.189 +class LookupError(Exception): pass
1.190 +class MemoryError(Exception): pass
1.191 +class NameError(Exception): pass
1.192 +class NotImplementedError(Exception): pass
1.193 +class OSError(Exception): pass
1.194 +class OverflowError(Exception): pass
1.195 +class PendingDeprecationWarning(Warning): pass
1.196 +class ReferenceError(Exception): pass
1.197 +class RuntimeError(Exception): pass
1.198 +class RuntimeWarning(Warning): pass
1.199 +class StandardError(Exception): pass
1.200 +class StopIteration(Exception): pass
1.201 +class SyntaxError(Exception): pass
1.202 +class SyntaxWarning(Warning): pass
1.203 +class SystemError(Exception): pass
1.204 +class SystemExit(Exception): pass
1.205 +class TabError(Exception): pass
1.206 +class TypeError(Exception): pass
1.207 +class UnboundLocalError(Exception): pass
1.208 +class UnicodeDecodeError(Exception): pass
1.209 +class UnicodeEncodeError(Exception): pass
1.210 +class UnicodeError(Exception): pass
1.211 +class UnicodeTranslateError(Exception): pass
1.212 +class UnicodeWarning(Warning): pass
1.213 +class UserWarning(Warning): pass
1.214 +class ValueError(Exception): pass
1.215 +class ZeroDivisionError(Exception): pass
1.216
1.217 -# General functions.
1.218 +# Various types.
1.219 +
1.220 +class EllipsisType(object): pass
1.221
1.222 -def isinstance(obj, cls): pass
1.223 -def issubclass(cls1, cls2): pass
1.224 -def len(x): pass
1.225 -def max(*l): pass
1.226 -def range(start_or_end, end=None, step=None): pass
1.227 +class NoneType(object):
1.228 + def __bool__(self): pass
1.229 + def __str__(self): pass
1.230 +
1.231 +class NotImplementedType: pass
1.232
1.233 # Special values.
1.234
1.235 True = bool()
1.236 False = bool()
1.237 None = none()
1.238 -stdin = file()
1.239 -stdout = file()
1.240 -stderr = file()
1.241 +Ellipsis = ellipsis()
1.242 NotImplemented = NotImplementedType()
1.243
1.244 +# General functions.
1.245 +# NOTE: Some of these are actually provided by classes in CPython.
1.246 +# NOTE: We may refuse to support some of these in practice, such as...
1.247 +# NOTE: super, reload.
1.248 +
1.249 +def __import__(name, globals=None, locals=None, fromlist=None, level=-1): pass
1.250 +def abs(number): pass
1.251 +def all(iterable): pass
1.252 +def any(iterable): pass
1.253 +def callable(obj): pass
1.254 +def chr(i): pass
1.255 +def classmethod(function): pass
1.256 +def cmp(x, y): pass
1.257 +def compile(source, filename, mode, flags=None, dont_inherit=None): pass
1.258 +def delattr(obj, name): pass
1.259 +def dir(obj=None): pass
1.260 +def divmod(x, y): pass
1.261 +def enumerate(iterable): pass
1.262 +def eval(source, globals=None, locals=None): pass
1.263 +def execfile(filename, globals=None, locals=None): pass
1.264 +def filter(function, sequence): pass
1.265 +def getattr(obj, name, default=None): pass
1.266 +def globals(): pass
1.267 +def hasattr(obj, name): pass
1.268 +def hash(obj): pass
1.269 +def help(*args, **kw): pass
1.270 +def hex(number): pass
1.271 +def id(obj): pass
1.272 +def input(prompt=None): pass
1.273 +def isinstance(obj, cls_or_tuple): pass
1.274 +def issubclass(obj, cls_or_tuple): pass
1.275 +def iter(collection_or_callable, sentinel=None): pass
1.276 +def len(obj): pass
1.277 +def locals(): pass
1.278 +def map(function, *args): pass
1.279 +def max(*args, **kw): pass
1.280 +def min(*args, **kw): pass
1.281 +def oct(number): pass
1.282 +def open(name, mode=None, buffering=None): pass
1.283 +def ord(c): pass
1.284 +def pow(x, y, z=None): pass
1.285 +def property(fget=None, fset=None, fdel=None, doc=None): pass
1.286 +def range(start_or_end, end=None, step=None): pass
1.287 +def raw_input(prompt=None): pass
1.288 +def reduce(function, sequence, initial=None): pass
1.289 +def reload(module): pass
1.290 +def repr(obj): pass
1.291 +def reversed(sequence): pass
1.292 +def round(number, ndigits=None): pass
1.293 +def setattr(obj, name, value): pass
1.294 +def sorted(iterable, cmp=None, key=None, reverse=False): pass
1.295 +def staticmethod(function): pass
1.296 +def sum(sequence, start=0): pass
1.297 +def super(*args): pass
1.298 +def unichr(i): pass
1.299 +def vars(obj=None): pass
1.300 +def zip(*args): pass
1.301 +
1.302 # vim: tabstop=4 expandtab shiftwidth=4