1 #!/usr/bin/env python 2 3 """ 4 Simple built-in classes and functions. 5 6 Copyright (C) 2015-2017, 2019, 2021, 2023 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 ( 23 function, get_using, module, object, type, 24 ArithmeticError, Exception, FloatingPointError, MemoryError, OverflowError, 25 TypeError, UnboundMethodInvocation, ZeroDivisionError 26 ) 27 28 # Exceptions. 29 30 from __builtins__.exception import ( 31 AssertionError, 32 AttributeError, 33 EOFError, 34 EnvironmentError, 35 IndentationError, 36 IndexError, 37 IOError, 38 LoopExit, 39 KeyError, 40 KeyboardInterrupt, 41 NotImplementedError, 42 OSError, 43 RuntimeError, 44 StopIteration, 45 SyntaxError, 46 SystemError, 47 SystemExit, 48 TabError, 49 UnicodeDecodeError, 50 UnicodeEncodeError, 51 UnicodeError, 52 UnicodeTranslateError, 53 ValueError, 54 __loop_exit 55 ) 56 57 # Classes. 58 59 from __builtins__.boolean import bool, False, True 60 from __builtins__.buffer import buffer 61 from __builtins__.complex import complex 62 from __builtins__.dict import dict 63 from __builtins__.file import file 64 from __builtins__.float import float 65 from __builtins__.int import int 66 from __builtins__.span import range, slice, xrange 67 from __builtins__.list import list 68 from __builtins__.long import long 69 from __builtins__.none import None, NoneType 70 from __builtins__.notimplemented import NotImplemented, NotImplementedType 71 from __builtins__.set import frozenset, set 72 from __builtins__.str import basestring, str 73 from __builtins__.tuple import tuple 74 from __builtins__.unicode import unicode 75 76 # Functions. 77 78 from __builtins__.attribute import getattr, hasattr, setattr 79 from __builtins__.character import bin, chr, hex, oct, ord, unichr 80 from __builtins__.comparable import cmp, hash 81 from __builtins__.identity import callable, id, isinstance, issubclass, repr 82 from __builtins__.io import open, raw_input, print_ 83 from __builtins__.iteration import all, any, enumerate, filter, iter, len, map, max, min, reduce, reversed, sorted, sum, zip 84 from __builtins__.namespace import dir, globals, locals, vars 85 from __builtins__.numeric import abs, divmod, pow, round 86 87 # vim: tabstop=4 expandtab shiftwidth=4