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
c28592bb
Kaydet (Commit)
c28592bb
authored
Haz 24, 2016
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27186: Define what a "path-like object" is.
Thanks to Dusty Phillips for the initial patch.
üst
c78ca1e0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
glossary.rst
Doc/glossary.rst
+10
-0
os.rst
Doc/library/os.rst
+9
-7
No files found.
Doc/glossary.rst
Dosyayı görüntüle @
c28592bb
...
...
@@ -778,6 +778,16 @@ Glossary
One
of
the
default
:
term
:`
meta
path
finders
<
meta
path
finder
>`
which
searches
an
:
term
:`
import
path
`
for
modules
.
path
-
like
object
An
object
representing
a
file
system
path
.
A
path
-
like
object
is
either
a
:
class
:`
str
`
or
:
class
:`
bytes
`
object
representing
a
path
,
or
an
object
implementing
the
:
class
:`
os
.
PathLike
`
protocol
.
An
object
that
supports
the
:
class
:`
os
.
PathLike
`
protocol
can
be
converted
to
a
:
class
:`
str
`
or
:
class
:`
bytes
`
file
system
path
by
calling
the
:
func
:`
os
.
fspath
`
function
;
:
func
:`
os
.
fsdecode
`
and
:
func
:`
os
.
fsencode
`
can
be
used
to
guarantee
a
:
class
:`
str
`
or
:
class
:`
bytes
`
result
instead
,
respectively
.
Introduced
by
:
pep
:`
519
`.
portion
A
set
of
files
in
a
single
directory
(
possibly
stored
in
a
zip
file
)
that
contribute
to
a
namespace
package
,
as
defined
in
:
pep
:`
420
`.
...
...
Doc/library/os.rst
Dosyayı görüntüle @
c28592bb
...
...
@@ -171,8 +171,9 @@ process and user.
.. function:: fsencode(filename)
Encode *filename* to the filesystem encoding with ``'surrogateescape'``
error handler, or ``'strict'`` on Windows; return :class:`bytes` unchanged.
Encode :term:`path-like <path-like object>` *filename* to the filesystem
encoding with ``'surrogateescape'`` error handler, or ``'strict'`` on
Windows; return :class:`bytes` unchanged.
:func:`fsdecode` is the reverse function.
...
...
@@ -185,8 +186,9 @@ process and user.
.. function:: fsdecode(filename)
Decode *filename* from the filesystem encoding with ``'surrogateescape'``
error handler, or ``'strict'`` on Windows; return :class:`str` unchanged.
Decode the :term:`path-like <path-like object>` *filename* from the
filesystem encoding with ``'surrogateescape'`` error handler, or ``'strict'``
on Windows; return :class:`str` unchanged.
:func:`fsencode` is the reverse function.
...
...
@@ -2003,8 +2005,8 @@ features:
control over errors, you can catch :exc:`OSError` when calling one of the
``DirEntry`` methods and handle as appropriate.
To be directly usable as a
path-like object, ``DirEntry`` implements the
:class:`os.PathLike` interface.
To be directly usable as a
:term:`path-like object`, ``DirEntry`` implements
the
:class:`os.PathLike` interface.
Attributes and methods on a ``DirEntry`` instance are as follows:
...
...
@@ -2112,7 +2114,7 @@ features:
Note that there is a nice correspondence between several attributes
and methods of ``DirEntry`` and of :class:`pathlib.Path`. In
particular, the ``name`` a
nd ``path`` attributes have
the same
particular, the ``name`` a
ttribute has
the same
meaning, as do the ``is_dir()``, ``is_file()``, ``is_symlink()``
and ``stat()`` methods.
...
...
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