Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
205dd4e1
Kaydet (Commit)
205dd4e1
authored
Eki 12, 2017
tarafından
Miss Islington (bot)
Kaydeden (comit)
Éric Araujo
Eki 12, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.6] bpo-31567: add or fix decorator markup in docs (GH-3959) (GH-3966)
(cherry picked from commit
0e61e67a
)
üst
5f908005
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
15 deletions
+24
-15
abc.rst
Doc/library/abc.rst
+1
-1
functions.rst
Doc/library/functions.rst
+15
-6
functools.rst
Doc/library/functools.rst
+2
-2
test.rst
Doc/library/test.rst
+1
-1
typing.rst
Doc/library/typing.rst
+3
-3
test_typing.py
Lib/test/test_typing.py
+2
-2
No files found.
Doc/library/abc.rst
Dosyayı görüntüle @
205dd4e1
...
@@ -278,7 +278,7 @@ The :mod:`abc` module also provides the following decorators:
...
@@ -278,7 +278,7 @@ The :mod:`abc` module also provides the following decorators:
:func:`abstractmethod`, making this decorator redundant.
:func:`abstractmethod`, making this decorator redundant.
.. decorator:: abstractproperty
(fget=None, fset=None, fdel=None, doc=None)
.. decorator:: abstractproperty
A subclass of the built-in :func:`property`, indicating an abstract
A subclass of the built-in :func:`property`, indicating an abstract
property.
property.
...
...
Doc/library/functions.rst
Dosyayı görüntüle @
205dd4e1
...
@@ -182,9 +182,9 @@ are always available. They are listed here in alphabetical order.
...
@@ -182,9 +182,9 @@ are always available. They are listed here in alphabetical order.
base 16). :exc:`ValueError` will be raised if *i* is outside that range.
base 16). :exc:`ValueError` will be raised if *i* is outside that range.
..
function:: classmethod(function)
..
decorator:: classmethod
Return a class method for *function*
.
Transform a method into a class method
.
A class method receives the class as implicit first argument, just like an
A class method receives the class as implicit first argument, just like an
instance method receives the instance. To declare a class method, use this
instance method receives the instance. To declare a class method, use this
...
@@ -1384,9 +1384,9 @@ are always available. They are listed here in alphabetical order.
...
@@ -1384,9 +1384,9 @@ are always available. They are listed here in alphabetical order.
For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
..
function:: staticmethod(function)
..
decorator:: staticmethod
Return a static method for *function*
.
Transform a method into a static method
.
A static method does not receive an implicit first argument. To declare a static
A static method does not receive an implicit first argument. To declare a static
method, use this idiom::
method, use this idiom::
...
@@ -1405,12 +1405,21 @@ are always available. They are listed here in alphabetical order.
...
@@ -1405,12 +1405,21 @@ are always available. They are listed here in alphabetical order.
:func:`classmethod` for a variant that is useful for creating alternate class
:func:`classmethod` for a variant that is useful for creating alternate class
constructors.
constructors.
Like all decorators, it is also possible to call ``staticmethod`` as
a regular function and do something with its result. This is needed
in some cases where you need a reference to a function from a class
body and you want to avoid the automatic transformation to instance
method. For these cases, use this idiom:
class C:
builtin_open = staticmethod(open)
For more information on static methods, consult the documentation on the
For more information on static methods, consult the documentation on the
standard type hierarchy in :ref:`types`.
standard type hierarchy in :ref:`types`.
.. index::
single: string; str() (built-in function)
.. index::
single: string; str() (built-in function)
.. _func-str:
.. _func-str:
.. class:: str(object='')
.. class:: str(object='')
...
...
Doc/library/functools.rst
Dosyayı görüntüle @
205dd4e1
...
@@ -264,9 +264,9 @@ The :mod:`functools` module defines the following functions:
...
@@ -264,9 +264,9 @@ The :mod:`functools` module defines the following functions:
return value
return value
.. decorator:: singledispatch
(default)
.. decorator:: singledispatch
Transform
s
a function into a :term:`single-dispatch <single
Transform a function into a :term:`single-dispatch <single
dispatch>` :term:`generic function`.
dispatch>` :term:`generic function`.
To define a generic function, decorate it with the ``@singledispatch``
To define a generic function, decorate it with the ``@singledispatch``
...
...
Doc/library/test.rst
Dosyayı görüntüle @
205dd4e1
...
@@ -440,7 +440,7 @@ The :mod:`test.support` module defines the following functions:
...
@@ -440,7 +440,7 @@ The :mod:`test.support` module defines the following functions:
otherwise.
otherwise.
.. decorator:: skip_unless_symlink
()
.. decorator:: skip_unless_symlink
A decorator for running tests that require support for symbolic links.
A decorator for running tests that require support for symbolic links.
...
...
Doc/library/typing.rst
Dosyayı görüntüle @
205dd4e1
...
@@ -897,17 +897,17 @@ The module defines the following classes, functions and decorators:
...
@@ -897,17 +897,17 @@ The module defines the following classes, functions and decorators:
See :pep:`484` for details and comparison with other typing semantics.
See :pep:`484` for details and comparison with other typing semantics.
.. decorator:: no_type_check
(arg)
.. decorator:: no_type_check
Decorator to indicate that annotations are not type hints.
Decorator to indicate that annotations are not type hints.
Th
e argument must be a class or function; if it is
a class, it
Th
is works as class or function :term:`decorator`. With
a class, it
applies recursively to all methods defined in that class (but not
applies recursively to all methods defined in that class (but not
to methods defined in its superclasses or subclasses).
to methods defined in its superclasses or subclasses).
This mutates the function(s) in place.
This mutates the function(s) in place.
.. decorator:: no_type_check_decorator
(decorator)
.. decorator:: no_type_check_decorator
Decorator to give another decorator the :func:`no_type_check` effect.
Decorator to give another decorator the :func:`no_type_check` effect.
...
...
Lib/test/test_typing.py
Dosyayı görüntüle @
205dd4e1
...
@@ -1471,8 +1471,8 @@ class ForwardRefTests(BaseTestCase):
...
@@ -1471,8 +1471,8 @@ class ForwardRefTests(BaseTestCase):
def
test_meta_no_type_check
(
self
):
def
test_meta_no_type_check
(
self
):
@no_type_check_decorator
@no_type_check_decorator
def
magic_decorator
(
deco
):
def
magic_decorator
(
func
):
return
deco
return
func
self
.
assertEqual
(
magic_decorator
.
__name__
,
'magic_decorator'
)
self
.
assertEqual
(
magic_decorator
.
__name__
,
'magic_decorator'
)
...
...
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