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
97394bc7
Kaydet (Commit)
97394bc7
authored
May 21, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch 533291. Deprecate None return form of __reduce__.
üst
7f7d5bf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
libpickle.tex
Doc/lib/libpickle.tex
+8
-4
pickle.py
Lib/pickle.py
+4
-0
No files found.
Doc/lib/libpickle.tex
Dosyayı görüntüle @
97394bc7
...
...
@@ -444,6 +444,7 @@ or three, with the following semantics:
by name.
\item
A tuple of arguments for the callable object, or
\code
{
None
}
.
\deprecated
{
2.3
}{
Use the tuple of arguments instead
}
\item
Optionally, the object's state, which will be passed to
the object's
\method
{__
setstate
__
()
}
method as described in
...
...
@@ -456,10 +457,13 @@ or three, with the following semantics:
Upon unpickling, the callable will be called (provided that it meets
the above criteria), passing in the tuple of arguments; it should
return the unpickled object. If the second item was
\code
{
None
}
, then
instead of calling the callable directly, its
\method
{__
basicnew
__
()
}
method is called without arguments. It should also return the
unpickled object.
return the unpickled object.
If the second item was
\code
{
None
}
, then instead of calling the
callable directly, its
\method
{__
basicnew
__
()
}
method is called
without arguments. It should also return the unpickled object.
\deprecated
{
2.3
}{
Use the tuple of arguments instead
}
An alternative to implementing a
\method
{__
reduce
__
()
}
method on the
object to be pickled, is to register the callable with the
...
...
Lib/pickle.py
Dosyayı görüntüle @
97394bc7
...
...
@@ -862,6 +862,10 @@ class Unpickler:
"unpickling"
%
callable
if
arg_tup
is
None
:
import
warnings
warnings
.
warn
(
"The None return argument form of __reduce__ is "
"deprecated. Return a tuple of arguments instead."
,
DeprecationWarning
)
value
=
callable
.
__basicnew__
()
else
:
value
=
apply
(
callable
,
arg_tup
)
...
...
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