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
e6c470f2
Kaydet (Commit)
e6c470f2
authored
Mar 27, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF bug #1770766: weakref proxy has incorrect __nonzero__ behavior.
üst
ca5d8fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
test_weakref.py
Lib/test/test_weakref.py
+6
-0
weakrefobject.c
Objects/weakrefobject.c
+1
-5
No files found.
Lib/test/test_weakref.py
Dosyayı görüntüle @
e6c470f2
...
...
@@ -271,6 +271,12 @@ class ReferencesTestCase(TestBase):
del
f
[
0
]
self
.
assertEqual
(
f
.
result
,
0
)
def
test_proxy_bool
(
self
):
# Test clearing of SF bug #1170766
class
List
(
list
):
pass
lyst
=
List
()
self
.
assertEqual
(
bool
(
weakref
.
proxy
(
lyst
)),
bool
(
lyst
))
def
test_getweakrefcount
(
self
):
o
=
C
()
ref1
=
weakref
.
ref
(
o
)
...
...
Objects/weakrefobject.c
Dosyayı görüntüle @
e6c470f2
...
...
@@ -505,11 +505,7 @@ proxy_nonzero(PyWeakReference *proxy)
PyObject
*
o
=
PyWeakref_GET_OBJECT
(
proxy
);
if
(
!
proxy_checkref
(
proxy
))
return
-
1
;
if
(
o
->
ob_type
->
tp_as_number
&&
o
->
ob_type
->
tp_as_number
->
nb_nonzero
)
return
(
*
o
->
ob_type
->
tp_as_number
->
nb_nonzero
)(
o
);
else
return
1
;
return
PyObject_IsTrue
(
o
);
}
static
void
...
...
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