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
f8de3fea
Kaydet (Commit)
f8de3fea
authored
Ara 03, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#10360: catch TypeError in WeakSet.__contains__, just like WeakKeyDictionary does.
üst
3b9406b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
_weakrefset.py
Lib/_weakrefset.py
+5
-1
test_weakset.py
Lib/test/test_weakset.py
+2
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/_weakrefset.py
Dosyayı görüntüle @
f8de3fea
...
...
@@ -66,7 +66,11 @@ class WeakSet:
return
sum
(
x
()
is
not
None
for
x
in
self
.
data
)
def
__contains__
(
self
,
item
):
return
ref
(
item
)
in
self
.
data
try
:
wr
=
ref
(
item
)
except
TypeError
:
return
False
return
wr
in
self
.
data
def
__reduce__
(
self
):
return
(
self
.
__class__
,
(
list
(
self
),),
...
...
Lib/test/test_weakset.py
Dosyayı görüntüle @
f8de3fea
...
...
@@ -50,7 +50,8 @@ class TestWeakSet(unittest.TestCase):
def
test_contains
(
self
):
for
c
in
self
.
letters
:
self
.
assertEqual
(
c
in
self
.
s
,
c
in
self
.
d
)
self
.
assertRaises
(
TypeError
,
self
.
s
.
__contains__
,
[[]])
# 1 is not weakref'able, but that TypeError is caught by __contains__
self
.
assertNotIn
(
1
,
self
.
s
)
self
.
assertIn
(
self
.
obj
,
self
.
fs
)
del
self
.
obj
self
.
assertNotIn
(
ustr
(
'F'
),
self
.
fs
)
...
...
Misc/NEWS
Dosyayı görüntüle @
f8de3fea
...
...
@@ -33,6 +33,9 @@ Core and Builtins
Library
-------
- Issue #10360: In WeakSet, do not raise TypeErrors when testing for
membership of non-weakrefable objects.
- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
- Issue #1745035: Add a command size and data size limit to smtpd.py, to
...
...
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