# HG changeset patch # User Paul Boddie # Date 1472935043 -7200 # Node ID 3245748d9431b43b722e562509c15ce1db21a4dc # Parent a0227cd53a7dc5ebd90e921d47c994e0561aafea Removed ellipsis and property support, renamed string to str for consistency. diff -r a0227cd53a7d -r 3245748d9431 lib/__builtins__/__init__.py --- a/lib/__builtins__/__init__.py Thu Sep 01 23:05:46 2016 +0200 +++ b/lib/__builtins__/__init__.py Sat Sep 03 22:37:23 2016 +0200 @@ -76,7 +76,6 @@ from __builtins__.buffer import buffer from __builtins__.complex import complex from __builtins__.dict import dict -from __builtins__.ellipsis import ellipsis from __builtins__.file import file from __builtins__.float import float from __builtins__.int import int @@ -86,9 +85,8 @@ from __builtins__.long import long from __builtins__.none import NoneType from __builtins__.notimplemented import NotImplementedType -from __builtins__.property import property from __builtins__.set import frozenset, set -from __builtins__.string import basestring, str, unicode +from __builtins__.str import basestring, str, unicode from __builtins__.tuple import tuple # Functions. diff -r a0227cd53a7d -r 3245748d9431 lib/__builtins__/ellipsis.py --- a/lib/__builtins__/ellipsis.py Thu Sep 01 23:05:46 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -""" -Ellipsis object. - -Copyright (C) 2015 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 3 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program. If not, see . -""" - -class ellipsis: pass - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a0227cd53a7d -r 3245748d9431 lib/__builtins__/property.py --- a/lib/__builtins__/property.py Thu Sep 01 23:05:46 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -""" -Property objects. - -Copyright (C) 2015 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 3 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program. If not, see . -""" - -class property(object): - def __init__(fget=None, fset=None, fdel=None, doc=None): pass - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a0227cd53a7d -r 3245748d9431 lib/__builtins__/str.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/__builtins__/str.py Sat Sep 03 22:37:23 2016 +0200 @@ -0,0 +1,108 @@ +#!/usr/bin/env python + +""" +String objects. + +Copyright (C) 2015, 2016 Paul Boddie + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +""" + +from __builtins__.iterator import listiterator +from __builtins__.operator import _binary_op, _negate +import native + +class basestring(object): + def __init__(self, data=None): + # Note member. + self.data = data + + def __contains__(self, value): pass + + def __getitem__(self, index): + # Note usage. + IndexError + + def __getslice__(self, start, end=None): pass + + def __iadd__(self, other): + "Return a new string for the operation." + return _binary_op(self, other, native._str_add) + + __add__ = __radd__ = __iadd__ + + def __mul__(self, other): pass + def __rmul__(self, other): pass + def __mod__(self, other): pass + def __rmod__(self, other): pass + + def __lt__(self, other): + "Return a new boolean for the comparison." + return _binary_op(self, other, native._str_lt) + + def __gt__(self, other): + "Return a new boolean for the comparison." + return _binary_op(self, other, native._str_gt) + + def __le__(self, other): + "Return a new boolean for the comparison." + return _negate(self.__gt__(other)) + + def __ge__(self, other): + "Return a new boolean for the comparison." + return _negate(self.__lt__(other)) + + def __eq__(self, other): + "Return a new boolean for the comparison." + return _binary_op(self, other, native._str_eq) + + def __ne__(self, other): + "Return a new boolean for the comparison." + return _negate(self.__eq__(other)) + + def __len__(self): pass + def __str__(self): pass + + def __bool__(self): + return _negate(native._str_eq(self, "")) + + def endswith(self, s): pass + def find(self, sub, start=None, end=None): pass + def index(self, sub, start=None, end=None): pass + def join(self, l): pass + def lower(self): pass + def lstrip(self, chars=None): pass + def replace(self, old, new, count=None): pass + def rfind(self, sub, start=None, end=None): pass + def rsplit(self, sep=None, maxsplit=None): pass + def rstrip(self, chars=None): pass + def split(self, sep=None, maxsplit=None): pass + def splitlines(self, keepends=False): pass + def startswith(self, s): pass + def strip(self, chars=None): pass + def upper(self): pass + + def __iter__(self): + + "Return an iterator." + + return listiterator(self) + +class str(basestring): + pass + +class unicode(basestring): + def encode(self, encoding): pass + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r a0227cd53a7d -r 3245748d9431 lib/__builtins__/string.py --- a/lib/__builtins__/string.py Thu Sep 01 23:05:46 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -#!/usr/bin/env python - -""" -String objects. - -Copyright (C) 2015, 2016 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 3 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program. If not, see . -""" - -from __builtins__.iterator import listiterator -from __builtins__.operator import _binary_op, _negate -import native - -class basestring(object): - def __init__(self, data=None): - # Note member. - self.data = data - - def __contains__(self, value): pass - - def __getitem__(self, index): - # Note usage. - IndexError - - def __getslice__(self, start, end=None): pass - - def __iadd__(self, other): - "Return a new string for the operation." - return _binary_op(self, other, native._str_add) - - __add__ = __radd__ = __iadd__ - - def __mul__(self, other): pass - def __rmul__(self, other): pass - def __mod__(self, other): pass - def __rmod__(self, other): pass - - def __lt__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._str_lt) - - def __gt__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._str_gt) - - def __le__(self, other): - "Return a new boolean for the comparison." - return _negate(self.__gt__(other)) - - def __ge__(self, other): - "Return a new boolean for the comparison." - return _negate(self.__lt__(other)) - - def __eq__(self, other): - "Return a new boolean for the comparison." - return _binary_op(self, other, native._str_eq) - - def __ne__(self, other): - "Return a new boolean for the comparison." - return _negate(self.__eq__(other)) - - def __len__(self): pass - def __str__(self): pass - - def __bool__(self): - return _negate(native._str_eq(self, "")) - - def endswith(self, s): pass - def find(self, sub, start=None, end=None): pass - def index(self, sub, start=None, end=None): pass - def join(self, l): pass - def lower(self): pass - def lstrip(self, chars=None): pass - def replace(self, old, new, count=None): pass - def rfind(self, sub, start=None, end=None): pass - def rsplit(self, sep=None, maxsplit=None): pass - def rstrip(self, chars=None): pass - def split(self, sep=None, maxsplit=None): pass - def splitlines(self, keepends=False): pass - def startswith(self, s): pass - def strip(self, chars=None): pass - def upper(self): pass - - def __iter__(self): - - "Return an iterator." - - return listiterator(self) - -class str(basestring): - pass - -class unicode(basestring): - def encode(self, encoding): pass - -# vim: tabstop=4 expandtab shiftwidth=4