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
721b7761
Kaydet (Commit)
721b7761
authored
Kas 09, 2003
tarafından
Alex Martelli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fixed buggy comment as per SF bug #827856
(same as commit of Sun Nov 2 to the release23-maint branch)
üst
c516b0e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
object.h
Include/object.h
+7
-7
No files found.
Include/object.h
Dosyayı görüntüle @
721b7761
...
...
@@ -698,22 +698,22 @@ It takes a while to get used to the proper usage of reference counts.
Functions that create an object set the reference count to 1; such new
objects must be stored somewhere or destroyed again with Py_DECREF().
Functions that 'store' objects
such as PyTuple_SetItem() and
Py
Dict_SetItemString()
Some functions that 'store' objects,
such as PyTuple_SetItem() and
Py
List_SetItem(),
don't increment the reference count of the object, since the most
frequent use is to store a fresh object. Functions that 'retrieve'
objects
such as PyTuple_GetItem() and PyDict_GetItemString()
also
objects
, such as PyTuple_GetItem() and PyDict_GetItemString(),
also
don't increment
the reference count, since most frequently the object is only looked at
quickly. Thus, to retrieve an object and store it again, the caller
must call Py_INCREF() explicitly.
NOTE: functions that 'consume' a reference count like
PyList_SetItem
String() even consume the reference
if the object wasn't
stored, to simplify error handling.
NOTE: functions that 'consume' a reference count
,
like
PyList_SetItem
(), consume the reference even
if the object wasn't
s
uccessfully s
tored, to simplify error handling.
It seems attractive to make other functions that take an object as
argument consume a reference count; however this may quickly get
argument consume a reference count; however
,
this may quickly get
confusing (even the current practice is already confusing). Consider
it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at
times.
...
...
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