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
283de2b9
Kaydet (Commit)
283de2b9
authored
Ara 28, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9770: curses.ascii predicates now work correctly with negative integers.
üst
c9ad8b7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
9 deletions
+31
-9
ascii.py
Lib/curses/ascii.py
+9
-9
test_curses.py
Lib/test/test_curses.py
+19
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/curses/ascii.py
Dosyayı görüntüle @
283de2b9
...
...
@@ -53,19 +53,19 @@ def _ctoi(c):
def
isalnum
(
c
):
return
isalpha
(
c
)
or
isdigit
(
c
)
def
isalpha
(
c
):
return
isupper
(
c
)
or
islower
(
c
)
def
isascii
(
c
):
return
_ctoi
(
c
)
<=
127
# ?
def
isascii
(
c
):
return
0
<=
_ctoi
(
c
)
<=
127
# ?
def
isblank
(
c
):
return
_ctoi
(
c
)
in
(
9
,
32
)
def
iscntrl
(
c
):
return
_ctoi
(
c
)
<=
31
or
_ctoi
(
c
)
==
127
def
isdigit
(
c
):
return
_ctoi
(
c
)
>=
48
and
_ctoi
(
c
)
<=
57
def
isgraph
(
c
):
return
_ctoi
(
c
)
>=
33
and
_ctoi
(
c
)
<=
126
def
islower
(
c
):
return
_ctoi
(
c
)
>=
97
and
_ctoi
(
c
)
<=
122
def
isprint
(
c
):
return
_ctoi
(
c
)
>=
32
and
_ctoi
(
c
)
<=
126
def
iscntrl
(
c
):
return
0
<=
_ctoi
(
c
)
<=
31
or
_ctoi
(
c
)
==
127
def
isdigit
(
c
):
return
48
<=
_ctoi
(
c
)
<=
57
def
isgraph
(
c
):
return
33
<=
_ctoi
(
c
)
<=
126
def
islower
(
c
):
return
97
<=
_ctoi
(
c
)
<=
122
def
isprint
(
c
):
return
32
<=
_ctoi
(
c
)
<=
126
def
ispunct
(
c
):
return
isgraph
(
c
)
and
not
isalnum
(
c
)
def
isspace
(
c
):
return
_ctoi
(
c
)
in
(
9
,
10
,
11
,
12
,
13
,
32
)
def
isupper
(
c
):
return
_ctoi
(
c
)
>=
65
and
_ctoi
(
c
)
<=
90
def
isupper
(
c
):
return
65
<=
_ctoi
(
c
)
<=
90
def
isxdigit
(
c
):
return
isdigit
(
c
)
or
\
(
_ctoi
(
c
)
>=
65
and
_ctoi
(
c
)
<=
70
)
or
(
_ctoi
(
c
)
>=
97
and
_ctoi
(
c
)
<=
102
)
def
isctrl
(
c
):
return
_ctoi
(
c
)
<
32
(
65
<=
_ctoi
(
c
)
<=
70
)
or
(
97
<=
_ctoi
(
c
)
<=
102
)
def
isctrl
(
c
):
return
0
<=
_ctoi
(
c
)
<
32
def
ismeta
(
c
):
return
_ctoi
(
c
)
>
127
def
ascii
(
c
):
...
...
Lib/test/test_curses.py
Dosyayı görüntüle @
283de2b9
...
...
@@ -436,6 +436,25 @@ class TestAscii(unittest.TestCase):
check
(
curses
.
ascii
.
ispunct
,
c
in
string
.
punctuation
)
check
(
curses
.
ascii
.
isxdigit
,
c
in
string
.
hexdigits
)
for
i
in
(
-
2
,
-
1
,
256
,
sys
.
maxunicode
,
sys
.
maxunicode
+
1
):
self
.
assertFalse
(
curses
.
ascii
.
isalnum
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isalpha
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isdigit
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
islower
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isspace
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isupper
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isascii
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isctrl
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
iscntrl
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isblank
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isgraph
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isprint
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
ispunct
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
isxdigit
(
i
))
self
.
assertFalse
(
curses
.
ascii
.
ismeta
(
-
1
))
def
test_ascii
(
self
):
ascii
=
curses
.
ascii
.
ascii
self
.
assertEqual
(
ascii
(
'
\xc1
'
),
'A'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
283de2b9
...
...
@@ -140,6 +140,9 @@ Core and Builtins
Library
-------
- Issue #9770: curses.ascii predicates now work correctly with negative
integers.
- Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
...
...
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