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
e37340ed
Kaydet (Commit)
e37340ed
authored
Şub 09, 2001
tarafından
Eric S. Raymond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String method conversion.
üst
dcd3a875
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
multifile.py
Lib/multifile.py
+2
-6
string.py
Lib/string.py
+1
-1
stringold.py
Lib/stringold.py
+1
-1
No files found.
Lib/multifile.py
Dosyayı görüntüle @
e37340ed
...
@@ -28,7 +28,6 @@ seekable stream object.
...
@@ -28,7 +28,6 @@ seekable stream object.
"""
"""
import
sys
import
sys
import
string
__all__
=
[
"MultiFile"
,
"Error"
]
__all__
=
[
"MultiFile"
,
"Error"
]
...
@@ -88,10 +87,7 @@ class MultiFile:
...
@@ -88,10 +87,7 @@ class MultiFile:
return
line
return
line
else
:
else
:
# Ignore trailing whitespace on marker lines
# Ignore trailing whitespace on marker lines
k
=
len
(
line
)
-
1
marker
=
line
.
rstrip
()
while
line
[
k
]
in
string
.
whitespace
:
k
=
k
-
1
marker
=
line
[:
k
+
1
]
# No? OK, try to match a boundary.
# No? OK, try to match a boundary.
# Return the line (unstripped) if we don't.
# Return the line (unstripped) if we don't.
for
i
in
range
(
len
(
self
.
stack
)):
for
i
in
range
(
len
(
self
.
stack
)):
...
@@ -121,7 +117,7 @@ class MultiFile:
...
@@ -121,7 +117,7 @@ class MultiFile:
return
list
return
list
def
read
(
self
):
# Note: no size argument -- read until EOF only!
def
read
(
self
):
# Note: no size argument -- read until EOF only!
return
s
tring
.
joinfields
(
self
.
readlines
(),
''
)
return
s
elf
.
readlines
()
.
join
(
''
)
def
next
(
self
):
def
next
(
self
):
while
self
.
readline
():
pass
while
self
.
readline
():
pass
...
...
Lib/string.py
Dosyayı görüntüle @
e37340ed
...
@@ -356,7 +356,7 @@ def maketrans(fromstr, tostr):
...
@@ -356,7 +356,7 @@ def maketrans(fromstr, tostr):
fromstr
=
map
(
ord
,
fromstr
)
fromstr
=
map
(
ord
,
fromstr
)
for
i
in
range
(
len
(
fromstr
)):
for
i
in
range
(
len
(
fromstr
)):
L
[
fromstr
[
i
]]
=
tostr
[
i
]
L
[
fromstr
[
i
]]
=
tostr
[
i
]
return
join
fields
(
L
,
""
)
return
join
(
L
,
""
)
# Substring replacement (global)
# Substring replacement (global)
def
replace
(
s
,
old
,
new
,
maxsplit
=-
1
):
def
replace
(
s
,
old
,
new
,
maxsplit
=-
1
):
...
...
Lib/stringold.py
Dosyayı görüntüle @
e37340ed
...
@@ -395,7 +395,7 @@ def maketrans(fromstr, tostr):
...
@@ -395,7 +395,7 @@ def maketrans(fromstr, tostr):
fromstr
=
map
(
ord
,
fromstr
)
fromstr
=
map
(
ord
,
fromstr
)
for
i
in
range
(
len
(
fromstr
)):
for
i
in
range
(
len
(
fromstr
)):
L
[
fromstr
[
i
]]
=
tostr
[
i
]
L
[
fromstr
[
i
]]
=
tostr
[
i
]
return
join
fields
(
L
,
""
)
return
join
(
L
,
""
)
# Substring replacement (global)
# Substring replacement (global)
def
replace
(
s
,
old
,
new
,
maxsplit
=
0
):
def
replace
(
s
,
old
,
new
,
maxsplit
=
0
):
...
...
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