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
b9da9bc0
Kaydet (Commit)
b9da9bc0
authored
Şub 04, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Start replacing UserDict.DictMixin with collections.MutableMapping (the bsddb modules are next).
üst
15ebc88d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
+19
-7
_abcoll.py
Lib/_abcoll.py
+12
-0
dbshelve.py
Lib/bsddb/dbshelve.py
+2
-2
dumbdbm.py
Lib/dumbdbm.py
+2
-2
shelve.py
Lib/shelve.py
+3
-3
No files found.
Lib/_abcoll.py
Dosyayı görüntüle @
b9da9bc0
...
...
@@ -378,6 +378,11 @@ class Mapping(metaclass=ABCMeta):
def
values
(
self
):
return
ValuesView
(
self
)
def
__eq__
(
self
,
other
):
return
set
(
self
)
==
set
(
other
)
def
__ne__
(
self
,
other
):
return
set
(
self
)
==
set
(
other
)
class
MappingView
(
metaclass
=
ABCMeta
):
...
...
@@ -485,6 +490,13 @@ class MutableMapping(Mapping):
for
key
,
value
in
kwds
.
items
():
self
[
key
]
=
value
def
setdefault
(
self
,
key
,
default
=
None
):
try
:
return
self
[
key
]
except
KeyError
:
self
[
key
]
=
default
return
default
MutableMapping
.
register
(
dict
)
...
...
Lib/bsddb/dbshelve.py
Dosyayı görüntüle @
b9da9bc0
...
...
@@ -38,12 +38,12 @@ if sys.version_info[:3] >= (2, 3, 0):
HIGHEST_PROTOCOL
=
pickle
.
HIGHEST_PROTOCOL
def
_dumps
(
object
,
protocol
):
return
pickle
.
dumps
(
object
,
protocol
=
protocol
)
from
UserDict
import
DictMixin
from
collections
import
MutableMapping
else
:
HIGHEST_PROTOCOL
=
None
def
_dumps
(
object
,
protocol
):
return
pickle
.
dumps
(
object
,
bin
=
protocol
)
class
DictMixin
:
pass
class
MutableMapping
:
pass
from
.
import
db
...
...
Lib/dumbdbm.py
Dosyayı görüntüle @
b9da9bc0
...
...
@@ -23,13 +23,13 @@ is read when the database is opened, and some updates rewrite the whole index)
import
io
as
_io
import
os
as
_os
import
UserDict
import
collections
_BLOCKSIZE
=
512
error
=
IOError
# For anydbm
class
_Database
(
UserDict
.
DictMixin
):
class
_Database
(
collections
.
MutableMapping
):
# The on-disk directory and data files can remain in mutually
# inconsistent states for an arbitrarily long time (see comments
...
...
Lib/shelve.py
Dosyayı görüntüle @
b9da9bc0
...
...
@@ -59,12 +59,12 @@ the persistent dictionary on disk, if feasible).
from
pickle
import
Pickler
,
Unpickler
from
io
import
BytesIO
import
UserDict
import
collections
import
warnings
__all__
=
[
"Shelf"
,
"BsdDbShelf"
,
"DbfilenameShelf"
,
"open"
]
class
Shelf
(
UserDict
.
DictMixin
):
class
Shelf
(
collections
.
MutableMapping
):
"""Base class for shelf implementations.
This is initialized with a dictionary-like object.
...
...
@@ -81,7 +81,7 @@ class Shelf(UserDict.DictMixin):
self
.
cache
=
{}
self
.
keyencoding
=
"utf-8"
def
keys
(
self
):
def
__iter__
(
self
):
for
k
in
self
.
dict
.
keys
():
yield
k
.
decode
(
self
.
keyencoding
)
...
...
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