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
48b98ded
Kaydet (Commit)
48b98ded
authored
Mar 10, 2008
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
strxfrm and strcoll are conditionally defined, alwsy provide some impl
üst
5bacec18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
locale.py
Lib/locale.py
+17
-11
No files found.
Lib/locale.py
Dosyayı görüntüle @
48b98ded
...
@@ -26,6 +26,18 @@ __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
...
@@ -26,6 +26,18 @@ __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
"normalize"
,
"LC_CTYPE"
,
"LC_COLLATE"
,
"LC_TIME"
,
"LC_MONETARY"
,
"normalize"
,
"LC_CTYPE"
,
"LC_COLLATE"
,
"LC_TIME"
,
"LC_MONETARY"
,
"LC_NUMERIC"
,
"LC_ALL"
,
"CHAR_MAX"
]
"LC_NUMERIC"
,
"LC_ALL"
,
"CHAR_MAX"
]
def
_strcoll
(
a
,
b
):
""" strcoll(string,string) -> int.
Compares two strings according to the locale.
"""
return
cmp
(
a
,
b
)
def
_strxfrm
(
s
):
""" strxfrm(string) -> string.
Returns a string that behaves for cmp locale-aware.
"""
return
s
try
:
try
:
from
_locale
import
*
from
_locale
import
*
...
@@ -76,17 +88,11 @@ except ImportError:
...
@@ -76,17 +88,11 @@ except ImportError:
raise
Error
(
'_locale emulation only supports "C" locale'
)
raise
Error
(
'_locale emulation only supports "C" locale'
)
return
'C'
return
'C'
def
strcoll
(
a
,
b
):
# These may or may not exist in _locale, so be sure to set them.
""" strcoll(string,string) -> int.
if
'strxfrm'
not
in
globals
():
Compares two strings according to the locale.
strxfrm
=
_strxfrm
"""
if
'strcoll'
not
in
globals
():
return
cmp
(
a
,
b
)
strcoll
=
_strcoll
def
strxfrm
(
s
):
""" strxfrm(string) -> string.
Returns a string that behaves for cmp locale-aware.
"""
return
s
### Number formatting APIs
### Number formatting APIs
...
...
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