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
42d9e1b9
Kaydet (Commit)
42d9e1b9
authored
Ock 22, 2014
tarafından
Larry Hastings
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Doc fixes for Argument Clinic.
üst
d58831e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
clinic.rst
Doc/howto/clinic.rst
+18
-6
No files found.
Doc/howto/clinic.rst
Dosyayı görüntüle @
42d9e1b9
...
...
@@ -626,6 +626,15 @@ Optional groups are groups of arguments that must all be passed in together.
They can be to the left or the right of the required arguments. They
can *only* be used with positional-only parameters.
.. note:: Optional groups are *only* intended for use when converting
functions that make multiple calls to :c:func:`PyArg_ParseTuple`!
Functions that use *any* other approach for parsing arguments
should *almost never* be converted to Argument Clinic using
optional groups. Functions using optional groups currently
cannot have accurate sigantures in Python, because Python just
doesn't understand the concept. Please avoid using optional
groups wherever possible.
To specify an optional group, add a ``[`` on a line by itself before
the parameters you wish to group together, and a ``]`` on a line by itself
after these parameters. As an example, here's how ``curses.window.addch``
...
...
@@ -1278,9 +1287,8 @@ a ``type`` argument to the object converter for ``METH_O``.
tp_new and tp_init functions
----------------------------------------------
You can convert ``tp_new`` and ``tp_init``
functions. Just name them ``__new__`` or
``__init__`` as appropriate. Notes:
You can convert ``tp_new`` and ``tp_init`` functions. Just name
them ``__new__`` or ``__init__`` as appropriate. Notes:
* The function name generated for ``__new__`` doesn't end in ``__new__``
like it would by default. It's just the name of the class, converted
...
...
@@ -1290,9 +1298,13 @@ functions. Just name them ``__new__`` or
* ``__init__`` functions return ``int``, not ``PyObject *``.
* Argument Clinic supports any signature for these functions, even though
the parsing function is required to always take ``args`` and ``kwargs``
objects.
* Use the docstring as the class docstring.
* Although ``__new__`` and ``__init__`` functions must always
accept both the ``args`` and ``kwargs`` objects, when converting
you may specify any signature for these functions that you like.
(If your function doesn't support keywords, the parsing function
generated will throw an exception if it receives any.)
The #ifdef trick
----------------------------------------------
...
...
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