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
8a60c223
Kaydet (Commit)
8a60c223
authored
Şub 01, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
delta_setstate(): This waS no longer referenced, so nukeit.
delta_reduce(): Simplified.
üst
96ef8115
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
38 deletions
+2
-38
datetimemodule.c
Modules/datetimemodule.c
+2
-38
No files found.
Modules/datetimemodule.c
Dosyayı görüntüle @
8a60c223
...
@@ -1947,9 +1947,7 @@ delta_str(PyDateTime_Delta *self)
...
@@ -1947,9 +1947,7 @@ delta_str(PyDateTime_Delta *self)
return
NULL
;
return
NULL
;
}
}
/* Pickle support. Quite a maze! While __getstate__/__setstate__ sufficed
/* Pickle support. This is a plain application of __reduce__.
* in the Python implementation, the C implementation also requires
* __reduce__, and a __safe_for_unpickling__ attr in the type object.
*/
*/
static
PyObject
*
static
PyObject
*
delta_getstate
(
PyDateTime_Delta
*
self
)
delta_getstate
(
PyDateTime_Delta
*
self
)
...
@@ -1959,44 +1957,10 @@ delta_getstate(PyDateTime_Delta *self)
...
@@ -1959,44 +1957,10 @@ delta_getstate(PyDateTime_Delta *self)
GET_TD_MICROSECONDS
(
self
));
GET_TD_MICROSECONDS
(
self
));
}
}
/* __setstate__ isn't exposed. */
static
PyObject
*
delta_setstate
(
PyDateTime_Delta
*
self
,
PyObject
*
state
)
{
int
day
;
int
second
;
int
us
;
if
(
!
PyArg_ParseTuple
(
state
,
"iii:__setstate__"
,
&
day
,
&
second
,
&
us
))
return
NULL
;
self
->
hashcode
=
-
1
;
SET_TD_DAYS
(
self
,
day
);
SET_TD_SECONDS
(
self
,
second
);
SET_TD_MICROSECONDS
(
self
,
us
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
static
PyObject
*
delta_reduce
(
PyDateTime_Delta
*
self
)
delta_reduce
(
PyDateTime_Delta
*
self
)
{
{
PyObject
*
result
=
NULL
;
return
Py_BuildValue
(
"ON"
,
self
->
ob_type
,
delta_getstate
(
self
));
PyObject
*
state
=
delta_getstate
(
self
);
if
(
state
!=
NULL
)
{
/* The funky "()" in the format string creates an empty
* tuple as the 2nd component of the result 3-tuple.
*/
result
=
Py_BuildValue
(
"O(iii)"
,
self
->
ob_type
,
self
->
days
,
self
->
seconds
,
self
->
microseconds
);
Py_DECREF
(
state
);
}
return
result
;
}
}
#define OFFSET(field) offsetof(PyDateTime_Delta, field)
#define OFFSET(field) offsetof(PyDateTime_Delta, field)
...
...
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