From ed5fba2ad9f5cf6d48a127b1d3cfe677390bb24f Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Fri, 22 Feb 2013 07:34:52 +0200 Subject: [PATCH] #17035: use new style classes in classmethod/staticmethod examples. Patch by Berker Peksag. --- Doc/library/functions.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index ec3b1d67a29..34ef83146a2 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -162,9 +162,10 @@ available. They are listed here in alphabetical order. instance method receives the instance. To declare a class method, use this idiom:: - class C: + class C(object): @classmethod - def f(cls, arg1, arg2, ...): ... + def f(cls, arg1, arg2, ...): + ... The ``@classmethod`` form is a function :term:`decorator` -- see the description of function definitions in :ref:`function` for details. @@ -1303,9 +1304,10 @@ available. They are listed here in alphabetical order. A static method does not receive an implicit first argument. To declare a static method, use this idiom:: - class C: + class C(object): @staticmethod - def f(arg1, arg2, ...): ... + def f(arg1, arg2, ...): + ... The ``@staticmethod`` form is a function :term:`decorator` -- see the description of function definitions in :ref:`function` for details.