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
65ad043e
Kaydet (Commit)
65ad043e
authored
Eki 12, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1560179: speed up posixpath.(dir|base)name
üst
8134d06e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
posixpath.py
Lib/posixpath.py
+9
-4
No files found.
Lib/posixpath.py
Dosyayı görüntüle @
65ad043e
...
@@ -106,18 +106,23 @@ def splitdrive(p):
...
@@ -106,18 +106,23 @@ def splitdrive(p):
return
''
,
p
return
''
,
p
# Return the tail (basename) part of a path.
# Return the tail (basename) part of a path
, same as split(path)[1]
.
def
basename
(
p
):
def
basename
(
p
):
"""Returns the final component of a pathname"""
"""Returns the final component of a pathname"""
return
split
(
p
)[
1
]
i
=
p
.
rfind
(
'/'
)
+
1
return
p
[
i
:]
# Return the head (dirname) part of a path.
# Return the head (dirname) part of a path
, same as split(path)[0]
.
def
dirname
(
p
):
def
dirname
(
p
):
"""Returns the directory component of a pathname"""
"""Returns the directory component of a pathname"""
return
split
(
p
)[
0
]
i
=
p
.
rfind
(
'/'
)
+
1
head
=
p
[:
i
]
if
head
and
head
!=
'/'
*
len
(
head
):
head
=
head
.
rstrip
(
'/'
)
return
head
# Is a path a symbolic link?
# Is a path a symbolic link?
...
...
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