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
b6d84832
Kaydet (Commit)
b6d84832
authored
Eki 13, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24164: Document changes to __getnewargs__ and __getnewargs_ex__.
üst
dbc517c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
pickle.rst
Doc/library/pickle.rst
+13
-6
No files found.
Doc/library/pickle.rst
Dosyayı görüntüle @
b6d84832
...
...
@@ -488,7 +488,7 @@ methods:
.. method:: object.__getnewargs_ex__()
In protocols
4
and newer, classes that implements the
In protocols
2
and newer, classes that implements the
:meth:`__getnewargs_ex__` method can dictate the values passed to the
:meth:`__new__` method upon unpickling. The method must return a pair
``(args, kwargs)`` where *args* is a tuple of positional arguments
...
...
@@ -500,15 +500,22 @@ methods:
class requires keyword-only arguments. Otherwise, it is recommended for
compatibility to implement :meth:`__getnewargs__`.
.. versionchanged:: 3.6
:meth:`__getnewargs_ex__` is now used in protocols 2 and 3.
.. method:: object.__getnewargs__()
This method serve a similar purpose as :meth:`__getnewargs_ex__` but
for protocols 2 and newer. It must return a tuple of arguments ``args``
which will be passed to the :meth:`__new__` method upon unpickling.
This method serve a similar purpose as :meth:`__getnewargs_ex__`, but
supports only positional arguments. It must return a tuple of arguments
``args`` which will be passed to the :meth:`__new__` method upon unpickling.
:meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is
defined.
In protocols 4 and newer, :meth:`__getnewargs__` will not be called if
:meth:`__getnewargs_ex__` is defined.
.. versionchanged:: 3.6
Before Python 3.6, :meth:`__getnewargs__` was called instead of
:meth:`__getnewargs_ex__` in protocols 2 and 3.
.. method:: object.__getstate__()
...
...
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