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
fdcf2b7d
Kaydet (Commit)
fdcf2b7d
authored
Haz 07, 2013
tarafından
Łukasz Langa
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
moved the single-dispatch generic function definitions to the glossary
üst
7f7a67aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
glossary.rst
Doc/glossary.rst
+13
-0
functools.rst
Doc/library/functools.rst
+2
-6
No files found.
Doc/glossary.rst
Dosyayı görüntüle @
fdcf2b7d
...
...
@@ -302,6 +302,15 @@ Glossary
>>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81
285
generic function
A function composed of multiple functions implementing the same operation
for different types. Which implementation should be used during a call is
determined by the dispatch algorithm.
See also the :term:`single dispatch` glossary entry, the
:func:`functools.singledispatch` decorator, and :pep:`443`.
GIL
See :term:`global interpreter lock`.
...
...
@@ -745,6 +754,10 @@ Glossary
mapping
rather
than
a
sequence
because
the
lookups
use
arbitrary
:
term
:`
immutable
`
keys
rather
than
integers
.
single
dispatch
A
form
of
:
term
:`
generic
function
`
dispatch
where
the
implementation
is
chosen
based
on
the
type
of
a
single
argument
.
slice
An
object
usually
containing
a
portion
of
a
:
term
:`
sequence
`.
A
slice
is
created
using
the
subscript
notation
,
``[]``
with
colons
between
numbers
...
...
Doc/library/functools.rst
Dosyayı görüntüle @
fdcf2b7d
...
...
@@ -189,12 +189,8 @@ The :mod:`functools` module defines the following functions:
.. decorator:: singledispatch(default)
Transforms a function into a single-dispatch generic function. A **generic
function** is composed of multiple functions implementing the same operation
for different types. Which implementation should be used during a call is
determined by the dispatch algorithm. When the implementation is chosen
based on the type of a single argument, this is known as **single
dispatch**.
Transforms a function into a :term:`single-dispatch <single
dispatch>` :term:`generic function`.
To define a generic function, decorate it with the ``@singledispatch``
decorator. Note that the dispatch happens on the type of the first argument,
...
...
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