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
9c051d7e
Kaydet (Commit)
9c051d7e
authored
Haz 20, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF 570727 indexer() class no longer needed since lists now support slicing
üst
9c14badc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
calendar.py
Lib/calendar.py
+4
-13
No files found.
Lib/calendar.py
Dosyayı görüntüle @
9c051d7e
...
@@ -9,7 +9,6 @@ set the first day of the week (0=Monday, 6=Sunday)."""
...
@@ -9,7 +9,6 @@ set the first day of the week (0=Monday, 6=Sunday)."""
# Import functions and variables from time module
# Import functions and variables from time module
from
time
import
localtime
,
mktime
,
strftime
from
time
import
localtime
,
mktime
,
strftime
from
types
import
SliceType
__all__
=
[
"error"
,
"setfirstweekday"
,
"firstweekday"
,
"isleap"
,
__all__
=
[
"error"
,
"setfirstweekday"
,
"firstweekday"
,
"isleap"
,
"leapdays"
,
"weekday"
,
"monthrange"
,
"monthcalendar"
,
"leapdays"
,
"weekday"
,
"monthrange"
,
"monthcalendar"
,
...
@@ -31,15 +30,7 @@ mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
...
@@ -31,15 +30,7 @@ mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
# that, but supply localized names. Note that the values are computed
# that, but supply localized names. Note that the values are computed
# fresh on each call, in case the user changes locale between calls.
# fresh on each call, in case the user changes locale between calls.
class
_indexer
:
class
_localized_month
:
def
__getitem__
(
self
,
i
):
if
isinstance
(
i
,
SliceType
):
return
self
.
data
[
i
.
start
:
i
.
stop
]
else
:
# May raise an appropriate exception.
return
self
.
data
[
i
]
class
_localized_month
(
_indexer
):
def
__init__
(
self
,
format
):
def
__init__
(
self
,
format
):
self
.
format
=
format
self
.
format
=
format
...
@@ -47,12 +38,12 @@ class _localized_month(_indexer):
...
@@ -47,12 +38,12 @@ class _localized_month(_indexer):
self
.
data
=
[
strftime
(
self
.
format
,
(
2001
,
j
,
1
,
12
,
0
,
0
,
1
,
1
,
0
))
self
.
data
=
[
strftime
(
self
.
format
,
(
2001
,
j
,
1
,
12
,
0
,
0
,
1
,
1
,
0
))
for
j
in
range
(
1
,
13
)]
for
j
in
range
(
1
,
13
)]
self
.
data
.
insert
(
0
,
""
)
self
.
data
.
insert
(
0
,
""
)
return
_indexer
.
__getitem__
(
self
,
i
)
return
self
.
data
[
i
]
def
__len__
(
self
):
def
__len__
(
self
):
return
13
return
13
class
_localized_day
(
_indexer
)
:
class
_localized_day
:
def
__init__
(
self
,
format
):
def
__init__
(
self
,
format
):
self
.
format
=
format
self
.
format
=
format
...
@@ -60,7 +51,7 @@ class _localized_day(_indexer):
...
@@ -60,7 +51,7 @@ class _localized_day(_indexer):
# January 1, 2001, was a Monday.
# January 1, 2001, was a Monday.
self
.
data
=
[
strftime
(
self
.
format
,
(
2001
,
1
,
j
+
1
,
12
,
0
,
0
,
j
,
j
+
1
,
0
))
self
.
data
=
[
strftime
(
self
.
format
,
(
2001
,
1
,
j
+
1
,
12
,
0
,
0
,
j
,
j
+
1
,
0
))
for
j
in
range
(
7
)]
for
j
in
range
(
7
)]
return
_indexer
.
__getitem__
(
self
,
i
)
return
self
.
data
[
i
]
def
__len__
(
self_
):
def
__len__
(
self_
):
return
7
return
7
...
...
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