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
8ca6c84b
Kaydet (Commit)
8ca6c84b
authored
Mar 28, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Phase out has_key usage in the tutorial; correct docs for PyMapping_HasKey*.
üst
fc8eef3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
mapping.rst
Doc/c-api/mapping.rst
+5
-5
rfc822.rst
Doc/library/rfc822.rst
+1
-1
datastructures.rst
Doc/tutorial/datastructures.rst
+1
-4
No files found.
Doc/c-api/mapping.rst
Dosyayı görüntüle @
8ca6c84b
...
...
@@ -36,15 +36,15 @@ Mapping Protocol
.. cfunction:: int PyMapping_HasKeyString(PyObject *o, char *key)
On success, return ``1`` if the mapping object has the key *key* and ``0``
otherwise. This is equivalent to
the Python expression ``o.has_key(key)``.
This function always succeeds.
otherwise. This is equivalent to
``o[key]``, returning ``True`` on success
and ``False`` on an exception.
This function always succeeds.
.. cfunction:: int PyMapping_HasKey(PyObject *o, PyObject *key)
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
This
is equivalent to the Python expression ``o.has_key(key)``. This function always
succeeds.
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
This is equivalent to ``o[key]``, returning ``True`` on success and ``False``
on an exception. This function always
succeeds.
.. cfunction:: PyObject* PyMapping_Keys(PyObject *o)
...
...
Doc/library/rfc822.rst
Dosyayı görüntüle @
8ca6c84b
...
...
@@ -260,7 +260,7 @@ A :class:`Message` instance has the following methods:
:class:`Message` instances also support a limited mapping interface. In
particular: ``m[name]`` is like ``m.getheader(name)`` but raises :exc:`KeyError`
if there is no matching header; and ``len(m)``, ``m.get(name[, default])``,
``
m.has_key(name)
``, ``m.keys()``, ``m.values()`` ``m.items()``, and
``
name in m
``, ``m.keys()``, ``m.values()`` ``m.items()``, and
``m.setdefault(name[, default])`` act as expected, with the one difference
that :meth:`setdefault` uses an empty string as the default value.
:class:`Message` instances also support the mapping writable interface ``m[name]
...
...
Doc/tutorial/datastructures.rst
Dosyayı görüntüle @
8ca6c84b
...
...
@@ -480,8 +480,7 @@ using a non-existent key.
The :meth:`keys` method of a dictionary object returns a list of all the keys
used in the dictionary, in arbitrary order (if you want it sorted, just apply
the :meth:`sort` method to the list of keys). To check whether a single key is
in the dictionary, either use the dictionary's :meth:`has_key` method or the
:keyword:`in` keyword.
in the dictionary, use the :keyword:`in` keyword.
Here is a small example using a dictionary::
...
...
@@ -497,8 +496,6 @@ Here is a small example using a dictionary::
{'guido': 4127, 'irv': 4127, 'jack': 4098}
>>> tel.keys()
['guido', 'irv', 'jack']
>>> tel.has_key('guido')
True
>>> 'guido' in tel
True
...
...
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