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
7f781c9a
Kaydet (Commit)
7f781c9a
authored
May 01, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add Pickler.clear_memo() so the pickle and cPickle modules are more similar.
üst
56aa6280
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
libpickle.tex
Doc/lib/libpickle.tex
+9
-4
pickle.py
Lib/pickle.py
+3
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Doc/lib/libpickle.tex
Dosyayı görüntüle @
7f781c9a
...
@@ -237,15 +237,20 @@ remembers which objects the pickler has already seen, so that shared
...
@@ -237,15 +237,20 @@ remembers which objects the pickler has already seen, so that shared
or recursive objects pickled by reference and not by value. This
or recursive objects pickled by reference and not by value. This
method is useful when re-using picklers.
method is useful when re-using picklers.
\strong
{
Note:
}
\method
{
clear
_
memo()
}
is only available on the picklers
\begin{notice}
created by
\module
{
cPickle
}
. In the
\module
{
pickle
}
module, picklers
Prior to Python 2.3,
\method
{
clear
_
memo()
}
was only available on the
have an instance variable called
\member
{
memo
}
which is a Python
picklers created by
\refmodule
{
cPickle
}
. In the
\module
{
pickle
}
module,
dictionary. So to clear the memo for a
\module
{
pickle
}
module
picklers have an instance variable called
\member
{
memo
}
which is a
Python dictionary. So to clear the memo for a
\module
{
pickle
}
module
pickler, you could do the following:
pickler, you could do the following:
\begin{verbatim}
\begin{verbatim}
mypickler.memo.clear()
mypickler.memo.clear()
\end{verbatim}
\end{verbatim}
Code that does not need to support older versions of Python should
simply use
\method
{
clear
_
memo()
}
.
\end{notice}
\end{methoddesc}
\end{methoddesc}
It is possible to make multiple calls to the
\method
{
dump()
}
method of
It is possible to make multiple calls to the
\method
{
dump()
}
method of
...
...
Lib/pickle.py
Dosyayı görüntüle @
7f781c9a
...
@@ -115,6 +115,9 @@ class Pickler:
...
@@ -115,6 +115,9 @@ class Pickler:
self
.
memo
=
{}
self
.
memo
=
{}
self
.
bin
=
bin
self
.
bin
=
bin
def
clear_memo
(
self
):
self
.
memo
.
clear
()
def
dump
(
self
,
object
):
def
dump
(
self
,
object
):
self
.
save
(
object
)
self
.
save
(
object
)
self
.
write
(
STOP
)
self
.
write
(
STOP
)
...
...
Misc/NEWS
Dosyayı görüntüle @
7f781c9a
...
@@ -99,6 +99,9 @@ Extension modules
...
@@ -99,6 +99,9 @@ Extension modules
Library
Library
- The pickle.Pickler class grew a clear_memo() method to mimic that
provided by cPickle.Pickler.
- difflib's SequenceMatcher class now does a dynamic analysis of
- difflib's SequenceMatcher class now does a dynamic analysis of
which elements are so frequent as to constitute noise. For
which elements are so frequent as to constitute noise. For
comparing files as sequences of lines, this generally works better
comparing files as sequences of lines, this generally works better
...
...
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