Lichen

lib/__builtins__/__init__.py

938:799711337453
5 months ago Paul Boddie Renamed the string class to str, replacing the str function with the new_str function, this being invoked specially by the string instantiation function. As with the Unicode type renaming, a more general instantiation mechanism might permit the new_str function to be part of the functionality of the str or basestring classes.
     1 #!/usr/bin/env python     2      3 """     4 Simple built-in classes and functions.     5      6 Copyright (C) 2015, 2016, 2017, 2019, 2021 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     )    55     56 # Classes.    57     58 from __builtins__.boolean import bool, False, True    59 from __builtins__.buffer import buffer    60 from __builtins__.complex import complex    61 from __builtins__.dict import dict    62 from __builtins__.file import file    63 from __builtins__.float import float    64 from __builtins__.int import int    65 from __builtins__.span import range, slice, xrange    66 from __builtins__.list import list    67 from __builtins__.long import long    68 from __builtins__.none import None, NoneType    69 from __builtins__.notimplemented import NotImplemented, NotImplementedType    70 from __builtins__.set import frozenset, set    71 from __builtins__.str import basestring, str    72 from __builtins__.tuple import tuple    73 from __builtins__.unicode import unicode    74     75 # Functions.    76     77 from __builtins__.attribute import getattr, hasattr, setattr    78 from __builtins__.character import bin, chr, hex, oct, ord, unichr    79 from __builtins__.comparable import cmp, hash    80 from __builtins__.identity import callable, id, isinstance, issubclass, repr    81 from __builtins__.io import open, raw_input, print_    82 from __builtins__.iteration import all, any, enumerate, filter, iter, len, map, max, min, reduce, reversed, sorted, sum, zip    83 from __builtins__.namespace import dir, globals, locals, vars    84 from __builtins__.numeric import abs, divmod, pow, round    85     86 # vim: tabstop=4 expandtab shiftwidth=4