From 89d89c743418b95b2440961ad6caa4bad8f79c13 Mon Sep 17 00:00:00 2001 From: Pierre-Yves David Date: Wed, 25 Nov 2009 19:07:53 +0100 Subject: [PATCH] add testcase for #9334 --- test/input/func_noerror_class_attributes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/input/func_noerror_class_attributes.py diff --git a/test/input/func_noerror_class_attributes.py b/test/input/func_noerror_class_attributes.py new file mode 100644 index 000000000..bb4ec6d6a --- /dev/null +++ b/test/input/func_noerror_class_attributes.py @@ -0,0 +1,17 @@ +"""Test that valide class attribut doesn't trigger errors""" +__revision__ = 'sponge bob' + +class Clazz(object): + "dummy class" + + def __init__(self): + self.topic = 5 + self._data = 45 + + def change_type(self, new_class): + """Change type""" + self.__class__ = new_class + + def do_nothing(self): + "I do nothing useful" + return self.topic + 56