chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5c9c384d-c0f2-4688-88b7-f5bc9ea32939 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,128 | supabase-export-v2 | 558b80256d822e01 | A wrapper around a low-level, cross-interpreter queue, which implements the :class:`queue.Queue` interface. The underlying queue can only be created through :func:`create_queue`.
Some objects are actually shared and some are copied efficiently,
but most are copied via :mod:`pickle`. See :ref:`interp-object-sharing`. | trusted_official_docs | CPython Docs | A wrapper around a low-level, cross-interpreter queue, which implements the :class:`queue.Queue` interface. The underlying queue can only be created through :func:`create_queue`.
Some objects are actually shared and some are copied efficiently,
but most are copied via :mod:`pickle`. See :ref:`interp-object-sharing`. | A wrapper around a low-level, cross-interpreter queue, which implements the :class:`queue.Queue` interface. The underlying queue can only be created through :func:`create_queue`.
Some objects are actually shared and some are copied efficiently,
but most are copied via :mod:`pickle`. See :ref:`interp-object-sharing`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6353ad9b-f170-4aa5-8dc3-1dff95ef9468 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,066 | supabase-export-v2 | 2c7a27405477787d | take with async or threads. It's a similar concurrency model to CSP or the actor model, a model which is relatively easy to reason about.
You can take advantage of that concurrency model in a single thread,
switching back and forth between interpreters, Stackless-style. However, this model is more useful when you combi... | trusted_official_docs | CPython Docs | take with async or threads. It's a similar concurrency model to CSP or the actor model, a model which is relatively easy to reason about.
You can take advantage of that concurrency model in a single thread,
switching back and forth between interpreters, Stackless-style. However, this model is more useful when you combi... | take with async or threads. It's a similar concurrency model to CSP or the actor model, a model which is relatively easy to reason about.
You can take advantage of that concurrency model in a single thread,
switching back and forth between interpreters, Stackless-style. However, this model is more useful when you combi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6444c3b2-41ce-4887-bc78-024af9642ee5 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,078 | supabase-export-v2 | 9ad544ca59d9b369 | * :const:`None` * :class:`bool` (:const:`True` and :const:`False`) * :class:`bytes` * :class:`str` * :class:`int` * :class:`float` * :class:`tuple` (of similarly supported objects)
There is a small number of Python types that actually share mutable
data between interpreters: | trusted_official_docs | CPython Docs | * :const:`None` * :class:`bool` (:const:`True` and :const:`False`) * :class:`bytes` * :class:`str` * :class:`int` * :class:`float` * :class:`tuple` (of similarly supported objects)
There is a small number of Python types that actually share mutable
data between interpreters: | * :const:`None` * :class:`bool` (:const:`True` and :const:`False`) * :class:`bytes` * :class:`str` * :class:`int` * :class:`float` * :class:`tuple` (of similarly supported objects)
There is a small number of Python types that actually share mutable
data between interpreters: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7fd5e925-0baa-4844-bc1f-e4f18c4c2111 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,076 | supabase-export-v2 | 529173c000ee83c2 | thread-safety means objects can't actually be shared, with a few exceptions. Instead, a copy must be created, which means mutable objects won't stay in sync.
By default, most objects are copied with :mod:`pickle` when they are
passed to another interpreter. Nearly all of the immutable builtin
objects are either directl... | trusted_official_docs | CPython Docs | thread-safety means objects can't actually be shared, with a few exceptions. Instead, a copy must be created, which means mutable objects won't stay in sync.
By default, most objects are copied with :mod:`pickle` when they are
passed to another interpreter. Nearly all of the immutable builtin
objects are either directl... | thread-safety means objects can't actually be shared, with a few exceptions. Instead, a copy must be created, which means mutable objects won't stay in sync.
By default, most objects are copied with :mod:`pickle` when they are
passed to another interpreter. Nearly all of the immutable builtin
objects are either directl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
801175be-d288-44db-96f4-6c27ae5202ee | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,050 | supabase-export-v2 | 665f1819bce247bc | Introduction ------------
An "interpreter" is effectively the execution context of the Python
runtime. It contains all of the state the runtime needs to execute
a program. This includes things like the import state and builtins. (Each thread, even if there's only the main thread, has some extra
runtime state, in additi... | trusted_official_docs | CPython Docs | Introduction ------------
An "interpreter" is effectively the execution context of the Python
runtime. It contains all of the state the runtime needs to execute
a program. This includes things like the import state and builtins. (Each thread, even if there's only the main thread, has some extra
runtime state, in additi... | Introduction ------------
An "interpreter" is effectively the execution context of the Python
runtime. It contains all of the state the runtime needs to execute
a program. This includes things like the import state and builtins. (Each thread, even if there's only the main thread, has some extra
runtime state, in additi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9cf52ff1-caa2-4977-8d40-b1baa03cf0a1 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,055 | supabase-export-v2 | ea9fb229db5f3419 | process. CPython has this support. Each interpreter is effectively isolated from the others (with a limited number of carefully managed process-global exceptions to the rule).
That isolation is primarily useful as a strong separation between
distinct logical components of a program, where you want to have
careful contr... | trusted_official_docs | CPython Docs | process. CPython has this support. Each interpreter is effectively isolated from the others (with a limited number of carefully managed process-global exceptions to the rule).
That isolation is primarily useful as a strong separation between
distinct logical components of a program, where you want to have
careful contr... | process. CPython has this support. Each interpreter is effectively isolated from the others (with a limited number of carefully managed process-global exceptions to the rule).
That isolation is primarily useful as a strong separation between
distinct logical components of a program, where you want to have
careful contr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ac1c3b30-7f38-446e-bd4b-5f4eff83556c | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,067 | supabase-export-v2 | db70be5a62f0bb70 | you combine interpreters with multiple threads. This mostly involves starting a new thread, where you switch to another interpreter and run what you want there.
Each actual thread in Python, even if you're only running in the main
thread, has its own *current* execution context. Multiple threads can
use the same interp... | trusted_official_docs | CPython Docs | you combine interpreters with multiple threads. This mostly involves starting a new thread, where you switch to another interpreter and run what you want there.
Each actual thread in Python, even if you're only running in the main
thread, has its own *current* execution context. Multiple threads can
use the same interp... | you combine interpreters with multiple threads. This mostly involves starting a new thread, where you switch to another interpreter and run what you want there.
Each actual thread in Python, even if you're only running in the main
thread, has its own *current* execution context. Multiple threads can
use the same interp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
acf442fc-5c81-4fcb-92ec-cc269a2f6463 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,071 | supabase-export-v2 | a04f2e23242600f3 | Communication Between Interpreters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In practice, multiple interpreters are useful only if we have a way
to communicate between them. This usually involves some form of
message passing, but can even mean sharing data in some carefully
managed way. | trusted_official_docs | CPython Docs | Communication Between Interpreters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In practice, multiple interpreters are useful only if we have a way
to communicate between them. This usually involves some form of
message passing, but can even mean sharing data in some carefully
managed way. | Communication Between Interpreters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In practice, multiple interpreters are useful only if we have a way
to communicate between them. This usually involves some form of
message passing, but can even mean sharing data in some carefully
managed way. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
af3dd763-fc60-4aa2-bc02-726508104459 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,075 | supabase-export-v2 | c5d199dff7237dc2 | "Sharing" Objects ^^^^^^^^^^^^^^^^^
Any data actually shared between interpreters loses the thread-safety
provided by the :term:`GIL`. There are various options for dealing with
this in extension modules. However, from Python code the lack of
thread-safety means objects can't actually be shared, with a few
exceptions. ... | trusted_official_docs | CPython Docs | "Sharing" Objects ^^^^^^^^^^^^^^^^^
Any data actually shared between interpreters loses the thread-safety
provided by the :term:`GIL`. There are various options for dealing with
this in extension modules. However, from Python code the lack of
thread-safety means objects can't actually be shared, with a few
exceptions. ... | "Sharing" Objects ^^^^^^^^^^^^^^^^^
Any data actually shared between interpreters loses the thread-safety
provided by the :term:`GIL`. There are various options for dealing with
this in extension modules. However, from Python code the lack of
thread-safety means objects can't actually be shared, with a few
exceptions. ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3080124-7fb1-4396-8365-52e309064e0e | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,061 | supabase-export-v2 | 3ec7d48ec2fe7098 | started for the operation. There is `a helper <interp-call-in-thread_>`_ for that though. There is another dedicated helper for calling the builtin :func:`exec` in an interpreter.
When :func:`exec` (or :func:`eval`) are called in an interpreter,
they run using the interpreter's :mod:`!__main__` module as the
"globals" ... | trusted_official_docs | CPython Docs | started for the operation. There is `a helper <interp-call-in-thread_>`_ for that though. There is another dedicated helper for calling the builtin :func:`exec` in an interpreter.
When :func:`exec` (or :func:`eval`) are called in an interpreter,
they run using the interpreter's :mod:`!__main__` module as the
"globals" ... | started for the operation. There is `a helper <interp-call-in-thread_>`_ for that though. There is another dedicated helper for calling the builtin :func:`exec` in an interpreter.
When :func:`exec` (or :func:`eval`) are called in an interpreter,
they run using the interpreter's :mod:`!__main__` module as the
"globals" ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b61845b2-2b6f-458e-baf3-754012853777 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,058 | supabase-export-v2 | ab0c3485b9ac3fcf | but extension modules may easily violate that. Therefore, do not use multiple interpreters in security-sensitive situations, where they shouldn't have access to each other's data.
Running in an Interpreter
^^^^^^^^^^^^^^^^^^^^^^^^^ | trusted_official_docs | CPython Docs | but extension modules may easily violate that. Therefore, do not use multiple interpreters in security-sensitive situations, where they shouldn't have access to each other's data.
Running in an Interpreter
^^^^^^^^^^^^^^^^^^^^^^^^^ | but extension modules may easily violate that. Therefore, do not use multiple interpreters in security-sensitive situations, where they shouldn't have access to each other's data.
Running in an Interpreter
^^^^^^^^^^^^^^^^^^^^^^^^^ | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
be59465f-4f9a-4f1b-8e20-fe5d02c06bcf | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,060 | supabase-export-v2 | 2fbc378eb2f93cef | the function using the current interpreter's state. The :mod:`!concurrent.interpreters` module provides a basic API for creating and managing interpreters, as well as the switch-and-call operation.
No other threads are automatically started for the operation. There is `a helper <interp-call-in-thread_>`_ for that thoug... | trusted_official_docs | CPython Docs | the function using the current interpreter's state. The :mod:`!concurrent.interpreters` module provides a basic API for creating and managing interpreters, as well as the switch-and-call operation.
No other threads are automatically started for the operation. There is `a helper <interp-call-in-thread_>`_ for that thoug... | the function using the current interpreter's state. The :mod:`!concurrent.interpreters` module provides a basic API for creating and managing interpreters, as well as the switch-and-call operation.
No other threads are automatically started for the operation. There is `a helper <interp-call-in-thread_>`_ for that thoug... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf671752-7b9f-4b07-9cc2-d4fef8b77f25 | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,068 | supabase-export-v2 | aaf50fcf7a791fa8 | even if you're only running in the main thread, has its own *current* execution context. Multiple threads can use the same interpreter or different ones.
At a high level, you can think of the combination of threads and
interpreters as threads with opt-in sharing. | trusted_official_docs | CPython Docs | even if you're only running in the main thread, has its own *current* execution context. Multiple threads can use the same interpreter or different ones.
At a high level, you can think of the combination of threads and
interpreters as threads with opt-in sharing. | even if you're only running in the main thread, has its own *current* execution context. Multiple threads can use the same interpreter or different ones.
At a high level, you can think of the combination of threads and
interpreters as threads with opt-in sharing. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c76d5b67-0f26-423d-ad90-7c167fcca31a | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,065 | supabase-export-v2 | 2a0e99a6e6c863a0 | execution context the runtime will use *in the current thread*. That isolation makes them similar to processes, but they still enjoy in-process efficiency, like threads.
All that said, interpreters do naturally support certain flavors of
concurrency. There's a powerful side effect of that isolation. It enables a
differ... | trusted_official_docs | CPython Docs | execution context the runtime will use *in the current thread*. That isolation makes them similar to processes, but they still enjoy in-process efficiency, like threads.
All that said, interpreters do naturally support certain flavors of
concurrency. There's a powerful side effect of that isolation. It enables a
differ... | execution context the runtime will use *in the current thread*. That isolation makes them similar to processes, but they still enjoy in-process efficiency, like threads.
All that said, interpreters do naturally support certain flavors of
concurrency. There's a powerful side effect of that isolation. It enables a
differ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce3cba24-2b9c-47a7-826a-1cc81541609c | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,059 | supabase-export-v2 | e7c2415a18eebd18 | Running in an Interpreter ^^^^^^^^^^^^^^^^^^^^^^^^^
Running in a different interpreter involves switching to it in the
current thread and then calling some function. The runtime will
execute the function using the current interpreter's state. The
:mod:`!concurrent.interpreters` module provides a basic API for
creating ... | trusted_official_docs | CPython Docs | Running in an Interpreter ^^^^^^^^^^^^^^^^^^^^^^^^^
Running in a different interpreter involves switching to it in the
current thread and then calling some function. The runtime will
execute the function using the current interpreter's state. The
:mod:`!concurrent.interpreters` module provides a basic API for
creating ... | Running in an Interpreter ^^^^^^^^^^^^^^^^^^^^^^^^^
Running in a different interpreter involves switching to it in the
current thread and then calling some function. The runtime will
execute the function using the current interpreter's state. The
:mod:`!concurrent.interpreters` module provides a basic API for
creating ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d676eaea-6f37-4077-9585-0b5ecb39f8dd | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,087 | supabase-export-v2 | bd7b1c507d098004 | .. function:: get_main()
Return an :class:`Interpreter` object for the main interpreter. This is the interpreter the runtime created to run the :term:`REPL`
or the script given at the command-line. It is usually the only one. | trusted_official_docs | CPython Docs | .. function:: get_main()
Return an :class:`Interpreter` object for the main interpreter. This is the interpreter the runtime created to run the :term:`REPL`
or the script given at the command-line. It is usually the only one. | .. function:: get_main()
Return an :class:`Interpreter` object for the main interpreter. This is the interpreter the runtime created to run the :term:`REPL`
or the script given at the command-line. It is usually the only one. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb4ea355-f929-426e-b7eb-34198505201f | CPython Docs | file://datasets/cpython/Doc/library/concurrent.interpreters.rst | unknown | 346dc6a4-67bd-4c03-81c6-10d33b9ff43f | 27,036 | supabase-export-v2 | a47e7be2766fa8bc | The :mod:`!concurrent.interpreters` module constructs higher-level interfaces on top of the lower level :mod:`!_interpreters` module.
The module is primarily meant to provide a basic API for managing
interpreters (AKA "subinterpreters") and running things in them. Running mostly involves switching to an interpreter (in... | trusted_official_docs | CPython Docs | The :mod:`!concurrent.interpreters` module constructs higher-level interfaces on top of the lower level :mod:`!_interpreters` module.
The module is primarily meant to provide a basic API for managing
interpreters (AKA "subinterpreters") and running things in them. Running mostly involves switching to an interpreter (in... | The :mod:`!concurrent.interpreters` module constructs higher-level interfaces on top of the lower level :mod:`!_interpreters` module.
The module is primarily meant to provide a basic API for managing
interpreters (AKA "subinterpreters") and running things in them. Running mostly involves switching to an interpreter (in... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01144210-79f7-40e2-9ecf-b335fdc845a3 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,626 | supabase-export-v2 | 4aca8011a29040f6 | In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added to the pattern to match only directories.
.. versionchanged:: 3.11
Globbing with a pattern that ends with a pathname components separator
(:data:`~os.sep` or :data:`~os.altsep`) returns only directories. | trusted_official_docs | CPython Docs | In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added to the pattern to match only directories.
.. versionchanged:: 3.11
Globbing with a pattern that ends with a pathname components separator
(:data:`~os.sep` or :data:`~os.altsep`) returns only directories. | In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added to the pattern to match only directories.
.. versionchanged:: 3.11
Globbing with a pattern that ends with a pathname components separator
(:data:`~os.sep` or :data:`~os.altsep`) returns only directories. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
020b491f-c89b-430f-85d6-adeb0c4c6c78 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,385 | supabase-export-v2 | fea4e7f174686807 | .. classmethod:: Path.home()
Return a new path object representing the user's home directory (as
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
directory can't be resolved, :exc:`RuntimeError` is raised. | trusted_official_docs | CPython Docs | .. classmethod:: Path.home()
Return a new path object representing the user's home directory (as
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
directory can't be resolved, :exc:`RuntimeError` is raised. | .. classmethod:: Path.home()
Return a new path object representing the user's home directory (as
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
directory can't be resolved, :exc:`RuntimeError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0432a214-07a0-4949-b897-68c8f77e230f | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,455 | supabase-export-v2 | 922f42f62c6e54d0 | .. method:: Path.is_char_device()
Return ``True`` if the path points to a character device. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a character device. Use :meth:`Path.stat` to
distinguish between these cases. | trusted_official_docs | CPython Docs | .. method:: Path.is_char_device()
Return ``True`` if the path points to a character device. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a character device. Use :meth:`Path.stat` to
distinguish between these cases. | .. method:: Path.is_char_device()
Return ``True`` if the path points to a character device. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a character device. Use :meth:`Path.stat` to
distinguish between these cases. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
067b641a-27f8-4c55-9119-b5a70bd09411 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,207 | supabase-export-v2 | 64453e501cc40ac0 | Paths are immutable and :term:`hashable`. Paths of a same flavour are comparable and orderable. These properties respect the flavour's case-folding semantics::
>>> PurePosixPath('foo') == PurePosixPath('FOO')
False
>>> PureWindowsPath('foo') == PureWindowsPath('FOO')
True
>>> PureWindowsPath('FOO') in { PureWindows... | trusted_official_docs | CPython Docs | Paths are immutable and :term:`hashable`. Paths of a same flavour are comparable and orderable. These properties respect the flavour's case-folding semantics::
>>> PurePosixPath('foo') == PurePosixPath('FOO')
False
>>> PureWindowsPath('foo') == PureWindowsPath('FOO')
True
>>> PureWindowsPath('FOO') in { PureWindows... | Paths are immutable and :term:`hashable`. Paths of a same flavour are comparable and orderable. These properties respect the flavour's case-folding semantics::
>>> PurePosixPath('foo') == PurePosixPath('FOO')
False
>>> PureWindowsPath('foo') == PureWindowsPath('FOO')
True
>>> PureWindowsPath('FOO') in { PureWindows... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
068b8d71-ff93-4453-bc9a-4b0449c0162e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,323 | supabase-export-v2 | ffa63558b4cee316 | This can impact the *walk_up* option as it assumes that no symlinks are present in the path; call :meth:`~Path.resolve` first if necessary to resolve symlinks.
.. versionchanged:: 3.12
The *walk_up* parameter was added (old behavior is the same as ``walk_up=False``). | trusted_official_docs | CPython Docs | This can impact the *walk_up* option as it assumes that no symlinks are present in the path; call :meth:`~Path.resolve` first if necessary to resolve symlinks.
.. versionchanged:: 3.12
The *walk_up* parameter was added (old behavior is the same as ``walk_up=False``). | This can impact the *walk_up* option as it assumes that no symlinks are present in the path; call :meth:`~Path.resolve` first if necessary to resolve symlinks.
.. versionchanged:: 3.12
The *walk_up* parameter was added (old behavior is the same as ``walk_up=False``). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06c5e300-4e65-46f0-92f6-89fe3641a631 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,321 | supabase-export-v2 | 7979930d1247ab48 | true, ``..`` entries may be added to form the relative path. In all other cases, such as the paths referencing different drives, :exc:`ValueError` is raised.::
>>> p.relative_to('/usr', walk_up=True)
PurePosixPath('../etc/passwd')
>>> p.relative_to('foo', walk_up=True)
Traceback (most recent call last):
File "<stdi... | trusted_official_docs | CPython Docs | true, ``..`` entries may be added to form the relative path. In all other cases, such as the paths referencing different drives, :exc:`ValueError` is raised.::
>>> p.relative_to('/usr', walk_up=True)
PurePosixPath('../etc/passwd')
>>> p.relative_to('foo', walk_up=True)
Traceback (most recent call last):
File "<stdi... | true, ``..`` entries may be added to form the relative path. In all other cases, such as the paths referencing different drives, :exc:`ValueError` is raised.::
>>> p.relative_to('/usr', walk_up=True)
PurePosixPath('../etc/passwd')
>>> p.relative_to('foo', walk_up=True)
Traceback (most recent call last):
File "<stdi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08909196-2556-442e-ac11-c082a58b72f1 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,503 | supabase-export-v2 | 5ed4624ced36b251 | .. seealso:: :ref:`pathlib-pattern-language` documentation.
By default, or when the *case_sensitive* keyword-only argument is set to
``None``, this method matches paths using platform-specific casing rules:
typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``Fals... | trusted_official_docs | CPython Docs | .. seealso:: :ref:`pathlib-pattern-language` documentation.
By default, or when the *case_sensitive* keyword-only argument is set to
``None``, this method matches paths using platform-specific casing rules:
typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``Fals... | .. seealso:: :ref:`pathlib-pattern-language` documentation.
By default, or when the *case_sensitive* keyword-only argument is set to
``None``, this method matches paths using platform-specific casing rules:
typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``Fals... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c2f94fa-7bf1-4bd8-86ee-7b18043bd151 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,464 | supabase-export-v2 | 12d38adade2504fd | = Path('src') >>> if p.info.is_symlink(): ... print('symlink') ... elif p.info.is_dir(): ... print('directory') ... elif p.info.exists(): ... print('something else') ... else: ... print('not found') ... directory
If the path was generated from :meth:`Path.iterdir` then this attribute is
initialized with some informati... | trusted_official_docs | CPython Docs | = Path('src') >>> if p.info.is_symlink(): ... print('symlink') ... elif p.info.is_dir(): ... print('directory') ... elif p.info.exists(): ... print('something else') ... else: ... print('not found') ... directory
If the path was generated from :meth:`Path.iterdir` then this attribute is
initialized with some informati... | = Path('src') >>> if p.info.is_symlink(): ... print('symlink') ... elif p.info.is_dir(): ... print('directory') ... elif p.info.exists(): ... print('something else') ... else: ... print('not found') ... directory
If the path was generated from :meth:`Path.iterdir` then this attribute is
initialized with some informati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ceeeb66-fe1f-4878-a480-4bdaed965ce0 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,501 | supabase-export-v2 | 4ef77674cebdda8f | >>> sorted(Path('.').glob('*.py')) [PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')] >>> sorted(Path('.').glob('*/*.py')) [PosixPath('docs/conf.py')] >>> sorted(Path('.').glob('**/*.py')) [PosixPath('build/lib/pathlib.py'), PosixPath('docs/conf.py'), PosixPath('pathlib.py'), PosixPath('setu... | trusted_official_docs | CPython Docs | >>> sorted(Path('.').glob('*.py')) [PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')] >>> sorted(Path('.').glob('*/*.py')) [PosixPath('docs/conf.py')] >>> sorted(Path('.').glob('**/*.py')) [PosixPath('build/lib/pathlib.py'), PosixPath('docs/conf.py'), PosixPath('pathlib.py'), PosixPath('setu... | >>> sorted(Path('.').glob('*.py')) [PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')] >>> sorted(Path('.').glob('*/*.py')) [PosixPath('docs/conf.py')] >>> sorted(Path('.').glob('**/*.py')) [PosixPath('build/lib/pathlib.py'), PosixPath('docs/conf.py'), PosixPath('pathlib.py'), PosixPath('setu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f29077b-e457-4d32-83be-62a317558793 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,193 | supabase-export-v2 | 055e3f23bbfa715b | (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to another directory)
Pure path objects implement the :class:`os.PathLike` interface, allowing them
to be used anywhere the interface is accepted. | trusted_official_docs | CPython Docs | (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to another directory)
Pure path objects implement the :class:`os.PathLike` interface, allowing them
to be used anywhere the interface is accepted. | (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to another directory)
Pure path objects implement the :class:`os.PathLike` interface, allowing them
to be used anywhere the interface is accepted. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f3508f8-00cb-49fb-a1a3-e04c247f1641 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,419 | supabase-export-v2 | b701ae55b09dec35 | Return an :class:`os.stat_result` object containing information about this path, like :func:`os.stat`. The result is looked up at each call to this method.
This method normally follows symlinks; to stat a symlink add the argument
``follow_symlinks=False``, or use :meth:`~Path.lstat`. | trusted_official_docs | CPython Docs | Return an :class:`os.stat_result` object containing information about this path, like :func:`os.stat`. The result is looked up at each call to this method.
This method normally follows symlinks; to stat a symlink add the argument
``follow_symlinks=False``, or use :meth:`~Path.lstat`. | Return an :class:`os.stat_result` object containing information about this path, like :func:`os.stat`. The result is looked up at each call to this method.
This method normally follows symlinks; to stat a symlink add the argument
``follow_symlinks=False``, or use :meth:`~Path.lstat`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f8d6338-9484-4f41-b969-88148cfdca40 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,302 | supabase-export-v2 | ad97e89dc39c6512 | Calling this method is equivalent to combining the path with each of the given *pathsegments* in turn::
>>> PurePosixPath('/etc').joinpath('passwd')
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath('init.d', 'apa... | trusted_official_docs | CPython Docs | Calling this method is equivalent to combining the path with each of the given *pathsegments* in turn::
>>> PurePosixPath('/etc').joinpath('passwd')
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath('init.d', 'apa... | Calling this method is equivalent to combining the path with each of the given *pathsegments* in turn::
>>> PurePosixPath('/etc').joinpath('passwd')
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath(PurePosixPath('passwd'))
PurePosixPath('/etc/passwd')
>>> PurePosixPath('/etc').joinpath('init.d', 'apa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11de62cf-ff9c-4fb5-ad6d-06e55f09f89f | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,525 | supabase-export-v2 | 71b10f531fef177c | walked bottom-up). No matter the value of *top_down*, the list of subdirectories is retrieved before the triples for the directory and its subdirectories are walked.
When *top_down* is true, the caller can modify the *dirnames* list in-place
(for example, using :keyword:`del` or slice assignment), and :meth:`Path.walk... | trusted_official_docs | CPython Docs | walked bottom-up). No matter the value of *top_down*, the list of subdirectories is retrieved before the triples for the directory and its subdirectories are walked.
When *top_down* is true, the caller can modify the *dirnames* list in-place
(for example, using :keyword:`del` or slice assignment), and :meth:`Path.walk... | walked bottom-up). No matter the value of *top_down*, the list of subdirectories is retrieved before the triples for the directory and its subdirectories are walked.
When *top_down* is true, the caller can modify the *dirnames* list in-place
(for example, using :keyword:`del` or slice assignment), and :meth:`Path.walk... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11e95001-c62b-4b37-a6a4-310a7456d6f1 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,374 | supabase-export-v2 | 2feb8ea79d60f6e7 | >>> p = Path.from_uri('file:////server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file://///server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file:c:/windows') WindowsPath('c:/windows') >>> p = Path.from_uri('file:/c|/windows') WindowsPath('c:/windows')
:exc:`ValueError` is raised if... | trusted_official_docs | CPython Docs | >>> p = Path.from_uri('file:////server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file://///server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file:c:/windows') WindowsPath('c:/windows') >>> p = Path.from_uri('file:/c|/windows') WindowsPath('c:/windows')
:exc:`ValueError` is raised if... | >>> p = Path.from_uri('file:////server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file://///server/share') WindowsPath('//server/share') >>> p = Path.from_uri('file:c:/windows') WindowsPath('c:/windows') >>> p = Path.from_uri('file:/c|/windows') WindowsPath('c:/windows')
:exc:`ValueError` is raised if... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
14015133-4e8a-4df3-bce9-11408c4b84f6 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,345 | supabase-export-v2 | 74e22339b4af51e2 | Concrete paths --------------
Concrete paths are subclasses of the pure path classes. In addition to
operations provided by the latter, they also provide methods to do system
calls on path objects. There are three ways to instantiate concrete paths: | trusted_official_docs | CPython Docs | Concrete paths --------------
Concrete paths are subclasses of the pure path classes. In addition to
operations provided by the latter, they also provide methods to do system
calls on path objects. There are three ways to instantiate concrete paths: | Concrete paths --------------
Concrete paths are subclasses of the pure path classes. In addition to
operations provided by the latter, they also provide methods to do system
calls on path objects. There are three ways to instantiate concrete paths: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
14cbd2cd-246c-456c-8877-1e9b758c1a41 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,545 | supabase-export-v2 | a4bf4693519afb54 | of this path are created as needed; they are created with the default permissions without taking *mode* into account (mimicking the POSIX ``mkdir -p`` command).
If *parents* is false (the default), a missing parent raises
:exc:`FileNotFoundError`. | trusted_official_docs | CPython Docs | of this path are created as needed; they are created with the default permissions without taking *mode* into account (mimicking the POSIX ``mkdir -p`` command).
If *parents* is false (the default), a missing parent raises
:exc:`FileNotFoundError`. | of this path are created as needed; they are created with the default permissions without taking *mode* into account (mimicking the POSIX ``mkdir -p`` command).
If *parents* is false (the default), a missing parent raises
:exc:`FileNotFoundError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15c9d8ce-3ac0-4425-a0ef-af7ad8a2403e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,192 | supabase-export-v2 | c6a738aca62c4ab6 | >>> PurePath('foo//bar') PurePosixPath('foo/bar') >>> PurePath('//foo/bar') PurePosixPath('//foo/bar') >>> PurePath('foo/./bar') PurePosixPath('foo/bar') >>> PurePath('foo/../bar') PurePosixPath('foo/../bar')
(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent
to ``PurePosixPath('bar')``, which is ... | trusted_official_docs | CPython Docs | >>> PurePath('foo//bar') PurePosixPath('foo/bar') >>> PurePath('//foo/bar') PurePosixPath('//foo/bar') >>> PurePath('foo/./bar') PurePosixPath('foo/bar') >>> PurePath('foo/../bar') PurePosixPath('foo/../bar')
(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent
to ``PurePosixPath('bar')``, which is ... | >>> PurePath('foo//bar') PurePosixPath('foo/bar') >>> PurePath('//foo/bar') PurePosixPath('//foo/bar') >>> PurePath('foo/./bar') PurePosixPath('foo/bar') >>> PurePath('foo/../bar') PurePosixPath('foo/../bar')
(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent
to ``PurePosixPath('bar')``, which is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1612de56-e4b0-44a0-b41d-8bb48cec9072 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,535 | supabase-export-v2 | fc1e64cc02c88693 | dirs, files in Path("cpython/Lib/concurrent").walk(on_error=print): print( root, "consumes", sum((root / file).stat().st_size for file in files), "bytes in", len(files), "non-directory files" ) if '__pycache__' in dirs: dirs.remove('__pycache__')
This next example is a simple implementation of :func:`shutil.rmtree`. Wa... | trusted_official_docs | CPython Docs | dirs, files in Path("cpython/Lib/concurrent").walk(on_error=print): print( root, "consumes", sum((root / file).stat().st_size for file in files), "bytes in", len(files), "non-directory files" ) if '__pycache__' in dirs: dirs.remove('__pycache__')
This next example is a simple implementation of :func:`shutil.rmtree`. Wa... | dirs, files in Path("cpython/Lib/concurrent").walk(on_error=print): print( root, "consumes", sum((root / file).stat().st_size for file in files), "bytes in", len(files), "non-directory files" ) if '__pycache__' in dirs: dirs.remove('__pycache__')
This next example is a simple implementation of :func:`shutil.rmtree`. Wa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18de0c85-b2b5-4789-aa0c-e22f7fb9946c | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,462 | supabase-export-v2 | 94f6bffa39d08648 | .. attribute:: Path.info
A :class:`~pathlib.types.PathInfo` object that supports querying file type
information. The object exposes methods that cache their results, which can
help reduce the number of system calls needed when switching on file type. For example:: | trusted_official_docs | CPython Docs | .. attribute:: Path.info
A :class:`~pathlib.types.PathInfo` object that supports querying file type
information. The object exposes methods that cache their results, which can
help reduce the number of system calls needed when switching on file type. For example:: | .. attribute:: Path.info
A :class:`~pathlib.types.PathInfo` object that supports querying file type
information. The object exposes methods that cache their results, which can
help reduce the number of system calls needed when switching on file type. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1b3ca56e-1d1a-4593-99af-5e895e9fd046 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,160 | supabase-export-v2 | 6ae71d8ef3691810 | without actually accessing the OS. In this case, instantiating one of the pure classes may be useful since those simply don't have any OS-accessing operations.
.. seealso::
:pep:`428`: The pathlib module -- object-oriented filesystem paths. | trusted_official_docs | CPython Docs | without actually accessing the OS. In this case, instantiating one of the pure classes may be useful since those simply don't have any OS-accessing operations.
.. seealso::
:pep:`428`: The pathlib module -- object-oriented filesystem paths. | without actually accessing the OS. In this case, instantiating one of the pure classes may be useful since those simply don't have any OS-accessing operations.
.. seealso::
:pep:`428`: The pathlib module -- object-oriented filesystem paths. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bfc2625-a9a8-4d58-a870-627154e86168 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,212 | supabase-export-v2 | 74bda22cad5a12d0 | an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted relative path (e.g., ``r'\foo'``)::
>>> p = PurePath('/etc')
>>> p
PurePosixPath('/etc')
>>> p / 'init.d' / 'apache2'
PurePosixPath('/etc/init.d/apache2')
>>> q = PurePath('bin')
>>> '/usr' / q
PurePo... | trusted_official_docs | CPython Docs | an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted relative path (e.g., ``r'\foo'``)::
>>> p = PurePath('/etc')
>>> p
PurePosixPath('/etc')
>>> p / 'init.d' / 'apache2'
PurePosixPath('/etc/init.d/apache2')
>>> q = PurePath('bin')
>>> '/usr' / q
PurePo... | an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted relative path (e.g., ``r'\foo'``)::
>>> p = PurePath('/etc')
>>> p
PurePosixPath('/etc')
>>> p / 'init.d' / 'apache2'
PurePosixPath('/etc/init.d/apache2')
>>> q = PurePath('bin')
>>> '/usr' / q
PurePo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d190969-21d0-4331-a14b-80a53d01838e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,451 | supabase-export-v2 | 7216d6c9b5336fba | .. method:: Path.is_fifo()
Return ``True`` if the path points to a FIFO. ``False`` will be returned if
the path is invalid, inaccessible or missing, or if it points to something
other than a FIFO. Use :meth:`Path.stat` to distinguish between these
cases. | trusted_official_docs | CPython Docs | .. method:: Path.is_fifo()
Return ``True`` if the path points to a FIFO. ``False`` will be returned if
the path is invalid, inaccessible or missing, or if it points to something
other than a FIFO. Use :meth:`Path.stat` to distinguish between these
cases. | .. method:: Path.is_fifo()
Return ``True`` if the path points to a FIFO. ``False`` will be returned if
the path is invalid, inaccessible or missing, or if it points to something
other than a FIFO. Use :meth:`Path.stat` to distinguish between these
cases. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1e4b6140-e7d5-400d-9106-6c6df15c475d | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,320 | supabase-export-v2 | 0dc336d0ea06b5a6 | 941, in relative_to raise ValueError(error_message.format(str(self), str(formatted))) ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is relative and the other is absolute.
When *walk_up* is false (the default), the path must start with *other*. When the argument is true, ``..`` entries may be add... | trusted_official_docs | CPython Docs | 941, in relative_to raise ValueError(error_message.format(str(self), str(formatted))) ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is relative and the other is absolute.
When *walk_up* is false (the default), the path must start with *other*. When the argument is true, ``..`` entries may be add... | 941, in relative_to raise ValueError(error_message.format(str(self), str(formatted))) ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is relative and the other is absolute.
When *walk_up* is false (the default), the path must start with *other*. When the argument is true, ``..`` entries may be add... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22128a5b-a2e9-4974-b3c0-4266bff9f1a6 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,547 | supabase-export-v2 | 27428afa35eec4ae | If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if the target directory already exists.
If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the given
path already exists in the file system and is not a directory (same
behavior as the POSIX ``mkdir -p`` command). | trusted_official_docs | CPython Docs | If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if the target directory already exists.
If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the given
path already exists in the file system and is not a directory (same
behavior as the POSIX ``mkdir -p`` command). | If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if the target directory already exists.
If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the given
path already exists in the file system and is not a directory (same
behavior as the POSIX ``mkdir -p`` command). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
237fdc8d-7487-4c76-ae48-5f1ebbc7346d | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,248 | supabase-export-v2 | bec6bdb819bf229e | This behavior conforms to *The Open Group Base Specifications Issue 6*, paragraph `4.11 Pathname Resolution <https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11>`_:
*"A pathname that begins with two successive slashes may be interpreted in
an implementation-defined manner, although more ... | trusted_official_docs | CPython Docs | This behavior conforms to *The Open Group Base Specifications Issue 6*, paragraph `4.11 Pathname Resolution <https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11>`_:
*"A pathname that begins with two successive slashes may be interpreted in
an implementation-defined manner, although more ... | This behavior conforms to *The Open Group Base Specifications Issue 6*, paragraph `4.11 Pathname Resolution <https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11>`_:
*"A pathname that begins with two successive slashes may be interpreted in
an implementation-defined manner, although more ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24fd5195-18c7-4300-89d9-f6175aa84dd7 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,182 | supabase-export-v2 | 8ecfef05468b2871 | >>> PurePath('setup.py') # Running on a Unix machine PurePosixPath('setup.py')
Each element of *pathsegments* can be either a string representing a
path segment, or an object implementing the :class:`os.PathLike` interface
where the :meth:`~os.PathLike.__fspath__` method returns a string,
such as another path object... | trusted_official_docs | CPython Docs | >>> PurePath('setup.py') # Running on a Unix machine PurePosixPath('setup.py')
Each element of *pathsegments* can be either a string representing a
path segment, or an object implementing the :class:`os.PathLike` interface
where the :meth:`~os.PathLike.__fspath__` method returns a string,
such as another path object... | >>> PurePath('setup.py') # Running on a Unix machine PurePosixPath('setup.py')
Each element of *pathsegments* can be either a string representing a
path segment, or an object implementing the :class:`os.PathLike` interface
where the :meth:`~os.PathLike.__fspath__` method returns a string,
such as another path object... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
273e6cf3-6b5d-46c6-960d-a4c8eae5297c | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,465 | supabase-export-v2 | 0ab1a31c79a87b21 | attribute is initialized with some information about the file type gleaned from scanning the parent directory. Merely accessing :attr:`Path.info` does not perform any filesystem queries.
To fetch up-to-date information, it's best to call :meth:`Path.is_dir`,
:meth:`~Path.is_file` and :meth:`~Path.is_symlink` rather th... | trusted_official_docs | CPython Docs | attribute is initialized with some information about the file type gleaned from scanning the parent directory. Merely accessing :attr:`Path.info` does not perform any filesystem queries.
To fetch up-to-date information, it's best to call :meth:`Path.is_dir`,
:meth:`~Path.is_file` and :meth:`~Path.is_symlink` rather th... | attribute is initialized with some information about the file type gleaned from scanning the parent directory. Merely accessing :attr:`Path.info` does not perform any filesystem queries.
To fetch up-to-date information, it's best to call :meth:`Path.is_dir`,
:meth:`~Path.is_file` and :meth:`~Path.is_symlink` rather th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28750280-5513-40e8-980d-2d626dc1eea1 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,213 | supabase-export-v2 | 4072ec32a3ef9ced | / 'init.d' / 'apache2' PurePosixPath('/etc/init.d/apache2') >>> q = PurePath('bin') >>> '/usr' / q PurePosixPath('/usr/bin') >>> p / '/an_absolute_path' PurePosixPath('/an_absolute_path') >>> PureWindowsPath('c:/Windows', '/Program Files') PureWindowsPath('c:/Program Files')
A path object can be used anywhere an object... | trusted_official_docs | CPython Docs | / 'init.d' / 'apache2' PurePosixPath('/etc/init.d/apache2') >>> q = PurePath('bin') >>> '/usr' / q PurePosixPath('/usr/bin') >>> p / '/an_absolute_path' PurePosixPath('/an_absolute_path') >>> PureWindowsPath('c:/Windows', '/Program Files') PureWindowsPath('c:/Program Files')
A path object can be used anywhere an object... | / 'init.d' / 'apache2' PurePosixPath('/etc/init.d/apache2') >>> q = PurePath('bin') >>> '/usr' / q PurePosixPath('/usr/bin') >>> p / '/an_absolute_path' PurePosixPath('/an_absolute_path') >>> PureWindowsPath('c:/Windows', '/Program Files') PureWindowsPath('c:/Program Files')
A path object can be used anywhere an object... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b0878fa-58fd-4a41-9560-a27c8363ff04 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,211 | supabase-export-v2 | 01d4e1e46db0a7ee | Operators ^^^^^^^^^
The slash operator helps create child paths, like :func:`os.path.join`. If the argument is an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted
relative path (e.g., ``r'\foo'``):: | trusted_official_docs | CPython Docs | Operators ^^^^^^^^^
The slash operator helps create child paths, like :func:`os.path.join`. If the argument is an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted
relative path (e.g., ``r'\foo'``):: | Operators ^^^^^^^^^
The slash operator helps create child paths, like :func:`os.path.join`. If the argument is an absolute path, the previous path is ignored. On Windows, the drive is not reset when the argument is a rooted
relative path (e.g., ``r'\foo'``):: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c3cf8ff-a82f-4a89-b3ed-65d0cd2cdcca | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,632 | supabase-export-v2 | 6511f1770f3a275d | Comparison to the :mod:`os` and :mod:`os.path` modules ------------------------------------------------------
pathlib implements path operations using :class:`PurePath` and :class:`Path`
objects, and so it's said to be *object-oriented*. On the other hand, the
:mod:`os` and :mod:`os.path` modules supply functions that ... | trusted_official_docs | CPython Docs | Comparison to the :mod:`os` and :mod:`os.path` modules ------------------------------------------------------
pathlib implements path operations using :class:`PurePath` and :class:`Path`
objects, and so it's said to be *object-oriented*. On the other hand, the
:mod:`os` and :mod:`os.path` modules supply functions that ... | Comparison to the :mod:`os` and :mod:`os.path` modules ------------------------------------------------------
pathlib implements path operations using :class:`PurePath` and :class:`Path`
objects, and so it's said to be *object-oriented*. On the other hand, the
:mod:`os` and :mod:`os.path` modules supply functions that ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e556b80-1b18-444e-9fa9-42eebb0c7ca1 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,436 | supabase-export-v2 | 226f576a56fb3720 | .. method:: Path.is_dir(*, follow_symlinks=True)
Return ``True`` if the path points to a directory. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a directory. Use :meth:`Path.stat` to distinguish
between these cases. | trusted_official_docs | CPython Docs | .. method:: Path.is_dir(*, follow_symlinks=True)
Return ``True`` if the path points to a directory. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a directory. Use :meth:`Path.stat` to distinguish
between these cases. | .. method:: Path.is_dir(*, follow_symlinks=True)
Return ``True`` if the path points to a directory. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a directory. Use :meth:`Path.stat` to distinguish
between these cases. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2efb7f43-2f5f-442e-9118-2eb4e0c68cdb | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,529 | supabase-export-v2 | ec58538e7782a547 | .. note::
Be aware that setting *follow_symlinks* to true can lead to infinite
recursion if a link points to a parent directory of itself. :meth:`Path.walk`
does not keep track of the directories it has already visited. | trusted_official_docs | CPython Docs | .. note::
Be aware that setting *follow_symlinks* to true can lead to infinite
recursion if a link points to a parent directory of itself. :meth:`Path.walk`
does not keep track of the directories it has already visited. | .. note::
Be aware that setting *follow_symlinks* to true can lead to infinite
recursion if a link points to a parent directory of itself. :meth:`Path.walk`
does not keep track of the directories it has already visited. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2efdf9a6-f249-4281-bb0c-9e6b9e3ac6c9 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,619 | supabase-export-v2 | f2b65fdbec097aa8 | Range expressions are supported; for example, ``[a-z]`` matches any lowercase ASCII letter. Multiple ranges can be combined: ``[a-zA-Z0-9_]`` matches any ASCII letter, digit, or underscore.
``[!seq]``
Matches one character not in *seq*, where *seq* follows the same rules as above. | trusted_official_docs | CPython Docs | Range expressions are supported; for example, ``[a-z]`` matches any lowercase ASCII letter. Multiple ranges can be combined: ``[a-zA-Z0-9_]`` matches any ASCII letter, digit, or underscore.
``[!seq]``
Matches one character not in *seq*, where *seq* follows the same rules as above. | Range expressions are supported; for example, ``[a-z]`` matches any lowercase ASCII letter. Multiple ranges can be combined: ``[a-zA-Z0-9_]`` matches any ASCII letter, digit, or underscore.
``[!seq]``
Matches one character not in *seq*, where *seq* follows the same rules as above. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fd72ff7-8e36-4e5e-b4af-378df8379f08 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,335 | supabase-export-v2 | 6f1d3bfc2790d927 | the original path doesn't have a suffix, the new *suffix* is appended instead. If the *suffix* is an empty string, the original suffix is removed::
>>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_suffix('.bz2')
PureWindowsPath('c:/Downloads/pathlib.tar.bz2')
>>> p = PureWindowsPath('README')
>>> p... | trusted_official_docs | CPython Docs | the original path doesn't have a suffix, the new *suffix* is appended instead. If the *suffix* is an empty string, the original suffix is removed::
>>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_suffix('.bz2')
PureWindowsPath('c:/Downloads/pathlib.tar.bz2')
>>> p = PureWindowsPath('README')
>>> p... | the original path doesn't have a suffix, the new *suffix* is appended instead. If the *suffix* is an empty string, the original suffix is removed::
>>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_suffix('.bz2')
PureWindowsPath('c:/Downloads/pathlib.tar.bz2')
>>> p = PureWindowsPath('README')
>>> p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32a1c6fe-5567-40ed-be2b-704c566aa262 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,416 | supabase-export-v2 | 59c21fbcfb7afe6d | .. versionchanged:: 3.14
The methods given above now return ``False`` instead of raising any
:exc:`OSError` exception from the operating system. In previous versions,
some kinds of :exc:`OSError` exception are raised, and others suppressed. The new behaviour is consistent with :func:`os.path.exists`,
:func:`os.path.... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.14
The methods given above now return ``False`` instead of raising any
:exc:`OSError` exception from the operating system. In previous versions,
some kinds of :exc:`OSError` exception are raised, and others suppressed. The new behaviour is consistent with :func:`os.path.exists`,
:func:`os.path.... | .. versionchanged:: 3.14
The methods given above now return ``False`` instead of raising any
:exc:`OSError` exception from the operating system. In previous versions,
some kinds of :exc:`OSError` exception are raised, and others suppressed. The new behaviour is consistent with :func:`os.path.exists`,
:func:`os.path.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32cde567-b709-4598-ae94-94a36ba7920b | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,600 | supabase-export-v2 | 88e9b46dac854651 | This method normally follows symlinks; to get the owner of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | trusted_official_docs | CPython Docs | This method normally follows symlinks; to get the owner of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | This method normally follows symlinks; to get the owner of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33eb4b51-f177-4e47-9836-cfd61079bea9 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,566 | supabase-export-v2 | 959cd24568ebae08 | and modification times, and extended attributes are copied where supported. This argument has no effect when copying files on Windows (where metadata is always preserved).
.. note::
Where supported by the operating system and file system, this method
performs a lightweight copy, where data blocks are only copied when... | trusted_official_docs | CPython Docs | and modification times, and extended attributes are copied where supported. This argument has no effect when copying files on Windows (where metadata is always preserved).
.. note::
Where supported by the operating system and file system, this method
performs a lightweight copy, where data blocks are only copied when... | and modification times, and extended attributes are copied where supported. This argument has no effect when copying files on Windows (where metadata is always preserved).
.. note::
Where supported by the operating system and file system, this method
performs a lightweight copy, where data blocks are only copied when... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36da659d-efac-4cf3-915c-e2e80418de2a | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,484 | supabase-export-v2 | f1ea154a78787713 | >>> p = Path('my_text_file') >>> p.write_text('Text file contents') 18 >>> p.read_text() 'Text file contents'
An existing file of the same name is overwritten. The optional parameters
have the same meaning as in :func:`open`. | trusted_official_docs | CPython Docs | >>> p = Path('my_text_file') >>> p.write_text('Text file contents') 18 >>> p.read_text() 'Text file contents'
An existing file of the same name is overwritten. The optional parameters
have the same meaning as in :func:`open`. | >>> p = Path('my_text_file') >>> p.write_text('Text file contents') 18 >>> p.read_text() 'Text file contents'
An existing file of the same name is overwritten. The optional parameters
have the same meaning as in :func:`open`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38a78997-09db-4ea0-b315-3a63cb2cd39d | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,631 | supabase-export-v2 | 615dfd750182a3e5 | ``path.rglob()`` may include *path* itself, for example when globbing "``**``", whereas the results of ``glob.glob(root_dir=path)`` never include an empty string that would correspond to *path*.
Comparison to the :mod:`os` and :mod:`os.path` modules
------------------------------------------------------ | trusted_official_docs | CPython Docs | ``path.rglob()`` may include *path* itself, for example when globbing "``**``", whereas the results of ``glob.glob(root_dir=path)`` never include an empty string that would correspond to *path*.
Comparison to the :mod:`os` and :mod:`os.path` modules
------------------------------------------------------ | ``path.rglob()`` may include *path* itself, for example when globbing "``**``", whereas the results of ``glob.glob(root_dir=path)`` never include an empty string that would correspond to *path*.
Comparison to the :mod:`os` and :mod:`os.path` modules
------------------------------------------------------ | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38af465f-6714-4fe6-95d9-d92e6f199603 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,659 | supabase-export-v2 | 4cdbe043164eb29c | .. method:: is_symlink()
Return ``True`` if the path is a symbolic link (even if broken); return
``False`` if the path is a directory or any kind of file, or if it
doesn't exist. | trusted_official_docs | CPython Docs | .. method:: is_symlink()
Return ``True`` if the path is a symbolic link (even if broken); return
``False`` if the path is a directory or any kind of file, or if it
doesn't exist. | .. method:: is_symlink()
Return ``True`` if the path is a symbolic link (even if broken); return
``False`` if the path is a directory or any kind of file, or if it
doesn't exist. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ad8124f-9f9c-4af4-acb8-224776b37044 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,511 | supabase-export-v2 | 6a7312795b704b54 | versionchanged:: 3.13 Any :exc:`OSError` exceptions raised from scanning the filesystem are suppressed. In previous versions, such exceptions are suppressed in many cases, but not all.
.. method:: Path.rglob(pattern, *, case_sensitive=None, recurse_symlinks=False) | trusted_official_docs | CPython Docs | versionchanged:: 3.13 Any :exc:`OSError` exceptions raised from scanning the filesystem are suppressed. In previous versions, such exceptions are suppressed in many cases, but not all.
.. method:: Path.rglob(pattern, *, case_sensitive=None, recurse_symlinks=False) | versionchanged:: 3.13 Any :exc:`OSError` exceptions raised from scanning the filesystem are suppressed. In previous versions, such exceptions are suppressed in many cases, but not all.
.. method:: Path.rglob(pattern, *, case_sensitive=None, recurse_symlinks=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
402da8be-d527-4207-920e-d6306d7c96e0 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,599 | supabase-export-v2 | 552713827c7dc563 | Return the name of the user owning the file. :exc:`KeyError` is raised if the file's user identifier (UID) isn't found in the system database.
This method normally follows symlinks; to get the owner of the symlink, add
the argument ``follow_symlinks=False``. | trusted_official_docs | CPython Docs | Return the name of the user owning the file. :exc:`KeyError` is raised if the file's user identifier (UID) isn't found in the system database.
This method normally follows symlinks; to get the owner of the symlink, add
the argument ``follow_symlinks=False``. | Return the name of the user owning the file. :exc:`KeyError` is raised if the file's user identifier (UID) isn't found in the system database.
This method normally follows symlinks; to get the owner of the symlink, add
the argument ``follow_symlinks=False``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
412b3901-b697-46c8-a887-ec005d4c3ff7 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,541 | supabase-export-v2 | f89872fd9b64f89d | the file already exists, the function succeeds when *exist_ok* is true (and its modification time is updated to the current time), otherwise :exc:`FileExistsError` is raised.
.. seealso::
The :meth:`~Path.open`, :meth:`~Path.write_text` and
:meth:`~Path.write_bytes` methods are often used to create files. | trusted_official_docs | CPython Docs | the file already exists, the function succeeds when *exist_ok* is true (and its modification time is updated to the current time), otherwise :exc:`FileExistsError` is raised.
.. seealso::
The :meth:`~Path.open`, :meth:`~Path.write_text` and
:meth:`~Path.write_bytes` methods are often used to create files. | the file already exists, the function succeeds when *exist_ok* is true (and its modification time is updated to the current time), otherwise :exc:`FileExistsError` is raised.
.. seealso::
The :meth:`~Path.open`, :meth:`~Path.write_text` and
:meth:`~Path.write_bytes` methods are often used to create files. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42d612ac-2a81-46c0-b755-9e012fc2ccd5 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,458 | supabase-export-v2 | 5937f43fd2f09d94 | points to the same file as *other_path*, which can be either a Path object, or a string. The semantics are similar to :func:`os.path.samefile` and :func:`os.path.samestat`.
An :exc:`OSError` can be raised if either file cannot be accessed for some
reason. | trusted_official_docs | CPython Docs | points to the same file as *other_path*, which can be either a Path object, or a string. The semantics are similar to :func:`os.path.samefile` and :func:`os.path.samestat`.
An :exc:`OSError` can be raised if either file cannot be accessed for some
reason. | points to the same file as *other_path*, which can be either a Path object, or a string. The semantics are similar to :func:`os.path.samefile` and :func:`os.path.samestat`.
An :exc:`OSError` can be raised if either file cannot be accessed for some
reason. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43b0165f-0c56-4402-8bca-60f7854ba139 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,361 | supabase-export-v2 | 61e20bf3c11d7883 | instantiate the class flavour that corresponds to your system (allowing system calls on non-compatible path flavours could lead to bugs or failures in your application)::
>>> import os
>>> os.name
'posix'
>>> Path('setup.py')
PosixPath('setup.py')
>>> PosixPath('setup.py')
PosixPath('setup.py')
>>> WindowsPath('... | trusted_official_docs | CPython Docs | instantiate the class flavour that corresponds to your system (allowing system calls on non-compatible path flavours could lead to bugs or failures in your application)::
>>> import os
>>> os.name
'posix'
>>> Path('setup.py')
PosixPath('setup.py')
>>> PosixPath('setup.py')
PosixPath('setup.py')
>>> WindowsPath('... | instantiate the class flavour that corresponds to your system (allowing system calls on non-compatible path flavours could lead to bugs or failures in your application)::
>>> import os
>>> os.name
'posix'
>>> Path('setup.py')
PosixPath('setup.py')
>>> PosixPath('setup.py')
PosixPath('setup.py')
>>> WindowsPath('... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43bbf128-0e58-43d3-a3e7-42d7793498d0 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,405 | supabase-export-v2 | 0a6525725b781a63 | :exc:`OSError` is raised. If *strict* is ``False``, the path is resolved as far as possible and any remainder is appended without checking whether it exists.
.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict). | trusted_official_docs | CPython Docs | :exc:`OSError` is raised. If *strict* is ``False``, the path is resolved as far as possible and any remainder is appended without checking whether it exists.
.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict). | :exc:`OSError` is raised. If *strict* is ``False``, the path is resolved as far as possible and any remainder is appended without checking whether it exists.
.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46bbec81-f11f-46f9-abd5-014fa7f03109 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,540 | supabase-export-v2 | 44ad40e7c6f5dba6 | .. method:: Path.touch(mode=0o666, exist_ok=True)
Create a file at this given path. If *mode* is given, it is combined
with the process's ``umask`` value to determine the file mode and access
flags. If the file already exists, the function succeeds when *exist_ok*
is true (and its modification time is updated to the... | trusted_official_docs | CPython Docs | .. method:: Path.touch(mode=0o666, exist_ok=True)
Create a file at this given path. If *mode* is given, it is combined
with the process's ``umask`` value to determine the file mode and access
flags. If the file already exists, the function succeeds when *exist_ok*
is true (and its modification time is updated to the... | .. method:: Path.touch(mode=0o666, exist_ok=True)
Create a file at this given path. If *mode* is given, it is combined
with the process's ``umask`` value to determine the file mode and access
flags. If the file already exists, the function succeeds when *exist_ok*
is true (and its modification time is updated to the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49031889-70de-4edc-85dc-bb9f694ff4f4 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,158 | supabase-export-v2 | 451eee902980fdfa | right for your task, :class:`Path` is most likely what you need. It instantiates a :ref:`concrete path <concrete-paths>` for the platform the code is running on.
Pure paths are useful in some special cases; for example: | trusted_official_docs | CPython Docs | right for your task, :class:`Path` is most likely what you need. It instantiates a :ref:`concrete path <concrete-paths>` for the platform the code is running on.
Pure paths are useful in some special cases; for example: | right for your task, :class:`Path` is most likely what you need. It instantiates a :ref:`concrete path <concrete-paths>` for the platform the code is running on.
Pure paths are useful in some special cases; for example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ccce30a-175d-43d8-a223-9220e4fa5d24 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,637 | supabase-export-v2 | c19c5b9c17c36fc6 | pathlib's path normalization may render it unsuitable for some applications:
1. pathlib normalizes ``Path("my_folder/")`` to ``Path("my_folder")``, which
changes a path's meaning when supplied to various operating system APIs and
command-line utilities. Specifically, the absence of a trailing separator
may allow the... | trusted_official_docs | CPython Docs | pathlib's path normalization may render it unsuitable for some applications:
1. pathlib normalizes ``Path("my_folder/")`` to ``Path("my_folder")``, which
changes a path's meaning when supplied to various operating system APIs and
command-line utilities. Specifically, the absence of a trailing separator
may allow the... | pathlib's path normalization may render it unsuitable for some applications:
1. pathlib normalizes ``Path("my_folder/")`` to ``Path("my_folder")``, which
changes a path's meaning when supplied to various operating system APIs and
command-line utilities. Specifically, the absence of a trailing separator
may allow the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f7d1e55-f46a-49f3-91c6-be126a669832 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,263 | supabase-export-v2 | 4e7e34ee082d780f | >>> p = PurePosixPath('foo/..') >>> p.parent PurePosixPath('foo')
If you want to walk an arbitrary filesystem path upwards, it is
recommended to first call :meth:`Path.resolve` so as to resolve
symlinks and eliminate ``".."`` components. | trusted_official_docs | CPython Docs | >>> p = PurePosixPath('foo/..') >>> p.parent PurePosixPath('foo')
If you want to walk an arbitrary filesystem path upwards, it is
recommended to first call :meth:`Path.resolve` so as to resolve
symlinks and eliminate ``".."`` components. | >>> p = PurePosixPath('foo/..') >>> p.parent PurePosixPath('foo')
If you want to walk an arbitrary filesystem path upwards, it is
recommended to first call :meth:`Path.resolve` so as to resolve
symlinks and eliminate ``".."`` components. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
51bf0f0c-ce21-4fc7-a583-ec321e58ddb1 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,574 | supabase-export-v2 | 86ecabc8b975c80f | >>> p = Path('foo') >>> p.open('w').write('some text') 9 >>> target = Path('bar') >>> p.rename(target) PosixPath('bar') >>> target.open().read() 'some text'
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:class:`!Path` ... | trusted_official_docs | CPython Docs | >>> p = Path('foo') >>> p.open('w').write('some text') 9 >>> target = Path('bar') >>> p.rename(target) PosixPath('bar') >>> target.open().read() 'some text'
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:class:`!Path` ... | >>> p = Path('foo') >>> p.open('w').write('some text') 9 >>> target = Path('bar') >>> p.rename(target) PosixPath('bar') >>> target.open().read() 'some text'
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:class:`!Path` ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5357ee31-632b-4b03-9bd4-39da239bf90e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,578 | supabase-export-v2 | 9760c75412209335 | .. method:: Path.replace(target)
Rename this file or directory to the given *target*, and return a new
:class:`!Path` instance pointing to *target*. If *target* points to an
existing file or empty directory, it will be unconditionally replaced. | trusted_official_docs | CPython Docs | .. method:: Path.replace(target)
Rename this file or directory to the given *target*, and return a new
:class:`!Path` instance pointing to *target*. If *target* points to an
existing file or empty directory, it will be unconditionally replaced. | .. method:: Path.replace(target)
Rename this file or directory to the given *target*, and return a new
:class:`!Path` instance pointing to *target*. If *target* points to an
existing file or empty directory, it will be unconditionally replaced. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53a3d316-e37a-4687-adcb-8f8bbf83bd6a | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,620 | supabase-export-v2 | 82b94b9d2582021e | ``[!seq]`` Matches one character not in *seq*, where *seq* follows the same rules as above.
For a literal match, wrap the meta-characters in brackets. For example, ``"[?]"`` matches the character ``"?"``. | trusted_official_docs | CPython Docs | ``[!seq]`` Matches one character not in *seq*, where *seq* follows the same rules as above.
For a literal match, wrap the meta-characters in brackets. For example, ``"[?]"`` matches the character ``"?"``. | ``[!seq]`` Matches one character not in *seq*, where *seq* follows the same rules as above.
For a literal match, wrap the meta-characters in brackets. For example, ``"[?]"`` matches the character ``"?"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53c4c9f1-c882-4876-8123-d32c172cb903 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,155 | supabase-export-v2 | 641d5d796f484059 | --------------
This module offers classes representing filesystem paths with semantics
appropriate for different operating systems. Path classes are divided
between :ref:`pure paths <pure-paths>`, which provide purely computational
operations without I/O, and :ref:`concrete paths <concrete-paths>`, which
inherit from p... | trusted_official_docs | CPython Docs | --------------
This module offers classes representing filesystem paths with semantics
appropriate for different operating systems. Path classes are divided
between :ref:`pure paths <pure-paths>`, which provide purely computational
operations without I/O, and :ref:`concrete paths <concrete-paths>`, which
inherit from p... | --------------
This module offers classes representing filesystem paths with semantics
appropriate for different operating systems. Path classes are divided
between :ref:`pure paths <pure-paths>`, which provide purely computational
operations without I/O, and :ref:`concrete paths <concrete-paths>`, which
inherit from p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53ed23c1-0080-4d73-8ee6-e3fc19268984 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,575 | supabase-export-v2 | 805e188b41e6188d | The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the :class:`!Path` object.
It is implemented in terms of :func:`os.rename` and gives the same guarantees. | trusted_official_docs | CPython Docs | The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the :class:`!Path` object.
It is implemented in terms of :func:`os.rename` and gives the same guarantees. | The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the :class:`!Path` object.
It is implemented in terms of :func:`os.rename` and gives the same guarantees. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5455ffe9-6964-49e7-88d7-9b0762067951 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,530 | supabase-export-v2 | 7ff11fe7f331d3bb | to infinite recursion if a link points to a parent directory of itself. :meth:`Path.walk` does not keep track of the directories it has already visited.
.. note::
:meth:`Path.walk` assumes the directories it walks are not modified during
execution. For example, if a directory from *dirnames* has been replaced
with a... | trusted_official_docs | CPython Docs | to infinite recursion if a link points to a parent directory of itself. :meth:`Path.walk` does not keep track of the directories it has already visited.
.. note::
:meth:`Path.walk` assumes the directories it walks are not modified during
execution. For example, if a directory from *dirnames* has been replaced
with a... | to infinite recursion if a link points to a parent directory of itself. :meth:`Path.walk` does not keep track of the directories it has already visited.
.. note::
:meth:`Path.walk` assumes the directories it walks are not modified during
execution. For example, if a directory from *dirnames* has been replaced
with a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56ccf12a-4caa-40d1-88e5-c395bd53776b | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,433 | supabase-export-v2 | ae7d2f34af462a02 | the path is invalid, inaccessible or missing, or if it points to something other than a regular file. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks, add the
argument ``follow_symlinks=False``. | trusted_official_docs | CPython Docs | the path is invalid, inaccessible or missing, or if it points to something other than a regular file. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks, add the
argument ``follow_symlinks=False``. | the path is invalid, inaccessible or missing, or if it points to something other than a regular file. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks, add the
argument ``follow_symlinks=False``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5941e461-146f-41bf-af44-c240e742ae6a | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,629 | supabase-export-v2 | ac40fd1fc1b73332 | The patterns accepted and results generated by :meth:`Path.glob` and :meth:`Path.rglob` differ slightly from those by the :mod:`glob` module:
1. Files beginning with a dot are not special in pathlib. This is
like passing ``include_hidden=True`` to :func:`glob.glob`. 2. "``**``" pattern components are always recursive ... | trusted_official_docs | CPython Docs | The patterns accepted and results generated by :meth:`Path.glob` and :meth:`Path.rglob` differ slightly from those by the :mod:`glob` module:
1. Files beginning with a dot are not special in pathlib. This is
like passing ``include_hidden=True`` to :func:`glob.glob`. 2. "``**``" pattern components are always recursive ... | The patterns accepted and results generated by :meth:`Path.glob` and :meth:`Path.rglob` differ slightly from those by the :mod:`glob` module:
1. Files beginning with a dot are not special in pathlib. This is
like passing ``include_hidden=True`` to :func:`glob.glob`. 2. "``**``" pattern components are always recursive ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
594d24f3-f8a2-4c6f-b027-bb40e1246ca3 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,334 | supabase-export-v2 | 2fbb174ff1eff644 | .. method:: PurePath.with_suffix(suffix)
Return a new path with the :attr:`suffix` changed. If the original path
doesn't have a suffix, the new *suffix* is appended instead. If the
*suffix* is an empty string, the original suffix is removed:: | trusted_official_docs | CPython Docs | .. method:: PurePath.with_suffix(suffix)
Return a new path with the :attr:`suffix` changed. If the original path
doesn't have a suffix, the new *suffix* is appended instead. If the
*suffix* is an empty string, the original suffix is removed:: | .. method:: PurePath.with_suffix(suffix)
Return a new path with the :attr:`suffix` changed. If the original path
doesn't have a suffix, the new *suffix* is appended instead. If the
*suffix* is an empty string, the original suffix is removed:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b1c242f-5301-4d43-b909-1fc17c43b31b | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,513 | supabase-export-v2 | 9a177e5e8bdb541a | Glob the given relative *pattern* recursively. This is like calling :func:`Path.glob` with "``**/``" added in front of the *pattern*.
.. note::
The paths are returned in no particular order. If you need a specific order, sort the results. | trusted_official_docs | CPython Docs | Glob the given relative *pattern* recursively. This is like calling :func:`Path.glob` with "``**/``" added in front of the *pattern*.
.. note::
The paths are returned in no particular order. If you need a specific order, sort the results. | Glob the given relative *pattern* recursively. This is like calling :func:`Path.glob` with "``**/``" added in front of the *pattern*.
.. note::
The paths are returned in no particular order. If you need a specific order, sort the results. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5cb9b77c-570e-45d6-8641-761501be2560 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,432 | supabase-export-v2 | 6e70436da9858f86 | .. method:: Path.is_file(*, follow_symlinks=True)
Return ``True`` if the path points to a regular file. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a regular file. Use :meth:`Path.stat` to
distinguish between these cases. | trusted_official_docs | CPython Docs | .. method:: Path.is_file(*, follow_symlinks=True)
Return ``True`` if the path points to a regular file. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a regular file. Use :meth:`Path.stat` to
distinguish between these cases. | .. method:: Path.is_file(*, follow_symlinks=True)
Return ``True`` if the path points to a regular file. ``False`` will be
returned if the path is invalid, inaccessible or missing, or if it points
to something other than a regular file. Use :meth:`Path.stat` to
distinguish between these cases. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5db8f20a-eb28-4582-81b7-0ee46320a7d2 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,496 | supabase-export-v2 | edd106eda67e22ff | >>> p = Path('docs') >>> for child in p.iterdir(): child ... PosixPath('docs/conf.py') PosixPath('docs/_templates') PosixPath('docs/make.bat') PosixPath('docs/index.rst') PosixPath('docs/_build') PosixPath('docs/_static') PosixPath('docs/Makefile')
The children are yielded in arbitrary order, and the special entries
`... | trusted_official_docs | CPython Docs | >>> p = Path('docs') >>> for child in p.iterdir(): child ... PosixPath('docs/conf.py') PosixPath('docs/_templates') PosixPath('docs/make.bat') PosixPath('docs/index.rst') PosixPath('docs/_build') PosixPath('docs/_static') PosixPath('docs/Makefile')
The children are yielded in arbitrary order, and the special entries
`... | >>> p = Path('docs') >>> for child in p.iterdir(): child ... PosixPath('docs/conf.py') PosixPath('docs/_templates') PosixPath('docs/make.bat') PosixPath('docs/index.rst') PosixPath('docs/_build') PosixPath('docs/_static') PosixPath('docs/Makefile')
The children are yielded in arbitrary order, and the special entries
`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5f358880-1eaf-4088-b4ed-6e2324e7d0ed | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,305 | supabase-export-v2 | 2fa0a1cc60decb3e | Match this path against the provided glob-style pattern. Return ``True`` if matching is successful, ``False`` otherwise. For example::
>>> PurePath('a/b.py').full_match('a/*.py')
True
>>> PurePath('a/b.py').full_match('*.py')
False
>>> PurePath('/a/b/c.py').full_match('/a/**')
True
>>> PurePath('/a/b/c.py').full_... | trusted_official_docs | CPython Docs | Match this path against the provided glob-style pattern. Return ``True`` if matching is successful, ``False`` otherwise. For example::
>>> PurePath('a/b.py').full_match('a/*.py')
True
>>> PurePath('a/b.py').full_match('*.py')
False
>>> PurePath('/a/b/c.py').full_match('/a/**')
True
>>> PurePath('/a/b/c.py').full_... | Match this path against the provided glob-style pattern. Return ``True`` if matching is successful, ``False`` otherwise. For example::
>>> PurePath('a/b.py').full_match('a/*.py')
True
>>> PurePath('a/b.py').full_match('*.py')
False
>>> PurePath('/a/b/c.py').full_match('/a/**')
True
>>> PurePath('/a/b/c.py').full_... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5f5a0dce-6a28-4654-a5c9-267417402552 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,653 | supabase-export-v2 | 3bebbdfa14c14092 | .. method:: is_dir(*, follow_symlinks=True)
Return ``True`` if the path is a directory, or a symbolic link pointing
to a directory; return ``False`` if the path is (or points to) any other
kind of file, or if it doesn't exist. | trusted_official_docs | CPython Docs | .. method:: is_dir(*, follow_symlinks=True)
Return ``True`` if the path is a directory, or a symbolic link pointing
to a directory; return ``False`` if the path is (or points to) any other
kind of file, or if it doesn't exist. | .. method:: is_dir(*, follow_symlinks=True)
Return ``True`` if the path is a directory, or a symbolic link pointing
to a directory; return ``False`` if the path is (or points to) any other
kind of file, or if it doesn't exist. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
627680ec-b71a-4bf5-a94a-3d1562eecd60 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,404 | supabase-export-v2 | 6db007c7762987c3 | >>> p = Path('docs/../setup.py') >>> p.resolve() PosixPath('/home/antoine/pathlib/setup.py')
If a path doesn't exist or a symlink loop is encountered, and *strict* is
``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is
resolved as far as possible and any remainder is appended without checking
w... | trusted_official_docs | CPython Docs | >>> p = Path('docs/../setup.py') >>> p.resolve() PosixPath('/home/antoine/pathlib/setup.py')
If a path doesn't exist or a symlink loop is encountered, and *strict* is
``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is
resolved as far as possible and any remainder is appended without checking
w... | >>> p = Path('docs/../setup.py') >>> p.resolve() PosixPath('/home/antoine/pathlib/setup.py')
If a path doesn't exist or a symlink loop is encountered, and *strict* is
``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is
resolved as far as possible and any remainder is appended without checking
w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
66712102-50f4-43ba-bb11-c89c62450ec5 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,523 | supabase-export-v2 | a7f1fadbbf124eeb | each directory in the directory tree rooted at *self* (including *self* but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, dirnames, filenames)``.
*dirpath* is a :class:`Path` to the directory currently being walked,
*dirnames* is a list of strings for the names of subdirectories in *dirpath*
(ex... | trusted_official_docs | CPython Docs | each directory in the directory tree rooted at *self* (including *self* but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, dirnames, filenames)``.
*dirpath* is a :class:`Path` to the directory currently being walked,
*dirnames* is a list of strings for the names of subdirectories in *dirpath*
(ex... | each directory in the directory tree rooted at *self* (including *self* but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, dirnames, filenames)``.
*dirpath* is a :class:`Path` to the directory currently being walked,
*dirnames* is a list of strings for the names of subdirectories in *dirpath*
(ex... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
680f7c47-d42b-4fef-b3db-e452fb42fcc7 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,489 | supabase-export-v2 | 7ac84d19b4b655b6 | Open the file pointed to in bytes mode, write *data* to it, and close the file::
>>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents' | trusted_official_docs | CPython Docs | Open the file pointed to in bytes mode, write *data* to it, and close the file::
>>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents' | Open the file pointed to in bytes mode, write *data* to it, and close the file::
>>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6863abc9-28d3-44ec-aa2a-c4df6159698d | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,536 | supabase-export-v2 | 43c30f63bf7fe358 | next example is a simple implementation of :func:`shutil.rmtree`. Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow deleting a directory before it is empty::
# Delete everything reachable from the directory "top". # CAUTION: This is dangerous! For example, if top == Path('/'),
# it could delete al... | trusted_official_docs | CPython Docs | next example is a simple implementation of :func:`shutil.rmtree`. Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow deleting a directory before it is empty::
# Delete everything reachable from the directory "top". # CAUTION: This is dangerous! For example, if top == Path('/'),
# it could delete al... | next example is a simple implementation of :func:`shutil.rmtree`. Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow deleting a directory before it is empty::
# Delete everything reachable from the directory "top". # CAUTION: This is dangerous! For example, if top == Path('/'),
# it could delete al... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6c118219-f20c-43be-a460-3a46f453024f | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,290 | supabase-export-v2 | 7161dc9096c5b354 | whether the path is absolute or not. A path is considered absolute if it has both a root and (if the flavour allows) a drive::
>>> PurePosixPath('/a/b').is_absolute()
True
>>> PurePosixPath('a/b').is_absolute()
False | trusted_official_docs | CPython Docs | whether the path is absolute or not. A path is considered absolute if it has both a root and (if the flavour allows) a drive::
>>> PurePosixPath('/a/b').is_absolute()
True
>>> PurePosixPath('a/b').is_absolute()
False | whether the path is absolute or not. A path is considered absolute if it has both a root and (if the flavour allows) a drive::
>>> PurePosixPath('/a/b').is_absolute()
True
>>> PurePosixPath('a/b').is_absolute()
False | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6c88e66a-a8f8-491e-bda9-fe49e72f7aab | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,573 | supabase-export-v2 | 245e5ed05092c8f5 | silently if the user has permission. On Windows, if *target* exists, :exc:`FileExistsError` will be raised. *target* can be either a string or another path object::
>>> p = Path('foo')
>>> p.open('w').write('some text')
9
>>> target = Path('bar')
>>> p.rename(target)
PosixPath('bar')
>>> target.open().read()
'so... | trusted_official_docs | CPython Docs | silently if the user has permission. On Windows, if *target* exists, :exc:`FileExistsError` will be raised. *target* can be either a string or another path object::
>>> p = Path('foo')
>>> p.open('w').write('some text')
9
>>> target = Path('bar')
>>> p.rename(target)
PosixPath('bar')
>>> target.open().read()
'so... | silently if the user has permission. On Windows, if *target* exists, :exc:`FileExistsError` will be raised. *target* can be either a string or another path object::
>>> p = Path('foo')
>>> p.open('w').write('some text')
9
>>> target = Path('bar')
>>> p.rename(target)
PosixPath('bar')
>>> target.open().read()
'so... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ecec900-b0bb-4d62-a99b-25887847bcf4 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,636 | supabase-export-v2 | 0e98530d07faaca6 | example, whereas :func:`os.path.abspath` eliminates "``..``" segments from a path, which may change its meaning if symlinks are involved, :meth:`Path.absolute` preserves these segments for greater safety.
pathlib's path normalization may render it unsuitable for some applications: | trusted_official_docs | CPython Docs | example, whereas :func:`os.path.abspath` eliminates "``..``" segments from a path, which may change its meaning if symlinks are involved, :meth:`Path.absolute` preserves these segments for greater safety.
pathlib's path normalization may render it unsuitable for some applications: | example, whereas :func:`os.path.abspath` eliminates "``..``" segments from a path, which may change its meaning if symlinks are involved, :meth:`Path.absolute` preserves these segments for greater safety.
pathlib's path normalization may render it unsuitable for some applications: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6edca403-81d2-4dce-bdcb-c0de044903b4 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,215 | supabase-export-v2 | aabe80ee9e168c74 | >>> import os >>> p = PurePath('/etc') >>> os.fspath(p) '/etc'
The string representation of a path is the raw filesystem path itself
(in native form, e.g. with backslashes under Windows), which you can
pass to any function taking a file path as a string:: | trusted_official_docs | CPython Docs | >>> import os >>> p = PurePath('/etc') >>> os.fspath(p) '/etc'
The string representation of a path is the raw filesystem path itself
(in native form, e.g. with backslashes under Windows), which you can
pass to any function taking a file path as a string:: | >>> import os >>> p = PurePath('/etc') >>> os.fspath(p) '/etc'
The string representation of a path is the raw filesystem path itself
(in native form, e.g. with backslashes under Windows), which you can
pass to any function taking a file path as a string:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6f2f110e-0973-4e49-850f-60d1916564db | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,605 | supabase-export-v2 | b94ccee06b2949a7 | This method normally follows symlinks; to get the group of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | trusted_official_docs | CPython Docs | This method normally follows symlinks; to get the group of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | This method normally follows symlinks; to get the group of the symlink, add the argument ``follow_symlinks=False``.
.. versionchanged:: 3.13
Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not
available. In earlier versions, :exc:`NotImplementedError` was raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
70b4ee9b-41b3-4dc0-818e-2afe35138c9f | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,584 | supabase-export-v2 | 83360e7be19d6b40 | the target is overwritten. If both paths point to the same file or directory, or the *target* is a non-empty directory, then :exc:`OSError` is raised.
If both paths are on the same filesystem, the move is performed with
:func:`os.replace`. Otherwise, this path is copied (preserving metadata and
symlinks) and then del... | trusted_official_docs | CPython Docs | the target is overwritten. If both paths point to the same file or directory, or the *target* is a non-empty directory, then :exc:`OSError` is raised.
If both paths are on the same filesystem, the move is performed with
:func:`os.replace`. Otherwise, this path is copied (preserving metadata and
symlinks) and then del... | the target is overwritten. If both paths point to the same file or directory, or the *target* is a non-empty directory, then :exc:`OSError` is raised.
If both paths are on the same filesystem, the move is performed with
:func:`os.replace`. Otherwise, this path is copied (preserving metadata and
symlinks) and then del... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
71ddec20-bc03-429c-85bd-c3cb32d93865 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,548 | supabase-export-v2 | 6b08c83e4c782fbf | be raised unless the given path already exists in the file system and is not a directory (same behavior as the POSIX ``mkdir -p`` command).
.. versionchanged:: 3.5
The *exist_ok* parameter was added. | trusted_official_docs | CPython Docs | be raised unless the given path already exists in the file system and is not a directory (same behavior as the POSIX ``mkdir -p`` command).
.. versionchanged:: 3.5
The *exist_ok* parameter was added. | be raised unless the given path already exists in the file system and is not a directory (same behavior as the POSIX ``mkdir -p`` command).
.. versionchanged:: 3.5
The *exist_ok* parameter was added. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
759ec7c9-b275-41e8-a9ec-736e6bb9798d | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,591 | supabase-export-v2 | 998a12568a9c019a | Remove this file or symbolic link. If the path points to a directory, use :func:`Path.rmdir` instead.
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
raised if the path does not exist. | trusted_official_docs | CPython Docs | Remove this file or symbolic link. If the path points to a directory, use :func:`Path.rmdir` instead.
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
raised if the path does not exist. | Remove this file or symbolic link. If the path points to a directory, use :func:`Path.rmdir` instead.
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
raised if the path does not exist. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
79467965-c82b-4fa5-8004-f7b15a3378a6 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,406 | supabase-export-v2 | b3e7fbda49afa8a4 | .. versionchanged:: 3.6 The *strict* parameter was added (pre-3.6 behavior is strict).
.. versionchanged:: 3.13
Symlink loops are treated like other errors: :exc:`OSError` is raised in
strict mode, and no exception is raised in non-strict mode. In previous
versions, :exc:`RuntimeError` is raised no matter the value ... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.6 The *strict* parameter was added (pre-3.6 behavior is strict).
.. versionchanged:: 3.13
Symlink loops are treated like other errors: :exc:`OSError` is raised in
strict mode, and no exception is raised in non-strict mode. In previous
versions, :exc:`RuntimeError` is raised no matter the value ... | .. versionchanged:: 3.6 The *strict* parameter was added (pre-3.6 behavior is strict).
.. versionchanged:: 3.13
Symlink loops are treated like other errors: :exc:`OSError` is raised in
strict mode, and no exception is raised in non-strict mode. In previous
versions, :exc:`RuntimeError` is raised no matter the value ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
79fa4346-79fa-434f-a229-88eb29839c4e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,544 | supabase-export-v2 | e2de18ea5a3b2674 | given, it is combined with the process's ``umask`` value to determine the file mode and access flags. If the path already exists, :exc:`FileExistsError` is raised.
If *parents* is true, any missing parents of this path are created
as needed; they are created with the default permissions without taking
*mode* into acc... | trusted_official_docs | CPython Docs | given, it is combined with the process's ``umask`` value to determine the file mode and access flags. If the path already exists, :exc:`FileExistsError` is raised.
If *parents* is true, any missing parents of this path are created
as needed; they are created with the default permissions without taking
*mode* into acc... | given, it is combined with the process's ``umask`` value to determine the file mode and access flags. If the path already exists, :exc:`FileExistsError` is raised.
If *parents* is true, any missing parents of this path are created
as needed; they are created with the default permissions without taking
*mode* into acc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7cceafe7-afab-4d61-9fab-b36153a68b46 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,360 | supabase-export-v2 | 76103d1c7feed15c | .. versionchanged:: 3.13 Raises :exc:`UnsupportedOperation` on non-Windows platforms. In previous versions, :exc:`NotImplementedError` was raised instead.
You can only instantiate the class flavour that corresponds to your system
(allowing system calls on non-compatible path flavours could lead to
bugs or failures in y... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.13 Raises :exc:`UnsupportedOperation` on non-Windows platforms. In previous versions, :exc:`NotImplementedError` was raised instead.
You can only instantiate the class flavour that corresponds to your system
(allowing system calls on non-compatible path flavours could lead to
bugs or failures in y... | .. versionchanged:: 3.13 Raises :exc:`UnsupportedOperation` on non-Windows platforms. In previous versions, :exc:`NotImplementedError` was raised instead.
You can only instantiate the class flavour that corresponds to your system
(allowing system calls on non-compatible path flavours could lead to
bugs or failures in y... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ee3910e-c535-435b-a128-e4afaa81608c | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,156 | supabase-export-v2 | bebbf7231c7d540d | between :ref:`pure paths <pure-paths>`, which provide purely computational operations without I/O, and :ref:`concrete paths <concrete-paths>`, which inherit from pure paths but also provide I/O operations.
.. image:: pathlib-inheritance.png
:align: center
:class: invert-in-dark-mode
:alt: Inheritance diagram showing... | trusted_official_docs | CPython Docs | between :ref:`pure paths <pure-paths>`, which provide purely computational operations without I/O, and :ref:`concrete paths <concrete-paths>`, which inherit from pure paths but also provide I/O operations.
.. image:: pathlib-inheritance.png
:align: center
:class: invert-in-dark-mode
:alt: Inheritance diagram showing... | between :ref:`pure paths <pure-paths>`, which provide purely computational operations without I/O, and :ref:`concrete paths <concrete-paths>`, which inherit from pure paths but also provide I/O operations.
.. image:: pathlib-inheritance.png
:align: center
:class: invert-in-dark-mode
:alt: Inheritance diagram showing... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83c1e085-c61c-4bda-aa49-996d3ad9931e | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,579 | supabase-export-v2 | 94eb0e6e03117dc5 | *target*, and return a new :class:`!Path` instance pointing to *target*. If *target* points to an existing file or empty directory, it will be unconditionally replaced.
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:cl... | trusted_official_docs | CPython Docs | *target*, and return a new :class:`!Path` instance pointing to *target*. If *target* points to an existing file or empty directory, it will be unconditionally replaced.
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:cl... | *target*, and return a new :class:`!Path` instance pointing to *target*. If *target* points to an existing file or empty directory, it will be unconditionally replaced.
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the
:cl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83c22341-0845-4a05-9d43-b9e87a53b5ba | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,504 | supabase-export-v2 | 69f95b5fbad1a316 | method matches paths using platform-specific casing rules: typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``False`` to override this behaviour.
By default, or when the *recurse_symlinks* keyword-only argument is set to
``False``, this method follows symlinks ex... | trusted_official_docs | CPython Docs | method matches paths using platform-specific casing rules: typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``False`` to override this behaviour.
By default, or when the *recurse_symlinks* keyword-only argument is set to
``False``, this method follows symlinks ex... | method matches paths using platform-specific casing rules: typically, case-sensitive on POSIX, and case-insensitive on Windows. Set *case_sensitive* to ``True`` or ``False`` to override this behaviour.
By default, or when the *recurse_symlinks* keyword-only argument is set to
``False``, this method follows symlinks ex... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8489bfc4-cfea-441f-86d2-dc092fc4ceb2 | CPython Docs | file://datasets/cpython/Doc/library/pathlib.rst | unknown | 71847990-46b5-498d-9f52-51dcb5914631 | 27,437 | supabase-export-v2 | 3ea296bc3f73ab7f | if the path is invalid, inaccessible or missing, or if it points to something other than a directory. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks to directories,
add the argument ``follow_symlinks=False``. | trusted_official_docs | CPython Docs | if the path is invalid, inaccessible or missing, or if it points to something other than a directory. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks to directories,
add the argument ``follow_symlinks=False``. | if the path is invalid, inaccessible or missing, or if it points to something other than a directory. Use :meth:`Path.stat` to distinguish between these cases.
This method normally follows symlinks; to exclude symlinks to directories,
add the argument ``follow_symlinks=False``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.