]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use decorators.
authorGuido van Rossum <guido@python.org>
Sun, 16 Jan 2005 00:21:28 +0000 (00:21 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 16 Jan 2005 00:21:28 +0000 (00:21 +0000)
Lib/test/test_builtin.py

index 51ef7c64191b69b6a2d9221b79ee92cf5bfa8bf3..5aa919732784fb42197b27a3971509551959db6d 100644 (file)
@@ -1274,17 +1274,18 @@ class BuiltinTest(unittest.TestCase):
             self.assertRaises(ValueError, unichr, sys.maxunicode+1)
             self.assertRaises(TypeError, unichr)
 
+    # We don't want self in vars(), so these are static methods
+
+    @staticmethod
     def get_vars_f0():
         return vars()
-    # we don't want self in vars(), so use staticmethod
-    get_vars_f0 = staticmethod(get_vars_f0)
 
+    @staticmethod
     def get_vars_f2():
         BuiltinTest.get_vars_f0()
         a = 1
         b = 2
         return vars()
-    get_vars_f2 = staticmethod(get_vars_f2)
 
     def test_vars(self):
         self.assertEqual(set(vars()), set(dir()))