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
a9bc168f
Kaydet (Commit)
a9bc168f
authored
Ock 11, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Got rid of the internal datetimetz type.
üst
a032d2eb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
datetime.h
Include/datetime.h
+19
-19
test_datetime.py
Lib/test/test_datetime.py
+1
-1
datetimemodule.c
Modules/datetimemodule.c
+0
-0
No files found.
Include/datetime.h
Dosyayı görüntüle @
a9bc168f
...
@@ -42,13 +42,6 @@ typedef struct
...
@@ -42,13 +42,6 @@ typedef struct
PyObject_HEAD
/* a pure abstract base clase */
PyObject_HEAD
/* a pure abstract base clase */
}
PyDateTime_TZInfo
;
}
PyDateTime_TZInfo
;
typedef
struct
{
PyObject_HEAD
long
hashcode
;
unsigned
char
data
[
_PyDateTime_DATE_DATASIZE
];
}
PyDateTime_Date
;
/* The datetime and time types have hashcodes, and an optional tzinfo member,
/* The datetime and time types have hashcodes, and an optional tzinfo member,
* present if and only if hastzinfo is true.
* present if and only if hastzinfo is true.
...
@@ -88,25 +81,35 @@ typedef struct
...
@@ -88,25 +81,35 @@ typedef struct
PyObject
*
tzinfo
;
PyObject
*
tzinfo
;
}
PyDateTime_Time
;
/* hastzinfo true */
}
PyDateTime_Time
;
/* hastzinfo true */
/* XXX The date type will be reworked similarly. */
/* All datetime objects are of PyDateTime_DateTimeType, but that can be
* allocated in two ways too, just like for time objects above. In addition,
* the plain date type is a base class for datetime, so it must also have
* a hastzinfo member (although it's unused there).
*/
typedef
struct
typedef
struct
{
{
PyObject_HEAD
_PyTZINFO_HEAD
long
hashcode
;
unsigned
char
data
[
_PyDateTime_DATE_DATASIZE
];
}
PyDateTime_Date
;
#define _PyDateTime_DATETIMEHEAD \
_PyTZINFO_HEAD \
unsigned char data[_PyDateTime_DATETIME_DATASIZE];
unsigned char data[_PyDateTime_DATETIME_DATASIZE];
}
PyDateTime_DateTime
;
typedef
struct
typedef
struct
{
{
PyObject_HEAD
_PyDateTime_DATETIMEHEAD
long
hashcode
;
}
_PyDateTime_BaseDateTime
;
/* hastzinfo false */
unsigned
char
data
[
_PyDateTime_DATETIME_DATASIZE
];
typedef
struct
{
_PyDateTime_DATETIMEHEAD
PyObject
*
tzinfo
;
PyObject
*
tzinfo
;
}
PyDateTime_DateTime
TZ
;
}
PyDateTime_DateTime
;
/* hastzinfo true */
/* Apply for date
, datetime, and datetimetz
instances. */
/* Apply for date
and datetime
instances. */
#define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \
#define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \
((PyDateTime_Date*)o)->data[1])
((PyDateTime_Date*)o)->data[1])
#define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2])
#define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2])
...
@@ -135,9 +138,6 @@ typedef struct
...
@@ -135,9 +138,6 @@ typedef struct
#define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType)
#define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType)
#define PyDateTime_CheckExact(op) ((op)->ob_type == &PyDateTime_DateTimeType)
#define PyDateTime_CheckExact(op) ((op)->ob_type == &PyDateTime_DateTimeType)
#define PyDateTimeTZ_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeTZType)
#define PyDateTimeTZ_CheckExact(op) ((op)->ob_type == &PyDateTime_DateTimeTZType)
#define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType)
#define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType)
#define PyTime_CheckExact(op) ((op)->ob_type == &PyDateTime_TimeType)
#define PyTime_CheckExact(op) ((op)->ob_type == &PyDateTime_TimeType)
...
...
Lib/test/test_datetime.py
Dosyayı görüntüle @
a9bc168f
...
@@ -2076,7 +2076,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase):
...
@@ -2076,7 +2076,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase):
tinfo
=
PicklableFixedOffset
(
-
300
,
'cookie'
)
tinfo
=
PicklableFixedOffset
(
-
300
,
'cookie'
)
orig
=
self
.
theclass
(
*
args
,
**
{
'tzinfo'
:
tinfo
})
orig
=
self
.
theclass
(
*
args
,
**
{
'tzinfo'
:
tinfo
})
state
=
orig
.
__getstate__
()
state
=
orig
.
__getstate__
()
derived
=
self
.
theclass
(
1
,
1
,
1
)
derived
=
self
.
theclass
(
1
,
1
,
1
,
tzinfo
=
FixedOffset
(
0
,
""
,
0
)
)
derived
.
__setstate__
(
state
)
derived
.
__setstate__
(
state
)
self
.
assertEqual
(
orig
,
derived
)
self
.
assertEqual
(
orig
,
derived
)
self
.
failUnless
(
isinstance
(
derived
.
tzinfo
,
PicklableFixedOffset
))
self
.
failUnless
(
isinstance
(
derived
.
tzinfo
,
PicklableFixedOffset
))
...
...
Modules/datetimemodule.c
Dosyayı görüntüle @
a9bc168f
This diff is collapsed.
Click to expand it.
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