Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ed5fba2a
Commit
ed5fba2a
authored
Feb 22, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#17035: use new style classes in classmethod/staticmethod examples. Patch by Berker Peksag.
parent
13cee169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Doc/library/functions.rst
Doc/library/functions.rst
+6
-4
No files found.
Doc/library/functions.rst
View file @
ed5fba2a
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment