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
03e60619
Kaydet (Commit)
03e60619
authored
May 19, 2016
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Back out pathlib.Path.path attr. (Merge 3.5->3.6)
üst
7fa63787
387e6e38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
62 deletions
+0
-62
pathlib.rst
Doc/library/pathlib.rst
+0
-22
pathlib.py
Lib/pathlib.py
+0
-7
test_pathlib.py
Lib/test/test_pathlib.py
+0
-27
NEWS
Misc/NEWS
+0
-6
No files found.
Doc/library/pathlib.rst
Dosyayı görüntüle @
03e60619
...
...
@@ -365,28 +365,6 @@ Pure paths provide the following methods and properties:
''
.. data:: PurePath.path
A string representing the full path::
>>> PurePosixPath('my/library/setup.py').path
'my/library/setup.py'
This always returns the same value as ``str(p)``; it is included to
serve as a one-off protocol. Code that wants to support both
strings and ``pathlib.Path`` objects as filenames can write
``arg = getattr(arg, 'path', arg)`` to get the path as a string.
This can then be passed to various system calls or library
functions that expect a string. Unlike the alternative
``arg = str(arg)``, this will still raise an exception if an object
of some other type is given by accident.
A nice advantage is that this protocol is also supported by
:class:`os.DirEntry` objects returned by :func:`os.scandir`.
.. versionadded:: 3.4.5
.. versionadded:: 3.5.2
.. data:: PurePath.suffix
The file extension of the final component, if any::
...
...
Lib/pathlib.py
Dosyayı görüntüle @
03e60619
...
...
@@ -693,13 +693,6 @@ class PurePath(object):
self
.
_parts
)
or
'.'
return
self
.
_str
@property
def
path
(
self
):
try
:
return
self
.
_str
except
AttributeError
:
return
str
(
self
)
def
as_posix
(
self
):
"""Return the string representation of the path with forward (/)
slashes."""
...
...
Lib/test/test_pathlib.py
Dosyayı görüntüle @
03e60619
...
...
@@ -477,22 +477,6 @@ class _BasePurePathTest(object):
self
.
assertEqual
(
P
(
'a/b.py'
)
.
name
,
'b.py'
)
self
.
assertEqual
(
P
(
'/a/b.py'
)
.
name
,
'b.py'
)
def
test_path_common
(
self
):
P
=
self
.
cls
def
check
(
arg
,
expected
=
None
):
if
expected
is
None
:
expected
=
arg
self
.
assertEqual
(
P
(
arg
)
.
path
,
expected
.
replace
(
'/'
,
self
.
sep
))
check
(
''
,
'.'
)
check
(
'.'
)
check
(
'/'
)
check
(
'a/b'
)
check
(
'/a/b'
)
check
(
'/a/b/'
,
'/a/b'
)
check
(
'/a/b/.'
,
'/a/b'
)
check
(
'a/b.py'
)
check
(
'/a/b.py'
)
def
test_suffix_common
(
self
):
P
=
self
.
cls
self
.
assertEqual
(
P
(
''
)
.
suffix
,
''
)
...
...
@@ -915,17 +899,6 @@ class PureWindowsPathTest(_BasePurePathTest, unittest.TestCase):
self
.
assertEqual
(
P
(
'//My.py/Share.php'
)
.
name
,
''
)
self
.
assertEqual
(
P
(
'//My.py/Share.php/a/b'
)
.
name
,
'b'
)
def
test_path
(
self
):
P
=
self
.
cls
self
.
assertEqual
(
P
(
'c:'
)
.
path
,
'c:'
)
self
.
assertEqual
(
P
(
'c:/'
)
.
path
,
'c:
\\
'
)
self
.
assertEqual
(
P
(
'c:a/b'
)
.
path
,
'c:a
\\
b'
)
self
.
assertEqual
(
P
(
'c:/a/b'
)
.
path
,
'c:
\\
a
\\
b'
)
self
.
assertEqual
(
P
(
'c:a/b.py'
)
.
path
,
'c:a
\\
b.py'
)
self
.
assertEqual
(
P
(
'c:/a/b.py'
)
.
path
,
'c:
\\
a
\\
b.py'
)
self
.
assertEqual
(
P
(
'//My.py/Share.php'
)
.
path
,
'
\\\\
My.py
\\
Share.php
\\
'
)
self
.
assertEqual
(
P
(
'//My.py/Share.php/a/b'
)
.
path
,
'
\\\\
My.py
\\
Share.php
\\
a
\\
b'
)
def
test_suffix
(
self
):
P
=
self
.
cls
self
.
assertEqual
(
P
(
'c:'
)
.
suffix
,
''
)
...
...
Misc/NEWS
Dosyayı görüntüle @
03e60619
...
...
@@ -682,12 +682,6 @@ Library
-
Issue
#
25672
:
In
the
ssl
module
,
enable
the
SSL_MODE_RELEASE_BUFFERS
mode
option
if
it
is
safe
to
do
so
.
-
Issue
#
22570
:
Add
'path'
attribute
to
pathlib
.
Path
objects
,
returning
the
same
as
str
(),
to
make
it
more
similar
to
DirEntry
.
Library
code
can
now
write
getattr
(
p
,
'path'
,
p
)
to
get
the
path
as
a
string
from
a
Path
,
a
DirEntry
,
or
a
plain
string
.
This
is
essentially
a
small
one
-
off
protocol
.
-
Issue
#
26012
:
Don
't traverse into symlinks for ** pattern in
pathlib.Path.[r]glob().
...
...
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