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
7c307243
Kaydet (Commit)
7c307243
authored
Mar 17, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More apply() cleanup
üst
ade612be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
__init__.py
Lib/logging/__init__.py
+2
-2
stringold.py
Lib/stringold.py
+7
-10
No files found.
Lib/logging/__init__.py
Dosyayı görüntüle @
7c307243
...
@@ -1015,7 +1015,7 @@ class Logger(Filterer):
...
@@ -1015,7 +1015,7 @@ class Logger(Filterer):
"""
"""
Convenience method for logging an ERROR with exception information.
Convenience method for logging an ERROR with exception information.
"""
"""
self
.
error
(
msg
,
*
args
,
exc_info
=
1
)
self
.
error
(
msg
,
exc_info
=
1
,
*
args
)
def
critical
(
self
,
msg
,
*
args
,
**
kwargs
):
def
critical
(
self
,
msg
,
*
args
,
**
kwargs
):
"""
"""
...
@@ -1292,7 +1292,7 @@ def exception(msg, *args):
...
@@ -1292,7 +1292,7 @@ def exception(msg, *args):
Log a message with severity 'ERROR' on the root logger,
Log a message with severity 'ERROR' on the root logger,
with exception information.
with exception information.
"""
"""
error
(
msg
,
*
args
,
exc_info
=
1
)
error
(
msg
,
exc_info
=
1
,
*
args
)
def
warning
(
msg
,
*
args
,
**
kwargs
):
def
warning
(
msg
,
*
args
,
**
kwargs
):
"""
"""
...
...
Lib/stringold.py
Dosyayı görüntüle @
7c307243
...
@@ -126,9 +126,6 @@ def join(words, sep = ' '):
...
@@ -126,9 +126,6 @@ def join(words, sep = ' '):
return
sep
.
join
(
words
)
return
sep
.
join
(
words
)
joinfields
=
join
joinfields
=
join
# for a little bit of speed
_apply
=
apply
# Find substring, raise exception if not found
# Find substring, raise exception if not found
def
index
(
s
,
*
args
):
def
index
(
s
,
*
args
):
"""index(s, sub [,start [,end]]) -> int
"""index(s, sub [,start [,end]]) -> int
...
@@ -136,7 +133,7 @@ def index(s, *args):
...
@@ -136,7 +133,7 @@ def index(s, *args):
Like find but raises ValueError when the substring is not found.
Like find but raises ValueError when the substring is not found.
"""
"""
return
_apply
(
s
.
index
,
args
)
return
s
.
index
(
*
args
)
# Find last substring, raise exception if not found
# Find last substring, raise exception if not found
def
rindex
(
s
,
*
args
):
def
rindex
(
s
,
*
args
):
...
@@ -145,7 +142,7 @@ def rindex(s, *args):
...
@@ -145,7 +142,7 @@ def rindex(s, *args):
Like rfind but raises ValueError when the substring is not found.
Like rfind but raises ValueError when the substring is not found.
"""
"""
return
_apply
(
s
.
rindex
,
args
)
return
s
.
rindex
(
*
args
)
# Count non-overlapping occurrences of substring
# Count non-overlapping occurrences of substring
def
count
(
s
,
*
args
):
def
count
(
s
,
*
args
):
...
@@ -156,7 +153,7 @@ def count(s, *args):
...
@@ -156,7 +153,7 @@ def count(s, *args):
interpreted as in slice notation.
interpreted as in slice notation.
"""
"""
return
_apply
(
s
.
count
,
args
)
return
s
.
count
(
*
args
)
# Find substring, return -1 if not found
# Find substring, return -1 if not found
def
find
(
s
,
*
args
):
def
find
(
s
,
*
args
):
...
@@ -169,7 +166,7 @@ def find(s, *args):
...
@@ -169,7 +166,7 @@ def find(s, *args):
Return -1 on failure.
Return -1 on failure.
"""
"""
return
_apply
(
s
.
find
,
args
)
return
s
.
find
(
*
args
)
# Find last substring, return -1 if not found
# Find last substring, return -1 if not found
def
rfind
(
s
,
*
args
):
def
rfind
(
s
,
*
args
):
...
@@ -182,7 +179,7 @@ def rfind(s, *args):
...
@@ -182,7 +179,7 @@ def rfind(s, *args):
Return -1 on failure.
Return -1 on failure.
"""
"""
return
_apply
(
s
.
rfind
,
args
)
return
s
.
rfind
(
*
args
)
# for a bit of speed
# for a bit of speed
_float
=
float
_float
=
float
...
@@ -224,7 +221,7 @@ def atoi(*args):
...
@@ -224,7 +221,7 @@ def atoi(*args):
# error message isn't compatible but the error type is, and this function
# error message isn't compatible but the error type is, and this function
# is complicated enough already.
# is complicated enough already.
if
type
(
s
)
==
_StringType
:
if
type
(
s
)
==
_StringType
:
return
_
apply
(
_int
,
args
)
return
_
int
(
*
args
)
else
:
else
:
raise
TypeError
(
'argument 1: expected string,
%
s found'
%
raise
TypeError
(
'argument 1: expected string,
%
s found'
%
type
(
s
)
.
__name__
)
type
(
s
)
.
__name__
)
...
@@ -252,7 +249,7 @@ def atol(*args):
...
@@ -252,7 +249,7 @@ def atol(*args):
# error message isn't compatible but the error type is, and this function
# error message isn't compatible but the error type is, and this function
# is complicated enough already.
# is complicated enough already.
if
type
(
s
)
==
_StringType
:
if
type
(
s
)
==
_StringType
:
return
_
apply
(
_long
,
args
)
return
_
long
(
*
args
)
else
:
else
:
raise
TypeError
(
'argument 1: expected string,
%
s found'
%
raise
TypeError
(
'argument 1: expected string,
%
s found'
%
type
(
s
)
.
__name__
)
type
(
s
)
.
__name__
)
...
...
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