1 #!/usr/bin/env python 2 3 """ 4 Simple built-in classes and functions. 5 6 Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk> 7 8 This program is free software; you can redistribute it and/or modify it under 9 the terms of the GNU General Public License as published by the Free Software 10 Foundation; either version 3 of the License, or (at your option) any later 11 version. 12 13 This program is distributed in the hope that it will be useful, but WITHOUT 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 details. 17 18 You should have received a copy of the GNU General Public License along with 19 this program. If not, see <http://www.gnu.org/licenses/>. 20 """ 21 22 from __builtins__.core import function, get_using, object, type, \ 23 BaseException, Exception, TypeError, \ 24 UnboundMethodInvocation, Warning 25 26 # Exceptions. 27 28 from __builtins__.exception import ( 29 ArithmeticError, 30 AssertionError, 31 AttributeError, 32 DeprecationWarning, 33 EOFError, 34 EnvironmentError, 35 FloatingPointError, 36 FutureWarning, 37 GeneratorExit, 38 ImportError, 39 ImportWarning, 40 IndentationError, 41 IndexError, 42 IOError, 43 KeyError, 44 KeyboardInterrupt, 45 LookupError, 46 MemoryError, 47 NameError, 48 NotImplementedError, 49 OSError, 50 OverflowError, 51 PendingDeprecationWarning, 52 ReferenceError, 53 RuntimeError, 54 RuntimeWarning, 55 StandardError, 56 StopIteration, 57 SyntaxError, 58 SyntaxWarning, 59 SystemError, 60 SystemExit, 61 TabError, 62 UnboundLocalError, 63 UnicodeDecodeError, 64 UnicodeEncodeError, 65 UnicodeError, 66 UnicodeTranslateError, 67 UnicodeWarning, 68 UserWarning, 69 ValueError, 70 ZeroDivisionError 71 ) 72 73 74 # Classes. 75 76 from __builtins__.boolean import bool, False, True 77 from __builtins__.buffer import buffer 78 from __builtins__.complex import complex 79 from __builtins__.dict import dict 80 from __builtins__.file import file 81 from __builtins__.float import float 82 from __builtins__.int import int 83 from __builtins__.span import xrange, slice 84 from __builtins__.iterator import listiterator 85 from __builtins__.list import list 86 from __builtins__.long import long 87 from __builtins__.none import None, NoneType 88 from __builtins__.notimplemented import NotImplemented, NotImplementedType 89 from __builtins__.set import frozenset, set 90 from __builtins__.str import basestring, str, string, unicode 91 from __builtins__.tuple import tuple 92 93 # Functions. 94 95 from __builtins__.attribute import getattr, hasattr, setattr 96 from __builtins__.character import chr, hex, oct, ord, unichr 97 from __builtins__.comparable import cmp, hash 98 from __builtins__.identity import callable, help, id, isinstance, issubclass, repr 99 from __builtins__.io import open, raw_input, print_, sysfile 100 from __builtins__.iterable import all, any, enumerate, filter, iter, len, map, max, min, range, reduce, reversed, sorted, sum, zip 101 from __builtins__.namespace import dir, globals, locals, vars 102 from __builtins__.numeric import abs, divmod, pow, round 103 104 # vim: tabstop=4 expandtab shiftwidth=4