1.1 --- a/lib/__builtins__/attribute.py Thu Jan 12 21:37:43 2017 +0100
1.2 +++ b/lib/__builtins__/attribute.py Thu Jan 12 21:38:38 2017 +0100
1.3 @@ -70,6 +70,7 @@
1.4 # NOTE: setattr would probably only be supported on instances due to deductions
1.5 # NOTE: applying to static objects being undermined by dynamic modifications.
1.6
1.7 -def setattr(obj, name, value): pass
1.8 +def setattr(obj, name, value):
1.9 + raise NotImplementedError, "setattr"
1.10
1.11 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/lib/__builtins__/exception/base.py Thu Jan 12 21:37:43 2017 +0100
2.2 +++ b/lib/__builtins__/exception/base.py Thu Jan 12 21:38:38 2017 +0100
2.3 @@ -33,8 +33,18 @@
2.4 def __init__(self, key):
2.5 self.key = key
2.6
2.7 -class NotImplementedError(Exception): pass
2.8 -class StopIteration(Exception): pass
2.9 +class NotImplementedError(Exception):
2.10 +
2.11 + "An error indicating an unimplemented function or method."
2.12 +
2.13 + def __init__(self, name):
2.14 + self.name = name
2.15 +
2.16 +class StopIteration(Exception):
2.17 +
2.18 + "An exception signalling the end of iteration."
2.19 +
2.20 + pass
2.21
2.22 class ValueError(Exception):
2.23
3.1 --- a/tests/getattr.py Thu Jan 12 21:37:43 2017 +0100
3.2 +++ b/tests/getattr.py Thu Jan 12 21:38:38 2017 +0100
3.3 @@ -36,3 +36,8 @@
3.4 print "", v
3.5 except AttributeError:
3.6 print " ?"
3.7 +
3.8 +try:
3.9 + setattr(c, "x", 7)
3.10 +except NotImplementedError, exc:
3.11 + print 'setattr(c, "x", 7): not implemented:', exc.name