Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
03cc5653
Commit
03cc5653
authored
Nov 26, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19793: Improved markup for True/False constants in pathlib documentation.
parent
687ff0ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
Doc/library/pathlib.rst
Doc/library/pathlib.rst
+28
-28
No files found.
Doc/library/pathlib.rst
View file @
03cc5653
...
...
@@ -439,9 +439,9 @@ Pure paths provide the following methods and properties:
.. method:: PurePath.is_reserved()
With :class:`PureWindowsPath`, return
True
if the path is considered
reserved under Windows,
False
otherwise. With :class:`PurePosixPath`,
False
is always returned.
With :class:`PureWindowsPath`, return
``True``
if the path is considered
reserved under Windows,
``False``
otherwise. With :class:`PurePosixPath`,
``False``
is always returned.
>>> PureWindowsPath('nul').is_reserved()
True
...
...
@@ -469,8 +469,8 @@ Pure paths provide the following methods and properties:
.. method:: PurePath.match(pattern)
Match this path against the provided glob-style pattern. Return
True
if matching is successful,
False
otherwise.
Match this path against the provided glob-style pattern. Return
``True``
if matching is successful,
``False``
otherwise.
If *pattern* is relative, the path can be either relative or absolute,
and matching is done from the right::
...
...
@@ -661,63 +661,63 @@ call fails (for example because the path doesn't exist):
.. method:: Path.is_dir()
Return
True
if the path points to a directory (or a symbolic link
pointing to a directory),
False
if it points to another kind of file.
Return
``True``
if the path points to a directory (or a symbolic link
pointing to a directory),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
.. method:: Path.is_file()
Return
True
if the path points to a regular file (or a symbolic link
pointing to a regular file),
False
if it points to another kind of file.
Return
``True``
if the path points to a regular file (or a symbolic link
pointing to a regular file),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
.. method:: Path.is_symlink()
Return
True if the path points to a symbolic link, False
otherwise.
Return
``True`` if the path points to a symbolic link, ``False``
otherwise.
False
is also returned if the path doesn't exist; other errors (such
``False``
is also returned if the path doesn't exist; other errors (such
as permission errors) are propagated.
.. method:: Path.is_socket()
Return
True
if the path points to a Unix socket (or a symbolic link
pointing to a Unix socket),
False
if it points to another kind of file.
Return
``True``
if the path points to a Unix socket (or a symbolic link
pointing to a Unix socket),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
.. method:: Path.is_fifo()
Return
True
if the path points to a FIFO (or a symbolic link
pointing to a FIFO),
False
if it points to another kind of file.
Return
``True``
if the path points to a FIFO (or a symbolic link
pointing to a FIFO),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
.. method:: Path.is_block_device()
Return
True
if the path points to a block device (or a symbolic link
pointing to a block device),
False
if it points to another kind of file.
Return
``True``
if the path points to a block device (or a symbolic link
pointing to a block device),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
.. method:: Path.is_char_device()
Return
True
if the path points to a character device (or a symbolic link
pointing to a character device),
False
if it points to another kind of file.
Return
``True``
if the path points to a character device (or a symbolic link
pointing to a character device),
``False``
if it points to another kind of file.
False
is also returned if the path doesn't exist or is a broken symlink;
``False``
is also returned if the path doesn't exist or is a broken symlink;
other errors (such as permission errors) are propagated.
...
...
@@ -755,8 +755,8 @@ call fails (for example because the path doesn't exist):
combined with the process' ``umask`` value to determine the file mode
and access flags. If the path already exists, :exc:`OSError` is raised.
If *parents* is
T
rue, any missing parents of this path are created
as needed. If *parents* is
F
alse (the default), a missing parent raises
If *parents* is
t
rue, any missing parents of this path are created
as needed. If *parents* is
f
alse (the default), a missing parent raises
:exc:`OSError`.
...
...
@@ -841,7 +841,7 @@ call fails (for example because the path doesn't exist):
.. method:: Path.symlink_to(target, target_is_directory=False)
Make this path a symbolic link to *target*. Under Windows,
*target_is_directory* must be
True (default False
) if the link's target
*target_is_directory* must be
true (default ``False``
) if the link's target
is a directory. Under POSIX, *target_is_directory*'s value is ignored.
>>> p = Path('mylink')
...
...
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