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
c06de477
Kaydet (Commit)
c06de477
authored
May 30, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty parameters.
üst
3b1b8072
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
test_weakref.py
Lib/test/test_weakref.py
+11
-0
weakref.py
Lib/weakref.py
+1
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_weakref.py
Dosyayı görüntüle @
c06de477
...
...
@@ -942,6 +942,17 @@ class MappingTestCase(TestBase):
dict
[
o
]
=
o
.
arg
return
dict
,
objects
def
test_make_weak_valued_dict_from_dict
(
self
):
o
=
Object
(
3
)
dict
=
weakref
.
WeakValueDictionary
({
364
:
o
})
self
.
assertEqual
(
dict
[
364
],
o
)
def
test_make_weak_valued_dict_from_weak_valued_dict
(
self
):
o
=
Object
(
3
)
dict
=
weakref
.
WeakValueDictionary
({
364
:
o
})
dict2
=
weakref
.
WeakValueDictionary
(
dict
)
self
.
assertEqual
(
dict
[
364
],
o
)
def
make_weak_valued_dict
(
self
):
dict
=
weakref
.
WeakValueDictionary
()
objects
=
list
(
map
(
Object
,
range
(
self
.
COUNT
)))
...
...
Lib/weakref.py
Dosyayı görüntüle @
c06de477
...
...
@@ -49,7 +49,7 @@ class WeakValueDictionary(collections.MutableMapping):
del
self
.
data
[
wr
.
key
]
self
.
_remove
=
remove
self
.
data
=
d
=
{}
d
.
update
(
*
args
,
**
kw
)
self
.
update
(
*
args
,
**
kw
)
def
__getitem__
(
self
,
key
):
o
=
self
.
data
[
key
]()
...
...
Misc/NEWS
Dosyayı görüntüle @
c06de477
...
...
@@ -15,6 +15,9 @@ Core and Builtins
Library
-------
- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
parameters.
What's New in Python 3.1 release candidate 1?
=============================================
...
...
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