# HG changeset patch # User Paul Boddie # Date 1515975149 -3600 # Node ID ed27b57be1df986df30421fed164d850b38a6f49 # Parent be4f3575f6055179a6349954a34b355654f26169 Introduced parameter-based attribute initialisation for broader testing. diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/exception/base.py --- a/lib/__builtins__/exception/base.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/exception/base.py Mon Jan 15 01:12:29 2018 +0100 @@ -3,7 +3,7 @@ """ Base exception objects. See __builtins__.core for the core exceptions. -Copyright (C) 2015, 2016 Paul Boddie +Copyright (C) 2015, 2016, 2018 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 @@ -29,15 +29,21 @@ "An error condition involving an index." - def __init__(self, index): - self.index = index + def __init__(self, .index): + + "Initialise the exception with the given 'index'." + + pass class KeyError(LookupError): "An error concerned with a dictionary key." - def __init__(self, key): - self.key = key + def __init__(self, .key): + + "Initialise the exception with the given 'key'." + + pass class RuntimeError(Exception): @@ -49,8 +55,11 @@ "An error indicating an unimplemented function or method." - def __init__(self, name): - self.name = name + def __init__(self, .name): + + "Initialise the exception with the given 'name'." + + pass class StopIteration(Exception): @@ -62,7 +71,10 @@ "An error concerned with a particular value." - def __init__(self, value): - self.value = value + def __init__(self, .value): + + "Initialise the exception with the given 'value'." + + pass # vim: tabstop=4 expandtab shiftwidth=4 diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/exception/io.py --- a/lib/__builtins__/exception/io.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/exception/io.py Mon Jan 15 01:12:29 2018 +0100 @@ -3,7 +3,7 @@ """ Input/output exception objects. -Copyright (C) 2015, 2016, 2017 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018 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 @@ -29,11 +29,11 @@ "An input/output error." - def __init__(self, value): + def __init__(self, .value): "Initialise the exception with the given 'value'." - self.value = value + pass class KeyboardInterrupt(Exception): diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/exception/naming.py --- a/lib/__builtins__/exception/naming.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/exception/naming.py Mon Jan 15 01:12:29 2018 +0100 @@ -6,7 +6,7 @@ Errors regarding unrecognised names or import failures are not provided since these errors should occur during program compilation. -Copyright (C) 2015, 2016 Paul Boddie +Copyright (C) 2015, 2016, 2018 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 @@ -26,10 +26,10 @@ "An error indicating an invalid attribute for an object." - def __init__(self, name): + def __init__(self, .name): "Initialise the exception with the given 'name'." - self.name = name + pass # vim: tabstop=4 expandtab shiftwidth=4 diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/exception/system.py --- a/lib/__builtins__/exception/system.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/exception/system.py Mon Jan 15 01:12:29 2018 +0100 @@ -3,7 +3,7 @@ """ System exception objects. -Copyright (C) 2015, 2016, 2017 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018 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 @@ -29,12 +29,11 @@ "A general operating system error." - def __init__(self, value, arg): + def __init__(self, .value, .arg): "Initialise the exception with the given error 'value' and 'arg'." - self.value = value - self.arg = arg + pass def __str__(self): return str(buffer(["OSError(", repr(self.value), ", ", repr(self.arg), ")"])) @@ -51,7 +50,10 @@ "An exception exiting the program." - def __init__(self, value): - self.value = value + def __init__(self, .value): + + "Initialise the exception with the given 'value'." + + pass # vim: tabstop=4 expandtab shiftwidth=4 diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/exception/unicode.py --- a/lib/__builtins__/exception/unicode.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/exception/unicode.py Mon Jan 15 01:12:29 2018 +0100 @@ -3,7 +3,7 @@ """ Unicode exception objects. -Copyright (C) 2015, 2016, 2017 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018 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 @@ -32,14 +32,14 @@ a character encoding. """ - def __init__(self, value): + def __init__(self, .value): """ Initialise an exception with a 'value' providing the illegal byte sequence responsible for the error. """ - self.value = value + pass class UnicodeEncodeError(UnicodeError): pass class UnicodeTranslateError(UnicodeError): pass diff -r be4f3575f605 -r ed27b57be1df lib/__builtins__/span.py --- a/lib/__builtins__/span.py Mon Jan 08 01:15:11 2018 +0100 +++ b/lib/__builtins__/span.py Mon Jan 15 01:12:29 2018 +0100 @@ -3,7 +3,7 @@ """ Span-related objects. -Copyright (C) 2015, 2016, 2017 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018 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 @@ -90,13 +90,11 @@ "An iterator over an xrange." - def __init__(self, start, step, count): + def __init__(self, start, .step, .count): - "Initialise the iterator with the given 'obj'." + "Initialise the iterator with the given 'start', 'step' and 'count'." self.current = start - self.step = step - self.count = count def next(self):