# HG changeset patch # User Paul Boddie # Date 1490731931 -7200 # Node ID 78554ece62b2c362f6766b6a776ce2fa4b2fd1de # Parent 7cfb3ba084601dc7275972e2d6d993ec919b2cd0 Changed various instance tests to use the special integer-testing function. diff -r 7cfb3ba08460 -r 78554ece62b2 lib/__builtins__/int.py --- a/lib/__builtins__/int.py Sun Mar 26 18:03:40 2017 +0200 +++ b/lib/__builtins__/int.py Tue Mar 28 22:12:11 2017 +0200 @@ -21,7 +21,7 @@ from __builtins__.operator import _negate from __builtins__.unicode import utf8string -from native import isinstance as _isinstance, get_maxint, get_minint, \ +from native import get_maxint, get_minint, is_int, \ int_add, int_and, int_div, int_eq, int_gt, int_lt, int_mod, \ int_mul, int_ne, int_neg, int_not, int_or, int_pow, \ int_str, int_sub, int_xor @@ -48,7 +48,7 @@ "Perform 'op' on this int and 'other' if appropriate." - if _isinstance(other, int): + if is_int(other): return op(self, other) else: return NotImplemented @@ -57,7 +57,7 @@ "Perform 'op' on 'other' and this int if appropriate." - if _isinstance(other, int): + if is_int(other): return op(other, self) else: return NotImplemented diff -r 7cfb3ba08460 -r 78554ece62b2 lib/__builtins__/mapping.py --- a/lib/__builtins__/mapping.py Sun Mar 26 18:03:40 2017 +0200 +++ b/lib/__builtins__/mapping.py Tue Mar 28 22:12:11 2017 +0200 @@ -20,7 +20,7 @@ """ from __builtins__.span import _max -from native import isinstance as _isinstance +from native import is_int class hashtable: @@ -66,7 +66,7 @@ index = key.__hash__() - if not _isinstance(index, int): + if not is_int(index): raise TypeError return index % len(self.buckets) diff -r 7cfb3ba08460 -r 78554ece62b2 lib/__builtins__/types.py --- a/lib/__builtins__/types.py Sun Mar 26 18:03:40 2017 +0200 +++ b/lib/__builtins__/types.py Tue Mar 28 22:12:11 2017 +0200 @@ -3,7 +3,7 @@ """ Common type validation functions. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 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 @@ -19,13 +19,13 @@ this program. If not, see . """ -from native import isinstance as _isinstance +from native import isinstance as _isinstance, is_int def check_int(i): "Check the given int 'i'." - if not _isinstance(i, int): + if not is_int(i): raise ValueError(i) def check_string(s): diff -r 7cfb3ba08460 -r 78554ece62b2 lib/posix/iconv.py --- a/lib/posix/iconv.py Sun Mar 26 18:03:40 2017 +0200 +++ b/lib/posix/iconv.py Tue Mar 28 22:12:11 2017 +0200 @@ -3,7 +3,7 @@ """ POSIX character set conversion functions. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 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 @@ -19,7 +19,7 @@ this program. If not, see . """ -from __builtins__.types import check_int, check_string +from __builtins__.types import check_string from native import iconv, iconv_close, iconv_open, iconv_reset class IncompleteSequenceError(OSError):