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
1cf48b4a
Kaydet (Commit)
1cf48b4a
authored
May 22, 2013
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement missing inequality on WeakSet
üst
54f70923
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
_weakrefset.py
Lib/_weakrefset.py
+6
-0
test_weakset.py
Lib/test/test_weakset.py
+6
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/_weakrefset.py
Dosyayı görüntüle @
1cf48b4a
...
...
@@ -171,6 +171,12 @@ class WeakSet(object):
return
NotImplemented
return
self
.
data
==
set
(
ref
(
item
)
for
item
in
other
)
def
__ne__
(
self
,
other
):
opposite
=
self
.
__eq__
(
other
)
if
opposite
is
NotImplemented
:
return
NotImplemented
return
not
opposite
def
symmetric_difference
(
self
,
other
):
newset
=
self
.
copy
()
newset
.
symmetric_difference_update
(
other
)
...
...
Lib/test/test_weakset.py
Dosyayı görüntüle @
1cf48b4a
...
...
@@ -351,6 +351,12 @@ class TestWeakSet(unittest.TestCase):
self
.
assertFalse
(
self
.
s
==
tuple
(
self
.
items
))
self
.
assertFalse
(
self
.
s
==
1
)
def
test_ne
(
self
):
self
.
assertTrue
(
self
.
s
!=
set
(
self
.
items
))
s1
=
WeakSet
()
s2
=
WeakSet
()
self
.
assertFalse
(
s1
!=
s2
)
def
test_weak_destroy_while_iterating
(
self
):
# Issue #7105: iterators shouldn't crash when a key is implicitly removed
# Create new items to be sure no-one else holds a reference
...
...
Misc/NEWS
Dosyayı görüntüle @
1cf48b4a
...
...
@@ -15,6 +15,8 @@ Core and Builtins
Library
-------
- Implement inequality on weakref.WeakSet.
- Issue #17981: Closed socket on error in SysLogHandler.
- Issue #17754: Make ctypes.util.find_library() independent of the locale.
...
...
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