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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
81640b7c-af46-444a-9622-a21d0d524a05 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,638 | supabase-export-v2 | 290922f0f2d68241 | rmtree example ~~~~~~~~~~~~~~
This example shows how to remove a directory tree on Windows where some
of the files have their read-only bit set. It uses the onexc callback
to clear the readonly bit and reattempt the remove. Any subsequent failure
will propagate. :: | trusted_official_docs | CPython Docs | rmtree example ~~~~~~~~~~~~~~
This example shows how to remove a directory tree on Windows where some
of the files have their read-only bit set. It uses the onexc callback
to clear the readonly bit and reattempt the remove. Any subsequent failure
will propagate. :: | rmtree example ~~~~~~~~~~~~~~
This example shows how to remove a directory tree on Windows where some
of the files have their read-only bit set. It uses the onexc callback
to clear the readonly bit and reattempt the remove. Any subsequent failure
will propagate. :: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83700f9c-9a48-4323-b8ba-9e06ac451192 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,494 | supabase-export-v2 | 0e96531bc987ccfb | .. function:: copyfile(src, dst, *, follow_symlinks=True)
Copy the contents (no metadata) of the file named *src* to a file named
*dst* and return *dst* in the most efficient way possible. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings. | trusted_official_docs | CPython Docs | .. function:: copyfile(src, dst, *, follow_symlinks=True)
Copy the contents (no metadata) of the file named *src* to a file named
*dst* and return *dst* in the most efficient way possible. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings. | .. function:: copyfile(src, dst, *, follow_symlinks=True)
Copy the contents (no metadata) of the file named *src* to a file named
*dst* and return *dst* in the most efficient way possible. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
89a39b2d-1161-4859-8264-c25e742d51ef | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,652 | supabase-export-v2 | 36cfb16dc0aeb8b5 | directory of the archive, all paths in the archive will be relative to it; for example, we typically chdir into *root_dir* before creating the archive.
*base_dir* is a string or :term:`path-like object` specifying a directory
where we start archiving from; i.e. *base_dir* will be the common prefix of
all files and di... | trusted_official_docs | CPython Docs | directory of the archive, all paths in the archive will be relative to it; for example, we typically chdir into *root_dir* before creating the archive.
*base_dir* is a string or :term:`path-like object` specifying a directory
where we start archiving from; i.e. *base_dir* will be the common prefix of
all files and di... | directory of the archive, all paths in the archive will be relative to it; for example, we typically chdir into *root_dir* before creating the archive.
*base_dir* is a string or :term:`path-like object` specifying a directory
where we start archiving from; i.e. *base_dir* will be the common prefix of
all files and di... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
89e68c51-1907-4adc-babe-b44c3937ed12 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,559 | supabase-export-v2 | 6302e668343a3bb0 | omitted, such errors are handled by calling a handler specified by *onexc* or *onerror* or, if both are omitted, exceptions are propagated to the caller.
This function can support :ref:`paths relative to directory descriptors
<dir_fd>`. | trusted_official_docs | CPython Docs | omitted, such errors are handled by calling a handler specified by *onexc* or *onerror* or, if both are omitted, exceptions are propagated to the caller.
This function can support :ref:`paths relative to directory descriptors
<dir_fd>`. | omitted, such errors are handled by calling a handler specified by *onexc* or *onerror* or, if both are omitted, exceptions are propagated to the caller.
This function can support :ref:`paths relative to directory descriptors
<dir_fd>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8a64ba47-2948-4b15-a666-43e079b1cda9 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,517 | supabase-export-v2 | 2069db186027b40b | Not all platforms provide the ability to examine and modify symbolic links. Python itself can tell you what functionality is locally available.
* If ``os.chmod in os.supports_follow_symlinks`` is
``True``, :func:`copystat` can modify the permission
bits of a symbolic link. | trusted_official_docs | CPython Docs | Not all platforms provide the ability to examine and modify symbolic links. Python itself can tell you what functionality is locally available.
* If ``os.chmod in os.supports_follow_symlinks`` is
``True``, :func:`copystat` can modify the permission
bits of a symbolic link. | Not all platforms provide the ability to examine and modify symbolic links. Python itself can tell you what functionality is locally available.
* If ``os.chmod in os.supports_follow_symlinks`` is
``True``, :func:`copystat` can modify the permission
bits of a symbolic link. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8d43c482-36d0-4785-a8a1-be34c1616181 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,539 | supabase-export-v2 | 9513b12374c8a8b6 | .. versionchanged:: 3.3 Added *follow_symlinks* argument, try to copy extended file system attributes too (currently Linux only). Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shuti... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 Added *follow_symlinks* argument, try to copy extended file system attributes too (currently Linux only). Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shuti... | .. versionchanged:: 3.3 Added *follow_symlinks* argument, try to copy extended file system attributes too (currently Linux only). Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shuti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8da61c1a-b3f1-44cf-9f37-f440c36d666d | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,647 | supabase-export-v2 | 27adae8256d3046c | High-level utilities to create and read compressed and archived files are also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]]) | trusted_official_docs | CPython Docs | High-level utilities to create and read compressed and archived files are also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]]) | High-level utilities to create and read compressed and archived files are also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
91c6c921-5bd5-44f3-9bb7-27f075015450 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,579 | supabase-export-v2 | 8a9f1fc211dc152c | If *dst* already exists but is not a directory, it may be overwritten depending on :func:`os.rename` semantics.
If the destination is on the current filesystem, then :func:`os.rename` is
used. Otherwise, *src* is copied to the destination using *copy_function*
and then removed. In case of symlinks, a new symlink poin... | trusted_official_docs | CPython Docs | If *dst* already exists but is not a directory, it may be overwritten depending on :func:`os.rename` semantics.
If the destination is on the current filesystem, then :func:`os.rename` is
used. Otherwise, *src* is copied to the destination using *copy_function*
and then removed. In case of symlinks, a new symlink poin... | If *dst* already exists but is not a directory, it may be overwritten depending on :func:`os.rename` semantics.
If the destination is on the current filesystem, then :func:`os.rename` is
used. Otherwise, *src* is copied to the destination using *copy_function*
and then removed. In case of symlinks, a new symlink poin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
922477ac-f5c5-4cdc-99d8-f2e256ecc4fe | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,690 | supabase-export-v2 | e71f33e1f2730af4 | .. function:: register_unpack_format(name, extensions, function[, extra_args[, description]])
Registers an unpack format. *name* is the name of the format and
*extensions* is a list of extensions corresponding to the format, like
``.zip`` for Zip files. | trusted_official_docs | CPython Docs | .. function:: register_unpack_format(name, extensions, function[, extra_args[, description]])
Registers an unpack format. *name* is the name of the format and
*extensions* is a list of extensions corresponding to the format, like
``.zip`` for Zip files. | .. function:: register_unpack_format(name, extensions, function[, extra_args[, description]])
Registers an unpack format. *name* is the name of the format and
*extensions* is a list of extensions corresponding to the format, like
``.zip`` for Zip files. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
92e5a752-26db-4507-90a8-2b695f2fa639 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,571 | supabase-export-v2 | b785a257136693cb | .. versionchanged:: 3.12 Added the *onexc* parameter, deprecated *onerror*.
.. versionchanged:: 3.13
:func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all
but the top-level path. Exceptions other than :exc:`OSError` and subclasses of :exc:`!OSError`
are now always propagated to the caller. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.12 Added the *onexc* parameter, deprecated *onerror*.
.. versionchanged:: 3.13
:func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all
but the top-level path. Exceptions other than :exc:`OSError` and subclasses of :exc:`!OSError`
are now always propagated to the caller. | .. versionchanged:: 3.12 Added the *onexc* parameter, deprecated *onerror*.
.. versionchanged:: 3.13
:func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all
but the top-level path. Exceptions other than :exc:`OSError` and subclasses of :exc:`!OSError`
are now always propagated to the caller. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
943e5c86-2308-4b16-a736-a96f05d1501d | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,513 | supabase-export-v2 | 82b4d08f9d12d66b | .. function:: copystat(src, dst, *, follow_symlinks=True)
Copy the permission bits, last access time, last modification time, and
flags from *src* to *dst*. On Linux, :func:`copystat` also copies the
"extended attributes" where possible. The file contents, owner, and
group are unaffected. *src* and *dst* are :term:`... | trusted_official_docs | CPython Docs | .. function:: copystat(src, dst, *, follow_symlinks=True)
Copy the permission bits, last access time, last modification time, and
flags from *src* to *dst*. On Linux, :func:`copystat` also copies the
"extended attributes" where possible. The file contents, owner, and
group are unaffected. *src* and *dst* are :term:`... | .. function:: copystat(src, dst, *, follow_symlinks=True)
Copy the permission bits, last access time, last modification time, and
flags from *src* to *dst*. On Linux, :func:`copystat` also copies the
"extended attributes" where possible. The file contents, owner, and
group are unaffected. *src* and *dst* are :term:`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
95300e63-5253-4b2c-9f75-fdc12b762bbf | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,704 | supabase-export-v2 | 719756868fb5251f | In this example, we create a gzip'ed tar-file archive containing all files found in the :file:`.ssh` directory of the user::
>>> from shutil import make_archive
>>> import os
>>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))
>>> root_dir = os.path.expanduser(os.path.join('~', '.ssh'))
>>> make_a... | trusted_official_docs | CPython Docs | In this example, we create a gzip'ed tar-file archive containing all files found in the :file:`.ssh` directory of the user::
>>> from shutil import make_archive
>>> import os
>>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))
>>> root_dir = os.path.expanduser(os.path.join('~', '.ssh'))
>>> make_a... | In this example, we create a gzip'ed tar-file archive containing all files found in the :file:`.ssh` directory of the user::
>>> from shutil import make_archive
>>> import os
>>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))
>>> root_dir = os.path.expanduser(os.path.join('~', '.ssh'))
>>> make_a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
96debf21-0822-4e42-83a2-f2ac5ef383df | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,546 | supabase-export-v2 | a4404c30f0059df5 | copied as far as the platform allows; if false or omitted, the contents and metadata of the linked files are copied to the new tree.
When *symlinks* is false, if the file pointed to by the symlink doesn't
exist, an exception will be added in the list of errors raised in
an :exc:`Error` exception at the end of the cop... | trusted_official_docs | CPython Docs | copied as far as the platform allows; if false or omitted, the contents and metadata of the linked files are copied to the new tree.
When *symlinks* is false, if the file pointed to by the symlink doesn't
exist, an exception will be added in the list of errors raised in
an :exc:`Error` exception at the end of the cop... | copied as far as the platform allows; if false or omitted, the contents and metadata of the linked files are copied to the new tree.
When *symlinks* is false, if the file pointed to by the symlink doesn't
exist, an exception will be added in the list of errors raised in
an :exc:`Error` exception at the end of the cop... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c036b0a-28f0-4af2-b4bd-4d0294dd63b8 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,545 | supabase-export-v2 | 6339c2a8e420ad59 | Permissions and times of directories are copied with :func:`copystat`, individual files are copied using :func:`~shutil.copy2`.
If *symlinks* is true, symbolic links in the source tree are represented as
symbolic links in the new tree and the metadata of the original links will
be copied as far as the platform allows... | trusted_official_docs | CPython Docs | Permissions and times of directories are copied with :func:`copystat`, individual files are copied using :func:`~shutil.copy2`.
If *symlinks* is true, symbolic links in the source tree are represented as
symbolic links in the new tree and the metadata of the original links will
be copied as far as the platform allows... | Permissions and times of directories are copied with :func:`copystat`, individual files are copied using :func:`~shutil.copy2`.
If *symlinks* is true, symbolic links in the source tree are represented as
symbolic links in the new tree and the metadata of the original links will
be copied as far as the platform allows... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9f3c5b0a-2523-412f-b24f-a0039b108351 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,723 | supabase-export-v2 | ab9618900ab595cc | When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the terminal connected to :data:`sys.__stdout__` is queried by invoking :func:`os.get_terminal_size`.
If the terminal size cannot be successfully queried, either because
the system doesn't support querying, or because we are not
connected to a te... | trusted_official_docs | CPython Docs | When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the terminal connected to :data:`sys.__stdout__` is queried by invoking :func:`os.get_terminal_size`.
If the terminal size cannot be successfully queried, either because
the system doesn't support querying, or because we are not
connected to a te... | When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the terminal connected to :data:`sys.__stdout__` is queried by invoking :func:`os.get_terminal_size`.
If the terminal size cannot be successfully queried, either because
the system doesn't support querying, or because we are not
connected to a te... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa1901cc-d658-43a9-870d-94e8105c5bbd | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,578 | supabase-export-v2 | fa77d7178dab9caf | existing directory or a symlink to a directory, then *src* is moved inside that directory. The destination path in that directory must not already exist.
If *dst* already exists but is not a directory, it may be overwritten
depending on :func:`os.rename` semantics. | trusted_official_docs | CPython Docs | existing directory or a symlink to a directory, then *src* is moved inside that directory. The destination path in that directory must not already exist.
If *dst* already exists but is not a directory, it may be overwritten
depending on :func:`os.rename` semantics. | existing directory or a symlink to a directory, then *src* is moved inside that directory. The destination path in that directory must not already exist.
If *dst* already exists but is not a directory, it may be overwritten
depending on :func:`os.rename` semantics. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ab0d1c38-5d72-4ed1-958f-cd7b185d60cc | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,617 | supabase-export-v2 | 1c0fe675dd3a5081 | Platform-dependent efficient copy operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting from Python 3.8, all functions involving a file copy
(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`,
:func:`copytree`, and :func:`move`) may use
platform-specific "fast-copy" syscalls in order to copy the file mor... | trusted_official_docs | CPython Docs | Platform-dependent efficient copy operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting from Python 3.8, all functions involving a file copy
(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`,
:func:`copytree`, and :func:`move`) may use
platform-specific "fast-copy" syscalls in order to copy the file mor... | Platform-dependent efficient copy operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting from Python 3.8, all functions involving a file copy
(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`,
:func:`copytree`, and :func:`move`) may use
platform-specific "fast-copy" syscalls in order to copy the file mor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ab2f45a8-1ee8-4c85-b138-b37811f64fce | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,580 | supabase-export-v2 | caa602b66bc18377 | removed. In case of symlinks, a new symlink pointing to the target of *src* will be created as the destination and *src* will be removed.
If *copy_function* is given, it must be a callable that takes two arguments,
*src* and the destination, and will be used to copy *src* to the destination
if :func:`os.rename` canno... | trusted_official_docs | CPython Docs | removed. In case of symlinks, a new symlink pointing to the target of *src* will be created as the destination and *src* will be removed.
If *copy_function* is given, it must be a callable that takes two arguments,
*src* and the destination, and will be used to copy *src* to the destination
if :func:`os.rename` canno... | removed. In case of symlinks, a new symlink pointing to the target of *src* will be created as the destination and *src* will be removed.
If *copy_function* is given, it must be a callable that takes two arguments,
*src* and the destination, and will be used to copy *src* to the destination
if :func:`os.rename` canno... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aba92d45-f402-467f-b177-2a0d3b3a971a | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,525 | supabase-export-v2 | 54c2674b99ebe75b | .. function:: copy(src, dst, *, follow_symlinks=True)
Copies the file *src* to the file or directory *dst*. *src* and *dst*
should be :term:`path-like objects <path-like object>` or strings. If
*dst* specifies a directory, the file will be copied into *dst* using the
base filename from *src*. If *dst* specifies a fi... | trusted_official_docs | CPython Docs | .. function:: copy(src, dst, *, follow_symlinks=True)
Copies the file *src* to the file or directory *dst*. *src* and *dst*
should be :term:`path-like objects <path-like object>` or strings. If
*dst* specifies a directory, the file will be copied into *dst* using the
base filename from *src*. If *dst* specifies a fi... | .. function:: copy(src, dst, *, follow_symlinks=True)
Copies the file *src* to the file or directory *dst*. *src* and *dst*
should be :term:`path-like objects <path-like object>` or strings. If
*dst* specifies a directory, the file will be copied into *dst* using the
base filename from *src*. If *dst* specifies a fi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ac774309-973c-4bc0-ab99-ca16ff25ecb6 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,497 | supabase-export-v2 | fda7cde5119e490d | raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this function.
If *follow_symlinks* is false and *src* is a symbolic link,
a new symbolic link will be created instead of copying the
file *src* points to. | trusted_official_docs | CPython Docs | raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this function.
If *follow_symlinks* is false and *src* is a symbolic link,
a new symbolic link will be created instead of copying the
file *src* points to. | raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this function.
If *follow_symlinks* is false and *src* is a symbolic link,
a new symbolic link will be created instead of copying the
file *src* points to. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
adc4b58f-c01a-4dac-8908-99ad8a8e4c9a | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,721 | supabase-export-v2 | d755d1c92feee4bd | Get the size of the terminal window.
For each of the two dimensions, the environment variable, ``COLUMNS``
and ``LINES`` respectively, is checked. If the variable is defined and
the value is a positive integer, it is used. | trusted_official_docs | CPython Docs | Get the size of the terminal window.
For each of the two dimensions, the environment variable, ``COLUMNS``
and ``LINES`` respectively, is checked. If the variable is defined and
the value is a positive integer, it is used. | Get the size of the terminal window.
For each of the two dimensions, the environment variable, ``COLUMNS``
and ``LINES`` respectively, is checked. If the variable is defined and
the value is a positive integer, it is used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b06f96cc-d5e8-4409-acd8-ef895156914a | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,672 | supabase-export-v2 | 826dda9450e6ed6d | *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. Further arguments are passed as keyword arguments: *owner*, *group*, *dry_run* and *logger* (as passed in :func:`make_archive`).
If *function* has the custom attribute ``function.supports_root_dir`` set to ``True``,
the *root_dir* argument is pa... | trusted_official_docs | CPython Docs | *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. Further arguments are passed as keyword arguments: *owner*, *group*, *dry_run* and *logger* (as passed in :func:`make_archive`).
If *function* has the custom attribute ``function.supports_root_dir`` set to ``True``,
the *root_dir* argument is pa... | *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. Further arguments are passed as keyword arguments: *owner*, *group*, *dry_run* and *logger* (as passed in :func:`make_archive`).
If *function* has the custom attribute ``function.supports_root_dir`` set to ``True``,
the *root_dir* argument is pa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0d2a0b1-419a-43c5-9f3c-ff5e9f605103 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,521 | supabase-export-v2 | ad4a4fe02d053706 | some or all of this functionality is unavailable, when asked to modify a symbolic link, :func:`copystat` will copy everything it can. :func:`copystat` never returns failure.
Please see :data:`os.supports_follow_symlinks`
for more information. | trusted_official_docs | CPython Docs | some or all of this functionality is unavailable, when asked to modify a symbolic link, :func:`copystat` will copy everything it can. :func:`copystat` never returns failure.
Please see :data:`os.supports_follow_symlinks`
for more information. | some or all of this functionality is unavailable, when asked to modify a symbolic link, :func:`copystat` will copy everything it can. :func:`copystat` never returns failure.
Please see :data:`os.supports_follow_symlinks`
for more information. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0d4a4bb-43c6-41a8-9260-284f186f9371 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,662 | supabase-export-v2 | 596744bf396ef252 | .. versionchanged:: 3.8 The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU format for archives created with ``format="tar"``.
.. versionchanged:: 3.10.6
This function is now made thread-safe during creation of standard
``.zip`` and tar archives. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.8 The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU format for archives created with ``format="tar"``.
.. versionchanged:: 3.10.6
This function is now made thread-safe during creation of standard
``.zip`` and tar archives. | .. versionchanged:: 3.8 The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU format for archives created with ``format="tar"``.
.. versionchanged:: 3.10.6
This function is now made thread-safe during creation of standard
``.zip`` and tar archives. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b2f8f7fd-4173-4e72-8733-c17c02b43b39 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,601 | supabase-export-v2 | f52a26ee3d7a1c9c | .. function:: which(cmd, mode=os.F_OK | os.X_OK, path=None)
Return the path to an executable which would be run if the given *cmd* was
called. If no *cmd* would be called, return ``None``. | trusted_official_docs | CPython Docs | .. function:: which(cmd, mode=os.F_OK | os.X_OK, path=None)
Return the path to an executable which would be run if the given *cmd* was
called. If no *cmd* would be called, return ``None``. | .. function:: which(cmd, mode=os.F_OK | os.X_OK, path=None)
Return the path to an executable which would be run if the given *cmd* was
called. If no *cmd* would be called, return ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b4753ad7-acab-4a19-b383-c7f73a89f1b6 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,551 | supabase-export-v2 | b7c15f09fb676995 | copying operation will continue if it encounters existing directories, and files within the *dst* tree will be overwritten by corresponding files from the *src* tree.
.. audit-event:: shutil.copytree src,dst shutil.copytree | trusted_official_docs | CPython Docs | copying operation will continue if it encounters existing directories, and files within the *dst* tree will be overwritten by corresponding files from the *src* tree.
.. audit-event:: shutil.copytree src,dst shutil.copytree | copying operation will continue if it encounters existing directories, and files within the *dst* tree will be overwritten by corresponding files from the *src* tree.
.. audit-event:: shutil.copytree src,dst shutil.copytree | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b4b7e80e-20cd-4e9f-b014-ac6cf3970265 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,722 | supabase-export-v2 | 600abd3f89fe479f | dimensions, the environment variable, ``COLUMNS`` and ``LINES`` respectively, is checked. If the variable is defined and the value is a positive integer, it is used.
When ``COLUMNS`` or ``LINES`` is not defined, which is the common case,
the terminal connected to :data:`sys.__stdout__` is queried
by invoking :func:`o... | trusted_official_docs | CPython Docs | dimensions, the environment variable, ``COLUMNS`` and ``LINES`` respectively, is checked. If the variable is defined and the value is a positive integer, it is used.
When ``COLUMNS`` or ``LINES`` is not defined, which is the common case,
the terminal connected to :data:`sys.__stdout__` is queried
by invoking :func:`o... | dimensions, the environment variable, ``COLUMNS`` and ``LINES`` respectively, is checked. If the variable is defined and the value is a positive integer, it is used.
When ``COLUMNS`` or ``LINES`` is not defined, which is the common case,
the terminal connected to :data:`sys.__stdout__` is queried
by invoking :func:`o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6705836-b002-4274-a035-972481987570 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,655 | supabase-export-v2 | bf3eb49674bce834 | If *dry_run* is true, no archive is created, but the operations that would be executed are logged to *logger*.
*owner* and *group* are used when creating a tar archive. By default,
uses the current owner and group. | trusted_official_docs | CPython Docs | If *dry_run* is true, no archive is created, but the operations that would be executed are logged to *logger*.
*owner* and *group* are used when creating a tar archive. By default,
uses the current owner and group. | If *dry_run* is true, no archive is created, but the operations that would be executed are logged to *logger*.
*owner* and *group* are used when creating a tar archive. By default,
uses the current owner and group. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8087545-a85a-446f-8d80-30dbb8f0abd9 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,534 | supabase-export-v2 | 0e4fd52510b831cf | Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to preserve file metadata.
When *follow_symlinks* is false, and *src* is a symbolic
link, :func:`copy2` attempts to copy all metadata from the
*src* symbolic link to the newly created *dst* symbolic link. However, this functionality is not avai... | trusted_official_docs | CPython Docs | Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to preserve file metadata.
When *follow_symlinks* is false, and *src* is a symbolic
link, :func:`copy2` attempts to copy all metadata from the
*src* symbolic link to the newly created *dst* symbolic link. However, this functionality is not avai... | Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to preserve file metadata.
When *follow_symlinks* is false, and *src* is a symbolic
link, :func:`copy2` attempts to copy all metadata from the
*src* symbolic link to the newly created *dst* symbolic link. However, this functionality is not avai... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cbf48780-3b40-44c8-8813-54331c1e5279 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,715 | supabase-export-v2 | 1390e6af80eafaaa | from shutil import make_archive >>> import os >>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive')) >>> make_archive( ... archive_name, ... 'tar', ... root_dir='tmp/root', ... base_dir='structure/content', ... ) '/Users/tarek/myarchive.tar'
Listing the files in the resulting archive gives us: | trusted_official_docs | CPython Docs | from shutil import make_archive >>> import os >>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive')) >>> make_archive( ... archive_name, ... 'tar', ... root_dir='tmp/root', ... base_dir='structure/content', ... ) '/Users/tarek/myarchive.tar'
Listing the files in the resulting archive gives us: | from shutil import make_archive >>> import os >>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive')) >>> make_archive( ... archive_name, ... 'tar', ... root_dir='tmp/root', ... base_dir='structure/content', ... ) '/Users/tarek/myarchive.tar'
Listing the files in the resulting archive gives us: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cfd3f059-92c6-4ef6-9ca2-f936960d9316 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,589 | supabase-export-v2 | f87bc379aeb78b8b | .. note::
On Unix filesystems, *path* must point to a path within a **mounted**
filesystem partition. On those platforms, CPython doesn't attempt to
retrieve disk usage information from non-mounted filesystems. | trusted_official_docs | CPython Docs | .. note::
On Unix filesystems, *path* must point to a path within a **mounted**
filesystem partition. On those platforms, CPython doesn't attempt to
retrieve disk usage information from non-mounted filesystems. | .. note::
On Unix filesystems, *path* must point to a path within a **mounted**
filesystem partition. On those platforms, CPython doesn't attempt to
retrieve disk usage information from non-mounted filesystems. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cfda5c6c-f897-49c0-b125-e67617616577 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,542 | supabase-export-v2 | 97487f0228a22815 | be used as a callable for :func:`copytree`\'s *ignore* argument, ignoring files and directories that match one of the glob-style *patterns* provided. See the example below.
.. function:: copytree(src, dst, symlinks=False, ignore=None, \
copy_function=copy2, ignore_dangling_symlinks=False, \
dirs_exist_ok=False) | trusted_official_docs | CPython Docs | be used as a callable for :func:`copytree`\'s *ignore* argument, ignoring files and directories that match one of the glob-style *patterns* provided. See the example below.
.. function:: copytree(src, dst, symlinks=False, ignore=None, \
copy_function=copy2, ignore_dangling_symlinks=False, \
dirs_exist_ok=False) | be used as a callable for :func:`copytree`\'s *ignore* argument, ignoring files and directories that match one of the glob-style *patterns* provided. See the example below.
.. function:: copytree(src, dst, symlinks=False, ignore=None, \
copy_function=copy2, ignore_dangling_symlinks=False, \
dirs_exist_ok=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d31d8154-f884-45a6-b057-77a5ea5934ef | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,651 | supabase-export-v2 | 155b9c83096f94b0 | module is available), "bztar" (if the :mod:`bz2` module is available), "xztar" (if the :mod:`lzma` module is available), or "zstdtar" (if the :mod:`compression.zstd` module is available).
*root_dir* is a string or :term:`path-like object` specifying a directory
that will be the root directory of the archive, all paths... | trusted_official_docs | CPython Docs | module is available), "bztar" (if the :mod:`bz2` module is available), "xztar" (if the :mod:`lzma` module is available), or "zstdtar" (if the :mod:`compression.zstd` module is available).
*root_dir* is a string or :term:`path-like object` specifying a directory
that will be the root directory of the archive, all paths... | module is available), "bztar" (if the :mod:`bz2` module is available), "xztar" (if the :mod:`lzma` module is available), or "zstdtar" (if the :mod:`compression.zstd` module is available).
*root_dir* is a string or :term:`path-like object` specifying a directory
that will be the root directory of the archive, all paths... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d31e0027-a68b-4508-8253-16bc75e8622b | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,520 | supabase-export-v2 | cae494ed3e652fad | * If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not available on all platforms.)
On platforms where some or all of this functionality
is unavailable, when asked to modify a symbolic link,
:func:`copystat` will copy everything... | trusted_official_docs | CPython Docs | * If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not available on all platforms.)
On platforms where some or all of this functionality
is unavailable, when asked to modify a symbolic link,
:func:`copystat` will copy everything... | * If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not available on all platforms.)
On platforms where some or all of this functionality
is unavailable, when asked to modify a symbolic link,
:func:`copystat` will copy everything... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d3db5fa4-7b87-4f24-8246-9aaeb7aeaf1e | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,667 | supabase-export-v2 | f9b6ee9408461b34 | By default :mod:`!shutil` provides these formats:
- *zip*: ZIP file (if the :mod:`zlib` module is available). - *tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives. - *gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available). - *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is ava... | trusted_official_docs | CPython Docs | By default :mod:`!shutil` provides these formats:
- *zip*: ZIP file (if the :mod:`zlib` module is available). - *tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives. - *gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available). - *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is ava... | By default :mod:`!shutil` provides these formats:
- *zip*: ZIP file (if the :mod:`zlib` module is available). - *tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives. - *gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available). - *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is ava... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d7f7e480-3d91-4c95-b891-7951d3bd6317 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,526 | supabase-export-v2 | 13ff9435e5795588 | the base filename from *src*. If *dst* specifies a file that already exists, it will be replaced. Returns the path to the newly created file.
If *follow_symlinks* is false, and *src* is a symbolic link,
*dst* will be created as a symbolic link. If *follow_symlinks*
is true and *src* is a symbolic link, *dst* will be ... | trusted_official_docs | CPython Docs | the base filename from *src*. If *dst* specifies a file that already exists, it will be replaced. Returns the path to the newly created file.
If *follow_symlinks* is false, and *src* is a symbolic link,
*dst* will be created as a symbolic link. If *follow_symlinks*
is true and *src* is a symbolic link, *dst* will be ... | the base filename from *src*. If *dst* specifies a file that already exists, it will be replaced. Returns the path to the newly created file.
If *follow_symlinks* is false, and *src* is a symbolic link,
*dst* will be created as a symbolic link. If *follow_symlinks*
is true and *src* is a symbolic link, *dst* will be ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e16f0c19-3527-412c-b191-65e2dfb2a9b7 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,531 | supabase-export-v2 | 948b6f2831f35b2e | .. versionchanged:: 3.3 Added *follow_symlinks* argument. Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shutil-platform-dependent-efficient-copy-operations` section. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 Added *follow_symlinks* argument. Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shutil-platform-dependent-efficient-copy-operations` section. | .. versionchanged:: 3.3 Added *follow_symlinks* argument. Now returns path to the newly created file.
.. versionchanged:: 3.8
Platform-specific fast-copy syscalls may be used internally in order to
copy the file more efficiently. See
:ref:`shutil-platform-dependent-efficient-copy-operations` section. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e1c93964-4d26-4929-b2fc-2964588f906f | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,528 | supabase-export-v2 | 07ad4b3ef9fccf51 | (see :func:`os.chmod`). Other metadata, like the file's creation and modification times, is not preserved. To preserve all file metadata from the original, use :func:`~shutil.copy2` instead.
.. audit-event:: shutil.copyfile src,dst shutil.copy | trusted_official_docs | CPython Docs | (see :func:`os.chmod`). Other metadata, like the file's creation and modification times, is not preserved. To preserve all file metadata from the original, use :func:`~shutil.copy2` instead.
.. audit-event:: shutil.copyfile src,dst shutil.copy | (see :func:`os.chmod`). Other metadata, like the file's creation and modification times, is not preserved. To preserve all file metadata from the original, use :func:`~shutil.copy2` instead.
.. audit-event:: shutil.copyfile src,dst shutil.copy | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e2e28567-314f-4d0c-9859-5e12063dff7e | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,710 | supabase-export-v2 | 99a940451e70bdc6 | Archiving example with *base_dir* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this example, similar to the `one above <shutil-archiving-example_>`_,
we show how to use :func:`make_archive`, but this time with the usage of
*base_dir*. We now have the following directory structure: | trusted_official_docs | CPython Docs | Archiving example with *base_dir* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this example, similar to the `one above <shutil-archiving-example_>`_,
we show how to use :func:`make_archive`, but this time with the usage of
*base_dir*. We now have the following directory structure: | Archiving example with *base_dir* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this example, similar to the `one above <shutil-archiving-example_>`_,
we show how to use :func:`make_archive`, but this time with the usage of
*base_dir*. We now have the following directory structure: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3b60a0c-97b3-4bc1-b2b9-1d53273fa17d | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,510 | supabase-export-v2 | a4f337902fe2fcde | more information. If :func:`copymode` cannot modify symbolic links on the local platform, and it is asked to do so, it will do nothing and return.
.. audit-event:: shutil.copymode src,dst shutil.copymode | trusted_official_docs | CPython Docs | more information. If :func:`copymode` cannot modify symbolic links on the local platform, and it is asked to do so, it will do nothing and return.
.. audit-event:: shutil.copymode src,dst shutil.copymode | more information. If :func:`copymode` cannot modify symbolic links on the local platform, and it is asked to do so, it will do nothing and return.
.. audit-event:: shutil.copymode src,dst shutil.copymode | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e63b29b5-56dc-4ea7-914b-4982ff03ea54 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,661 | supabase-export-v2 | ac0a0fe9ee0e35b4 | :func:`register_archive_format` do not support the *root_dir* argument. In this case it temporarily changes the current working directory of the process to *root_dir* to perform archiving.
.. versionchanged:: 3.8
The modern pax (POSIX.1-2001) format is now used instead of
the legacy GNU format for archives created wi... | trusted_official_docs | CPython Docs | :func:`register_archive_format` do not support the *root_dir* argument. In this case it temporarily changes the current working directory of the process to *root_dir* to perform archiving.
.. versionchanged:: 3.8
The modern pax (POSIX.1-2001) format is now used instead of
the legacy GNU format for archives created wi... | :func:`register_archive_format` do not support the *root_dir* argument. In this case it temporarily changes the current working directory of the process to *root_dir* to perform archiving.
.. versionchanged:: 3.8
The modern pax (POSIX.1-2001) format is now used instead of
the legacy GNU format for archives created wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6e2decc-5524-402e-b145-9e9c9d68e6c4 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,491 | supabase-export-v2 | 082157b08fb6c50c | .. function:: copyfileobj(fsrc, fdst[, length])
Copy the contents of the :term:`file-like object <file object>` *fsrc* to the file-like object *fdst*. The integer *length*, if given, is the buffer size. In particular, a negative
*length* value means to copy the data without looping over the source data in
chunks; by ... | trusted_official_docs | CPython Docs | .. function:: copyfileobj(fsrc, fdst[, length])
Copy the contents of the :term:`file-like object <file object>` *fsrc* to the file-like object *fdst*. The integer *length*, if given, is the buffer size. In particular, a negative
*length* value means to copy the data without looping over the source data in
chunks; by ... | .. function:: copyfileobj(fsrc, fdst[, length])
Copy the contents of the :term:`file-like object <file object>` *fsrc* to the file-like object *fdst*. The integer *length*, if given, is the buffer size. In particular, a negative
*length* value means to copy the data without looping over the source data in
chunks; by ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4f5aeb6-581a-4342-9f4e-e00ba3040154 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,681 | supabase-export-v2 | 20a5410cc567d42d | *extract_dir* is the name of the target directory where the archive is unpacked. If not provided, the current working directory is used.
*format* is the archive format: one of "zip", "tar", "gztar", "bztar",
"xztar", or "zstdtar". Or any other format registered with
:func:`register_unpack_format`. If not provided, :f... | trusted_official_docs | CPython Docs | *extract_dir* is the name of the target directory where the archive is unpacked. If not provided, the current working directory is used.
*format* is the archive format: one of "zip", "tar", "gztar", "bztar",
"xztar", or "zstdtar". Or any other format registered with
:func:`register_unpack_format`. If not provided, :f... | *extract_dir* is the name of the target directory where the archive is unpacked. If not provided, the current working directory is used.
*format* is the archive format: one of "zip", "tar", "gztar", "bztar",
"xztar", or "zstdtar". Or any other format registered with
:func:`register_unpack_format`. If not provided, :f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f740f224-df45-4b36-87c3-1cce3977fd87 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,653 | supabase-export-v2 | 99a898b1a060aed5 | of all files and directories in the archive. *base_dir* must be given relative to *root_dir*. See :ref:`shutil-archiving-example-with-basedir` for how to use *base_dir* and *root_dir* together.
*root_dir* and *base_dir* both default to the current directory. | trusted_official_docs | CPython Docs | of all files and directories in the archive. *base_dir* must be given relative to *root_dir*. See :ref:`shutil-archiving-example-with-basedir` for how to use *base_dir* and *root_dir* together.
*root_dir* and *base_dir* both default to the current directory. | of all files and directories in the archive. *base_dir* must be given relative to *root_dir*. See :ref:`shutil-archiving-example-with-basedir` for how to use *base_dir* and *root_dir* together.
*root_dir* and *base_dir* both default to the current directory. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f7e8c8e8-4016-463c-a860-ce9036ba6778 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,527 | supabase-export-v2 | 0a984b63a87b6e17 | as a symbolic link. If *follow_symlinks* is true and *src* is a symbolic link, *dst* will be a copy of the file *src* refers to.
:func:`~shutil.copy` copies the file data and the file's permission
mode (see :func:`os.chmod`). Other metadata, like the
file's creation and modification times, is not preserved. To preser... | trusted_official_docs | CPython Docs | as a symbolic link. If *follow_symlinks* is true and *src* is a symbolic link, *dst* will be a copy of the file *src* refers to.
:func:`~shutil.copy` copies the file data and the file's permission
mode (see :func:`os.chmod`). Other metadata, like the
file's creation and modification times, is not preserved. To preser... | as a symbolic link. If *follow_symlinks* is true and *src* is a symbolic link, *dst* will be a copy of the file *src* refers to.
:func:`~shutil.copy` copies the file data and the file's permission
mode (see :func:`os.chmod`). Other metadata, like the
file's creation and modification times, is not preserved. To preser... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f945ca98-4e0a-4a67-901b-4cc5e9d7015c | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,621 | supabase-export-v2 | f5da49cef6013221 | On Solaris :func:`os.sendfile` is used.
On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB
instead of 64 KiB) and a :func:`memoryview`-based variant of
:func:`shutil.copyfileobj` is used, which still reads and writes in a loop. :func:`shutil.copy2` uses the native ``CopyFile2`` call on Windows,... | trusted_official_docs | CPython Docs | On Solaris :func:`os.sendfile` is used.
On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB
instead of 64 KiB) and a :func:`memoryview`-based variant of
:func:`shutil.copyfileobj` is used, which still reads and writes in a loop. :func:`shutil.copy2` uses the native ``CopyFile2`` call on Windows,... | On Solaris :func:`os.sendfile` is used.
On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB
instead of 64 KiB) and a :func:`memoryview`-based variant of
:func:`shutil.copyfileobj` is used, which still reads and writes in a loop. :func:`shutil.copy2` uses the native ``CopyFile2`` call on Windows,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9b04f3c-e213-4aa2-8e17-39a720f20c60 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,514 | supabase-export-v2 | cc316f6ef0892194 | attributes" where possible. The file contents, owner, and group are unaffected. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings.
If *follow_symlinks* is false, and *src* and *dst* both
refer to symbolic links, :func:`copystat` will operate on
the symbolic links themselv... | trusted_official_docs | CPython Docs | attributes" where possible. The file contents, owner, and group are unaffected. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings.
If *follow_symlinks* is false, and *src* and *dst* both
refer to symbolic links, :func:`copystat` will operate on
the symbolic links themselv... | attributes" where possible. The file contents, owner, and group are unaffected. *src* and *dst* are :term:`path-like objects <path-like object>` or path names given as strings.
If *follow_symlinks* is false, and *src* and *dst* both
refer to symbolic links, :func:`copystat` will operate on
the symbolic links themselv... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa087c8b-5396-4e7c-bece-f9ea31e5a74f | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,585 | supabase-export-v2 | 6bf8563951ceb609 | .. versionchanged:: 3.8 Platform-specific fast-copy syscalls may be used internally in order to copy the file more efficiently. See :ref:`shutil-platform-dependent-efficient-copy-operations` section.
.. versionchanged:: 3.9
Accepts a :term:`path-like object` for both *src* and *dst*. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.8 Platform-specific fast-copy syscalls may be used internally in order to copy the file more efficiently. See :ref:`shutil-platform-dependent-efficient-copy-operations` section.
.. versionchanged:: 3.9
Accepts a :term:`path-like object` for both *src* and *dst*. | .. versionchanged:: 3.8 Platform-specific fast-copy syscalls may be used internally in order to copy the file more efficiently. See :ref:`shutil-platform-dependent-efficient-copy-operations` section.
.. versionchanged:: 3.9
Accepts a :term:`path-like object` for both *src* and *dst*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fac62bda-a776-4baa-be2c-d2c236ec45a7 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,543 | supabase-export-v2 | 72e3ea7256035a24 | .. function:: copytree(src, dst, symlinks=False, ignore=None, \ copy_function=copy2, ignore_dangling_symlinks=False, \ dirs_exist_ok=False)
Recursively copy an entire directory tree rooted at *src* to a directory
named *dst* and return the destination directory. All intermediate
directories needed to contain *dst* wi... | trusted_official_docs | CPython Docs | .. function:: copytree(src, dst, symlinks=False, ignore=None, \ copy_function=copy2, ignore_dangling_symlinks=False, \ dirs_exist_ok=False)
Recursively copy an entire directory tree rooted at *src* to a directory
named *dst* and return the destination directory. All intermediate
directories needed to contain *dst* wi... | .. function:: copytree(src, dst, symlinks=False, ignore=None, \ copy_function=copy2, ignore_dangling_symlinks=False, \ dirs_exist_ok=False)
Recursively copy an entire directory tree rooted at *src* to a directory
named *dst* and return the destination directory. All intermediate
directories needed to contain *dst* wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fbb4f18a-89ca-464d-9a5b-b71aa131d435 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,673 | supabase-export-v2 | 0fabc631df26521a | keyword argument. Otherwise the current working directory of the process is temporarily changed to *root_dir* before calling *function*. In this case :func:`make_archive` is not thread-safe.
If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be
used as extra keywords arguments when the archiver ... | trusted_official_docs | CPython Docs | keyword argument. Otherwise the current working directory of the process is temporarily changed to *root_dir* before calling *function*. In this case :func:`make_archive` is not thread-safe.
If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be
used as extra keywords arguments when the archiver ... | keyword argument. Otherwise the current working directory of the process is temporarily changed to *root_dir* before calling *function*. In this case :func:`make_archive` is not thread-safe.
If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be
used as extra keywords arguments when the archiver ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fbfdb662-3a22-4c39-a4d1-b568bd7c6034 | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,604 | supabase-export-v2 | 013a036d6d5968c5 | delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:`PATH` environment variable is read from :data:`os.environ`, falling back to :data:`os.defpath` if it is not set.
If *cmd* contains a directory component, :func:`!which` only checks the
specified path directly and does not search the directories... | trusted_official_docs | CPython Docs | delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:`PATH` environment variable is read from :data:`os.environ`, falling back to :data:`os.defpath` if it is not set.
If *cmd* contains a directory component, :func:`!which` only checks the
specified path directly and does not search the directories... | delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:`PATH` environment variable is read from :data:`os.environ`, falling back to :data:`os.defpath` if it is not set.
If *cmd* contains a directory component, :func:`!which` only checks the
specified path directly and does not search the directories... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ff385633-b879-48f4-9c0a-eca494ff8ccf | CPython Docs | file://datasets/cpython/Doc/library/shutil.rst | unknown | b92e3f29-fd26-4f65-ba96-e5a7ef6657ee | 52,674 | supabase-export-v2 | 96adf4b7e5158fef | If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be used as extra keywords arguments when the archiver callable is used.
*description* is used by :func:`get_archive_formats` which returns the
list of archivers. Defaults to an empty string. | trusted_official_docs | CPython Docs | If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be used as extra keywords arguments when the archiver callable is used.
*description* is used by :func:`get_archive_formats` which returns the
list of archivers. Defaults to an empty string. | If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be used as extra keywords arguments when the archiver callable is used.
*description* is used by :func:`get_archive_formats` which returns the
list of archivers. Defaults to an empty string. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
03e9aea2-5e6e-4858-b042-6589fb662bbe | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,737 | supabase-export-v2 | 6e4c060fc8dd2680 | of running out of memory. All error messages are written to the standard error stream; normal output from executed commands is written to standard output.
Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) to the primary or
secondary prompt cancels the input and returns to the primary prompt. [#... | trusted_official_docs | CPython Docs | of running out of memory. All error messages are written to the standard error stream; normal output from executed commands is written to standard output.
Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) to the primary or
secondary prompt cancels the input and returns to the primary prompt. [#... | of running out of memory. All error messages are written to the standard error stream; normal output from executed commands is written to standard output.
Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) to the primary or
secondary prompt cancels the input and returns to the primary prompt. [#... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0df3ef0b-342e-41ec-8b4d-3e48db19f575 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,732 | supabase-export-v2 | 2f6e2f8d2296e3a1 | There are two variants of the interactive :term:`REPL`. The classic basic interpreter is supported on all platforms with minimal line control capabilities.
Since Python 3.13, a new interactive shell is used by default. This one supports color, multiline editing, history browsing, and
paste mode. To disable color, see :... | trusted_official_docs | CPython Docs | There are two variants of the interactive :term:`REPL`. The classic basic interpreter is supported on all platforms with minimal line control capabilities.
Since Python 3.13, a new interactive shell is used by default. This one supports color, multiline editing, history browsing, and
paste mode. To disable color, see :... | There are two variants of the interactive :term:`REPL`. The classic basic interpreter is supported on all platforms with minimal line control capabilities.
Since Python 3.13, a new interactive shell is used by default. This one supports color, multiline editing, history browsing, and
paste mode. To disable color, see :... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d39e2dc-f2d0-4e0d-8ee3-e59f7fdd67fd | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,742 | supabase-export-v2 | 6922ea0bd21ae7da | #!/usr/bin/env python3
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the
first two characters of the file. On some platforms, this first line must end
with a Unix-style line ending (``'\n'``), not a Windows (``'\... | trusted_official_docs | CPython Docs | #!/usr/bin/env python3
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the
first two characters of the file. On some platforms, this first line must end
with a Unix-style line ending (``'\n'``), not a Windows (``'\... | #!/usr/bin/env python3
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
of the script and giving the file an executable mode. The ``#!`` must be the
first two characters of the file. On some platforms, this first line must end
with a Unix-style line ending (``'\n'``), not a Windows (``'\... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
66156f58-a682-4015-ac31-6ad442912fdd | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,756 | supabase-export-v2 | 5825e4a766cf2972 | and :index:`usercustomize`. To see how it works, you need first to find the location of your user site-packages directory. Start Python and run this code::
>>> import site
>>> site.getusersitepackages()
'/home/user/.local/lib/python3.x/site-packages' | trusted_official_docs | CPython Docs | and :index:`usercustomize`. To see how it works, you need first to find the location of your user site-packages directory. Start Python and run this code::
>>> import site
>>> site.getusersitepackages()
'/home/user/.local/lib/python3.x/site-packages' | and :index:`usercustomize`. To see how it works, you need first to find the location of your user site-packages directory. Start Python and run this code::
>>> import site
>>> site.getusersitepackages()
'/home/user/.local/lib/python3.x/site-packages' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6f24da4a-645c-44b0-a9a8-820c89b84df1 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,757 | supabase-export-v2 | ce617755de3fac1e | >>> import site >>> site.getusersitepackages() '/home/user/.local/lib/python3.x/site-packages'
Now you can create a file named :file:`usercustomize.py` in that directory and
put anything you want in it. It will affect every invocation of Python, unless
it is started with the :option:`-s` option to disable the automatic... | trusted_official_docs | CPython Docs | >>> import site >>> site.getusersitepackages() '/home/user/.local/lib/python3.x/site-packages'
Now you can create a file named :file:`usercustomize.py` in that directory and
put anything you want in it. It will affect every invocation of Python, unless
it is started with the :option:`-s` option to disable the automatic... | >>> import site >>> site.getusersitepackages() '/home/user/.local/lib/python3.x/site-packages'
Now you can create a file named :file:`usercustomize.py` in that directory and
put anything you want in it. It will affect every invocation of Python, unless
it is started with the :option:`-s` option to disable the automatic... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
750a4204-3115-42e3-a2d2-c317a78a5c26 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,749 | supabase-export-v2 | 53805a62736c7cb6 | The Interactive Startup File ----------------------------
When you use Python interactively, it is frequently handy to have some standard
commands executed every time the interpreter is started. You can do this by
setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a
file containing your start-... | trusted_official_docs | CPython Docs | The Interactive Startup File ----------------------------
When you use Python interactively, it is frequently handy to have some standard
commands executed every time the interpreter is started. You can do this by
setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a
file containing your start-... | The Interactive Startup File ----------------------------
When you use Python interactively, it is frequently handy to have some standard
commands executed every time the interpreter is started. You can do this by
setting an environment variable named :envvar:`PYTHONSTARTUP` to the name of a
file containing your start-... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
75e37211-54fe-4d17-90e7-97f76899be07 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,734 | supabase-export-v2 | 01d6e0a8570a3f9b | When using the new interactive shell, exit the shell by typing :kbd:`exit` or :kbd:`quit`. Adding call parentheses after those commands is not required.
If the new interactive shell is not desired, it can be disabled via
the :envvar:`PYTHON_BASIC_REPL` environment variable. | trusted_official_docs | CPython Docs | When using the new interactive shell, exit the shell by typing :kbd:`exit` or :kbd:`quit`. Adding call parentheses after those commands is not required.
If the new interactive shell is not desired, it can be disabled via
the :envvar:`PYTHON_BASIC_REPL` environment variable. | When using the new interactive shell, exit the shell by typing :kbd:`exit` or :kbd:`quit`. Adding call parentheses after those commands is not required.
If the new interactive shell is not desired, it can be disabled via
the :envvar:`PYTHON_BASIC_REPL` environment variable. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7956ade4-b8ee-45ba-bf5e-9fd149f63556 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,755 | supabase-export-v2 | e025a48f4245095b | The Customization Modules -------------------------
Python provides two hooks to let you customize it: :index:`sitecustomize` and
:index:`usercustomize`. To see how it works, you need first to find the location
of your user site-packages directory. Start Python and run this code:: | trusted_official_docs | CPython Docs | The Customization Modules -------------------------
Python provides two hooks to let you customize it: :index:`sitecustomize` and
:index:`usercustomize`. To see how it works, you need first to find the location
of your user site-packages directory. Start Python and run this code:: | The Customization Modules -------------------------
Python provides two hooks to let you customize it: :index:`sitecustomize` and
:index:`usercustomize`. To see how it works, you need first to find the location
of your user site-packages directory. Start Python and run this code:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7c954a63-a421-4c9d-a915-00cd73b99033 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,752 | supabase-export-v2 | 79554fb76d61fc38 | using code like ``if os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you want to use the startup file in a script, you must do this explicitly in the script::
import os
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
with open(filename) as fobj:
startup_f... | trusted_official_docs | CPython Docs | using code like ``if os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you want to use the startup file in a script, you must do this explicitly in the script::
import os
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
with open(filename) as fobj:
startup_f... | using code like ``if os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you want to use the startup file in a script, you must do this explicitly in the script::
import os
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
with open(filename) as fobj:
startup_f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8604efc8-b2e0-49af-a076-872ab16427d1 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,736 | supabase-export-v2 | 741437e13f0a5c4a | Error Handling --------------
When an error occurs, the interpreter prints an error message and a stack trace. In interactive mode, it then returns to the primary prompt; when input came from
a file, it exits with a nonzero exit status after printing the stack trace. (Exceptions handled by an :keyword:`except` clause i... | trusted_official_docs | CPython Docs | Error Handling --------------
When an error occurs, the interpreter prints an error message and a stack trace. In interactive mode, it then returns to the primary prompt; when input came from
a file, it exits with a nonzero exit status after printing the stack trace. (Exceptions handled by an :keyword:`except` clause i... | Error Handling --------------
When an error occurs, the interpreter prints an error message and a stack trace. In interactive mode, it then returns to the primary prompt; when input came from
a file, it exits with a nonzero exit status after printing the stack trace. (Exceptions handled by an :keyword:`except` clause i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9fe4e169-e9e4-4c61-8ee8-bf986f8822af | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,733 | supabase-export-v2 | c1346e34cf82dfbe | the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters "paste mode", which makes pasting larger blocks of code easier. Press :kbd:`F3` to return to the regular prompt.
When using the new interactive shell, exit the shell by typing :kbd:`exit`
or :kbd:`quit`. Adding call parentheses after those commands is not
requir... | trusted_official_docs | CPython Docs | the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters "paste mode", which makes pasting larger blocks of code easier. Press :kbd:`F3` to return to the regular prompt.
When using the new interactive shell, exit the shell by typing :kbd:`exit`
or :kbd:`quit`. Adding call parentheses after those commands is not
requir... | the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters "paste mode", which makes pasting larger blocks of code easier. Press :kbd:`F3` to return to the regular prompt.
When using the new interactive shell, exit the shell by typing :kbd:`exit`
or :kbd:`quit`. Adding call parentheses after those commands is not
requir... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a43af2a5-c380-4c69-bdc5-74b37711415e | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,750 | supabase-export-v2 | 57a57c4b1eb38023 | environment variable named :envvar:`PYTHONSTARTUP` to the name of a file containing your start-up commands. This is similar to the :file:`.profile` feature of the Unix shells.
This file is only read in interactive sessions, not when Python reads commands
from a script, and not when :file:`/dev/tty` is given as the expl... | trusted_official_docs | CPython Docs | environment variable named :envvar:`PYTHONSTARTUP` to the name of a file containing your start-up commands. This is similar to the :file:`.profile` feature of the Unix shells.
This file is only read in interactive sessions, not when Python reads commands
from a script, and not when :file:`/dev/tty` is given as the expl... | environment variable named :envvar:`PYTHONSTARTUP` to the name of a file containing your start-up commands. This is similar to the :file:`.profile` feature of the Unix shells.
This file is only read in interactive sessions, not when Python reads commands
from a script, and not when :file:`/dev/tty` is given as the expl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bdb1b9fb-15d3-4473-95d2-ee1c2d0044f9 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,746 | supabase-export-v2 | 498468f939a89ada | $ chmod +x myscript.py
On Windows systems, there is no notion of an "executable mode". The Python
installer automatically associates ``.py`` files with ``python.exe`` so that
a double-click on a Python file will run it as a script. The extension can
also be ``.pyw``, in that case, the console window that normally appea... | trusted_official_docs | CPython Docs | $ chmod +x myscript.py
On Windows systems, there is no notion of an "executable mode". The Python
installer automatically associates ``.py`` files with ``python.exe`` so that
a double-click on a Python file will run it as a script. The extension can
also be ``.pyw``, in that case, the console window that normally appea... | $ chmod +x myscript.py
On Windows systems, there is no notion of an "executable mode". The Python
installer automatically associates ``.py`` files with ``python.exe`` so that
a double-click on a Python file will run it as a script. The extension can
also be ``.pyw``, in that case, the console window that normally appea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d0b41ec8-357b-4621-b24d-cc1708c99764 | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,751 | supabase-export-v2 | b35c94cdbf7033a5 | it defines or imports can be used without qualification in the interactive session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this file.
If you want to read an additional start-up file from the current directory, you
can program this in the global start-up file using code like ``if
os.path.isfile('... | trusted_official_docs | CPython Docs | it defines or imports can be used without qualification in the interactive session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this file.
If you want to read an additional start-up file from the current directory, you
can program this in the global start-up file using code like ``if
os.path.isfile('... | it defines or imports can be used without qualification in the interactive session. You can also change the prompts ``sys.ps1`` and ``sys.ps2`` in this file.
If you want to read an additional start-up file from the current directory, you
can program this in the global start-up file using code like ``if
os.path.isfile('... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f08e5919-8104-4247-b50b-0fe56dc1d7fa | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,758 | supabase-export-v2 | 7591385baee4e43e | anything you want in it. It will affect every invocation of Python, unless it is started with the :option:`-s` option to disable the automatic import.
:index:`sitecustomize` works in the same way, but is typically created by an
administrator of the computer in the global site-packages directory, and is
imported before ... | trusted_official_docs | CPython Docs | anything you want in it. It will affect every invocation of Python, unless it is started with the :option:`-s` option to disable the automatic import.
:index:`sitecustomize` works in the same way, but is typically created by an
administrator of the computer in the global site-packages directory, and is
imported before ... | anything you want in it. It will affect every invocation of Python, unless it is started with the :option:`-s` option to disable the automatic import.
:index:`sitecustomize` works in the same way, but is typically created by an
administrator of the computer in the global site-packages directory, and is
imported before ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4a6e23b-b634-4d30-9438-bb1d5b60bc0e | CPython Docs | file://datasets/cpython/Doc/tutorial/appendix.rst | unknown | 39be2b3f-aef0-437b-894f-38977933ebbd | 52,743 | supabase-export-v2 | d7286f5a8da49bf8 | line ending (``'\n'``), not a Windows (``'\r\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is used to start a comment in Python.
The script can be given an executable mode, or permission, using the
:program:`chmod` command. | trusted_official_docs | CPython Docs | line ending (``'\n'``), not a Windows (``'\r\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is used to start a comment in Python.
The script can be given an executable mode, or permission, using the
:program:`chmod` command. | line ending (``'\n'``), not a Windows (``'\r\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is used to start a comment in Python.
The script can be given an executable mode, or permission, using the
:program:`chmod` command. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3a94d57d-4643-481b-a956-d88189df9fc3 | CPython Docs | file://datasets/cpython/Doc/tutorial/interactive.rst | unknown | c02abf1f-b0b4-43e1-8802-47f7bede5372 | 52,770 | supabase-export-v2 | 0a2446d0ac791166 | completion, object exploration and advanced history management. It can also be thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is bpython_.
.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html
.. _IPython: https://ipython.org/
.. _bpython: h... | trusted_official_docs | CPython Docs | completion, object exploration and advanced history management. It can also be thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is bpython_.
.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html
.. _IPython: https://ipython.org/
.. _bpython: h... | completion, object exploration and advanced history management. It can also be thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is bpython_.
.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html
.. _IPython: https://ipython.org/
.. _bpython: h... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f4e46ce-940c-4f06-a2e7-6176b543d046 | CPython Docs | file://datasets/cpython/Doc/tutorial/interactive.rst | unknown | c02abf1f-b0b4-43e1-8802-47f7bede5372 | 52,762 | supabase-export-v2 | 1196ca7c5dadd8d7 | ************************************************** Interactive Input Editing and History Substitution **************************************************
Some versions of the Python interpreter support editing of the current input
line and history substitution, similar to facilities found in the Korn shell and
the GNU B... | trusted_official_docs | CPython Docs | ************************************************** Interactive Input Editing and History Substitution **************************************************
Some versions of the Python interpreter support editing of the current input
line and history substitution, similar to facilities found in the Korn shell and
the GNU B... | ************************************************** Interactive Input Editing and History Substitution **************************************************
Some versions of the Python interpreter support editing of the current input
line and history substitution, similar to facilities found in the Korn shell and
the GNU B... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7daf5af0-3f6e-4181-8f84-f79c68b9f9c2 | CPython Docs | file://datasets/cpython/Doc/tutorial/interactive.rst | unknown | c02abf1f-b0b4-43e1-8802-47f7bede5372 | 52,769 | supabase-export-v2 | 0860ada5d21b6667 | next). The completion mechanism might use the interpreter's symbol table. A command to check (or even suggest) matching parentheses, quotes, etc., would also be useful.
One alternative enhanced interactive interpreter that has been around for quite
some time is IPython_, which features tab completion, object exploratio... | trusted_official_docs | CPython Docs | next). The completion mechanism might use the interpreter's symbol table. A command to check (or even suggest) matching parentheses, quotes, etc., would also be useful.
One alternative enhanced interactive interpreter that has been around for quite
some time is IPython_, which features tab completion, object exploratio... | next). The completion mechanism might use the interpreter's symbol table. A command to check (or even suggest) matching parentheses, quotes, etc., would also be useful.
One alternative enhanced interactive interpreter that has been around for quite
some time is IPython_, which features tab completion, object exploratio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bd6d6097-c545-49cd-a1cd-cd4996102ba5 | CPython Docs | file://datasets/cpython/Doc/tutorial/interactive.rst | unknown | c02abf1f-b0b4-43e1-8802-47f7bede5372 | 52,768 | supabase-export-v2 | 4cdf9644b446d1a9 | Alternatives to the Interactive Interpreter ===========================================
This facility is an enormous step forward compared to earlier versions of the
interpreter; however, some wishes are left: It would be nice if the proper
indentation were suggested on continuation lines (the parser knows if an
:data:... | trusted_official_docs | CPython Docs | Alternatives to the Interactive Interpreter ===========================================
This facility is an enormous step forward compared to earlier versions of the
interpreter; however, some wishes are left: It would be nice if the proper
indentation were suggested on continuation lines (the parser knows if an
:data:... | Alternatives to the Interactive Interpreter ===========================================
This facility is an enormous step forward compared to earlier versions of the
interpreter; however, some wishes are left: It would be nice if the proper
indentation were suggested on continuation lines (the parser knows if an
:data:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc02f122-bb5e-434b-ba36-f638f6378a72 | CPython Docs | file://datasets/cpython/Doc/tutorial/interactive.rst | unknown | c02abf1f-b0b4-43e1-8802-47f7bede5372 | 52,765 | supabase-export-v2 | 3362dbba0520f7a0 | Tab Completion and History Editing ==================================
Completion of variable and module names is
:ref:`automatically enabled <rlcompleter-config>` at interpreter startup so
that the :kbd:`Tab` key invokes the completion function; it looks at
Python statement names, the current local variables, and the a... | trusted_official_docs | CPython Docs | Tab Completion and History Editing ==================================
Completion of variable and module names is
:ref:`automatically enabled <rlcompleter-config>` at interpreter startup so
that the :kbd:`Tab` key invokes the completion function; it looks at
Python statement names, the current local variables, and the a... | Tab Completion and History Editing ==================================
Completion of variable and module names is
:ref:`automatically enabled <rlcompleter-config>` at interpreter startup so
that the :kbd:`Tab` key invokes the completion function; it looks at
Python statement names, the current local variables, and the a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01a0604c-9957-4798-8502-1a7bc80d6559 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,952 | supabase-export-v2 | c0e915b2cc85f803 | automatically saved between calls. This made the function easier to write and much more clear than an approach using instance variables like ``self.index`` and ``self.data``.
In addition to automatic method creation and saving program state, when
generators terminate, they automatically raise :exc:`StopIteration`. In
c... | trusted_official_docs | CPython Docs | automatically saved between calls. This made the function easier to write and much more clear than an approach using instance variables like ``self.index`` and ``self.data``.
In addition to automatic method creation and saving program state, when
generators terminate, they automatically raise :exc:`StopIteration`. In
c... | automatically saved between calls. This made the function easier to write and much more clear than an approach using instance variables like ``self.index`` and ``self.data``.
In addition to automatic method creation and saving program state, when
generators terminate, they automatically raise :exc:`StopIteration`. In
c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
083f8658-f58a-409d-b28f-cb84dfead180 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,896 | supabase-export-v2 | 56f2cf6737ad7791 | class attribute is searched, descending down the chain of base classes if necessary, and the method reference is valid if this yields a function object.
Derived classes may override methods of their base classes. Because methods
have no special privileges when calling other methods of the same object, a
method of a bas... | trusted_official_docs | CPython Docs | class attribute is searched, descending down the chain of base classes if necessary, and the method reference is valid if this yields a function object.
Derived classes may override methods of their base classes. Because methods
have no special privileges when calling other methods of the same object, a
method of a bas... | class attribute is searched, descending down the chain of base classes if necessary, and the method reference is valid if this yields a function object.
Derived classes may override methods of their base classes. Because methods
have no special privileges when calling other methods of the same object, a
method of a bas... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
094a2ad5-126e-4997-92b4-f4deb9b8946f | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,907 | supabase-export-v2 | fa07205973f0f349 | to :func:`super`. This approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages.
Dynamic ordering is necessary because all cases of multiple inheritance exhibit
one or more diamond relationships (where at least one ... | trusted_official_docs | CPython Docs | to :func:`super`. This approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages.
Dynamic ordering is necessary because all cases of multiple inheritance exhibit
one or more diamond relationships (where at least one ... | to :func:`super`. This approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages.
Dynamic ordering is necessary because all cases of multiple inheritance exhibit
one or more diamond relationships (where at least one ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a124004-1998-44d8-ae18-b028caf9d0eb | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,786 | supabase-export-v2 | 3587152646b2d234 | of a module called :mod:`__main__`, so they have their own global namespace. (The built-in names actually also live in a module; this is called :mod:`builtins`.)
The local namespace for a function is created when the function is called, and
deleted when the function returns or raises an exception that is not handled
wi... | trusted_official_docs | CPython Docs | of a module called :mod:`__main__`, so they have their own global namespace. (The built-in names actually also live in a module; this is called :mod:`builtins`.)
The local namespace for a function is created when the function is called, and
deleted when the function returns or raises an exception that is not handled
wi... | of a module called :mod:`__main__`, so they have their own global namespace. (The built-in names actually also live in a module; this is called :mod:`builtins`.)
The local namespace for a function is created when the function is called, and
deleted when the function returns or raises an exception that is not handled
wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0dd2da75-d48d-44f9-8a3d-e0e5c258c02c | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,824 | supabase-export-v2 | 38d0405d764186ae | def f(self): return 'hello world'
then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, returning
an integer and a function object, respectively. Class attributes can also be
assigned to, so you can change the value of ``MyClass.i`` by assignment. :attr:`~type.__doc__` is also a valid attribute, returnin... | trusted_official_docs | CPython Docs | def f(self): return 'hello world'
then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, returning
an integer and a function object, respectively. Class attributes can also be
assigned to, so you can change the value of ``MyClass.i`` by assignment. :attr:`~type.__doc__` is also a valid attribute, returnin... | def f(self): return 'hello world'
then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, returning
an integer and a function object, respectively. Class attributes can also be
assigned to, so you can change the value of ``MyClass.i`` by assignment. :attr:`~type.__doc__` is also a valid attribute, returnin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0e4df712-4b56-427e-ab5d-6d3ef63f4471 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,841 | supabase-export-v2 | 8818324cccf796d1 | .. index:: pair: object; method
Valid method names of an instance object depend on its class. By definition,
all attributes of a class that are function objects define corresponding
methods of its instances. So in our example, ``x.f`` is a valid method
reference, since ``MyClass.f`` is a function, but ``x.i`` is not, s... | trusted_official_docs | CPython Docs | .. index:: pair: object; method
Valid method names of an instance object depend on its class. By definition,
all attributes of a class that are function objects define corresponding
methods of its instances. So in our example, ``x.f`` is a valid method
reference, since ``MyClass.f`` is a function, but ``x.i`` is not, s... | .. index:: pair: object; method
Valid method names of an instance object depend on its class. By definition,
all attributes of a class that are function objects define corresponding
methods of its instances. So in our example, ``x.f`` is a valid method
reference, since ``MyClass.f`` is a function, but ``x.i`` is not, s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
113f266e-b4cb-46f0-a093-3999da2a1340 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,859 | supabase-export-v2 | 303fa684255aa427 | all dogs 'canine' >>> e.kind # shared by all dogs 'canine' >>> d.name # unique to d 'Fido' >>> e.name # unique to e 'Buddy'
As discussed in :ref:`tut-object`, shared data can have possibly surprising
effects involving :term:`mutable` objects such as lists and dictionaries. For example, the *tricks* list in the followin... | trusted_official_docs | CPython Docs | all dogs 'canine' >>> e.kind # shared by all dogs 'canine' >>> d.name # unique to d 'Fido' >>> e.name # unique to e 'Buddy'
As discussed in :ref:`tut-object`, shared data can have possibly surprising
effects involving :term:`mutable` objects such as lists and dictionaries. For example, the *tricks* list in the followin... | all dogs 'canine' >>> e.kind # shared by all dogs 'canine' >>> d.name # unique to d 'Fido' >>> e.name # unique to e 'Buddy'
As discussed in :ref:`tut-object`, shared data can have possibly surprising
effects involving :term:`mutable` objects such as lists and dictionaries. For example, the *tricks* list in the followin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
12cbd376-33f1-452a-b5f4-cd9d90657110 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,895 | supabase-export-v2 | 3987e91b78c00017 | the search proceeds to look in the base class. This rule is applied recursively if the base class itself is derived from some other class.
There's nothing special about instantiation of derived classes:
``DerivedClassName()`` creates a new instance of the class. Method references
are resolved as follows: the correspond... | trusted_official_docs | CPython Docs | the search proceeds to look in the base class. This rule is applied recursively if the base class itself is derived from some other class.
There's nothing special about instantiation of derived classes:
``DerivedClassName()`` creates a new instance of the class. Method references
are resolved as follows: the correspond... | the search proceeds to look in the base class. This rule is applied recursively if the base class itself is derived from some other class.
There's nothing special about instantiation of derived classes:
``DerivedClassName()`` creates a new instance of the class. Method references
are resolved as follows: the correspond... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13b94516-4c82-4397-98d6-4c2c7fb18f18 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,781 | supabase-export-v2 | ddd53f7343cc2d2a | to know how scopes and namespaces work to fully understand what's going on. Incidentally, knowledge about this subject is useful for any advanced Python programmer.
Let's begin with some definitions. | trusted_official_docs | CPython Docs | to know how scopes and namespaces work to fully understand what's going on. Incidentally, knowledge about this subject is useful for any advanced Python programmer.
Let's begin with some definitions. | to know how scopes and namespaces work to fully understand what's going on. Incidentally, knowledge about this subject is useful for any advanced Python programmer.
Let's begin with some definitions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22470a65-381a-4cc2-966b-9441f0d83bc0 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,964 | supabase-export-v2 | a9e623f56f8f4276 | does not need to be wrapped in an additional set of parentheses. That is to say, the following two pieces of code are semantically equivalent::
>>> f(x for x in y)
>>> f((x for x in y)) | trusted_official_docs | CPython Docs | does not need to be wrapped in an additional set of parentheses. That is to say, the following two pieces of code are semantically equivalent::
>>> f(x for x in y)
>>> f((x for x in y)) | does not need to be wrapped in an additional set of parentheses. That is to say, the following two pieces of code are semantically equivalent::
>>> f(x for x in y)
>>> f((x for x in y)) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
228b2770-16f5-4f35-856b-8915573f2238 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,937 | supabase-export-v2 | ac064029d9d811b5 | print(element) for element in (1, 2, 3): print(element) for key in {'one':1, 'two':2}: print(key) for char in "123": print(char) for line in open("myfile.txt"): print(line, end='')
This style of access is clear, concise, and convenient. The use of iterators
pervades and unifies Python. Behind the scenes, the :keyword:`... | trusted_official_docs | CPython Docs | print(element) for element in (1, 2, 3): print(element) for key in {'one':1, 'two':2}: print(key) for char in "123": print(char) for line in open("myfile.txt"): print(line, end='')
This style of access is clear, concise, and convenient. The use of iterators
pervades and unifies Python. Behind the scenes, the :keyword:`... | print(element) for element in (1, 2, 3): print(element) for key in {'one':1, 'two':2}: print(key) for char in "123": print(char) for line in open("myfile.txt"): print(line, end='')
This style of access is clear, concise, and convenient. The use of iterators
pervades and unifies Python. Behind the scenes, the :keyword:`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23b238fa-c149-4bc1-8312-838d60bcf418 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,882 | supabase-export-v2 | 87d8c9327cd98136 | h = g
Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that refer to
function objects, and consequently they are all methods of instances of
:class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice
usually only serves to confuse the reader of a program. | trusted_official_docs | CPython Docs | h = g
Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that refer to
function objects, and consequently they are all methods of instances of
:class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice
usually only serves to confuse the reader of a program. | h = g
Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that refer to
function objects, and consequently they are all methods of instances of
:class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice
usually only serves to confuse the reader of a program. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
262f307a-8742-4466-b4fe-ad4fce6e07d9 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,785 | supabase-export-v2 | 20e10d7f848d61e5 | Writable attributes may also be deleted with the :keyword:`del` statement. For example, ``del modname.the_answer`` will remove the attribute :attr:`!the_answer` from the object named by ``modname``.
Namespaces are created at different moments and have different lifetimes. The
namespace containing the built-in names is ... | trusted_official_docs | CPython Docs | Writable attributes may also be deleted with the :keyword:`del` statement. For example, ``del modname.the_answer`` will remove the attribute :attr:`!the_answer` from the object named by ``modname``.
Namespaces are created at different moments and have different lifetimes. The
namespace containing the built-in names is ... | Writable attributes may also be deleted with the :keyword:`del` statement. For example, ``del modname.the_answer`` will remove the attribute :attr:`!the_answer` from the object named by ``modname``.
Namespaces are created at different moments and have different lifetimes. The
namespace containing the built-in names is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2865d3cf-daa5-4ca7-8e66-a3d6b013d207 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,846 | supabase-export-v2 | a93a6b113411b9ba | x.f()
If ``x = MyClass()``, as above, this will return the string ``'hello world'``. However, it is not necessary to call a method right away: ``x.f`` is a method
object, and can be stored away and called at a later time. For example:: | trusted_official_docs | CPython Docs | x.f()
If ``x = MyClass()``, as above, this will return the string ``'hello world'``. However, it is not necessary to call a method right away: ``x.f`` is a method
object, and can be stored away and called at a later time. For example:: | x.f()
If ``x = MyClass()``, as above, this will return the string ``'hello world'``. However, it is not necessary to call a method right away: ``x.f`` is a method
object, and can be stored away and called at a later time. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2a176b33-f0b3-42ca-92b5-fcd5760a060f | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,864 | supabase-export-v2 | 1d336ec3d7264065 | def add_trick(self, trick): self.tricks.append(trick)
>>> d = Dog('Fido')
>>> e = Dog('Buddy')
>>> d.add_trick('roll over')
>>> e.add_trick('play dead')
>>> d.tricks # unexpectedly shared by all dogs
['roll over', 'play dead'] | trusted_official_docs | CPython Docs | def add_trick(self, trick): self.tricks.append(trick)
>>> d = Dog('Fido')
>>> e = Dog('Buddy')
>>> d.add_trick('roll over')
>>> e.add_trick('play dead')
>>> d.tricks # unexpectedly shared by all dogs
['roll over', 'play dead'] | def add_trick(self, trick): self.tricks.append(trick)
>>> d = Dog('Fido')
>>> e = Dog('Buddy')
>>> d.add_trick('roll over')
>>> e.add_trick('play dead')
>>> d.tricks # unexpectedly shared by all dogs
['roll over', 'play dead'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2d159c39-3ea9-47a1-b0e0-aa17f75307b8 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,940 | supabase-export-v2 | 2fc19c26943b974e | your classes. Define an :meth:`~container.__iter__` method which returns an object with a :meth:`~iterator.__next__` method. If the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return ``self``::
class Reverse:
"""Iterator for looping over a sequence backwards."""
def __init__(self, data):
self.da... | trusted_official_docs | CPython Docs | your classes. Define an :meth:`~container.__iter__` method which returns an object with a :meth:`~iterator.__next__` method. If the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return ``self``::
class Reverse:
"""Iterator for looping over a sequence backwards."""
def __init__(self, data):
self.da... | your classes. Define an :meth:`~container.__iter__` method which returns an object with a :meth:`~iterator.__next__` method. If the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return ``self``::
class Reverse:
"""Iterator for looping over a sequence backwards."""
def __init__(self, data):
self.da... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e270249-0361-41db-8f37-60f3a8f3fe96 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,883 | supabase-export-v2 | ff3d9eb6f88e7ff1 | of instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice usually only serves to confuse the reader of a program.
Methods may call other methods by using method attributes of the ``self``
argument:: | trusted_official_docs | CPython Docs | of instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice usually only serves to confuse the reader of a program.
Methods may call other methods by using method attributes of the ``self``
argument:: | of instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note that this practice usually only serves to confuse the reader of a program.
Methods may call other methods by using method attributes of the ``self``
argument:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f7a67ec-926c-4704-932c-12a6497fe968 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,838 | supabase-export-v2 | 79c646b2012e4645 | For example, if ``x`` is the instance of :class:`!MyClass` created above, the following piece of code will print the value ``16``, without leaving a trace::
x.counter = 1
while x.counter < 10:
x.counter = x.counter * 2
print(x.counter)
del x.counter | trusted_official_docs | CPython Docs | For example, if ``x`` is the instance of :class:`!MyClass` created above, the following piece of code will print the value ``16``, without leaving a trace::
x.counter = 1
while x.counter < 10:
x.counter = x.counter * 2
print(x.counter)
del x.counter | For example, if ``x`` is the instance of :class:`!MyClass` created above, the following piece of code will print the value ``16``, without leaving a trace::
x.counter = 1
while x.counter < 10:
x.counter = x.counter * 2
print(x.counter)
del x.counter | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33887f2c-ba8a-4dc9-bbfb-e28820bc786b | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,947 | supabase-export-v2 | c47cd116625f83ec | left off (it remembers all the data values and which statement was last executed). An example shows that generators can be trivially easy to create::
def reverse(data):
for index in range(len(data)-1, -1, -1):
yield data[index] | trusted_official_docs | CPython Docs | left off (it remembers all the data values and which statement was last executed). An example shows that generators can be trivially easy to create::
def reverse(data):
for index in range(len(data)-1, -1, -1):
yield data[index] | left off (it remembers all the data values and which statement was last executed). An example shows that generators can be trivially easy to create::
def reverse(data):
for index in range(len(data)-1, -1, -1):
yield data[index] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33a0752e-349c-4403-8138-f9db202aca91 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,793 | supabase-export-v2 | 0058227db72a81ea | definition is evolving towards static name resolution, at "compile" time, so don't rely on dynamic name resolution! (In fact, local variables are already determined statically.)
A special quirk of Python is that -- if no :keyword:`global` or :keyword:`nonlocal`
statement is in effect -- assignments to names always go i... | trusted_official_docs | CPython Docs | definition is evolving towards static name resolution, at "compile" time, so don't rely on dynamic name resolution! (In fact, local variables are already determined statically.)
A special quirk of Python is that -- if no :keyword:`global` or :keyword:`nonlocal`
statement is in effect -- assignments to names always go i... | definition is evolving towards static name resolution, at "compile" time, so don't rely on dynamic name resolution! (In fact, local variables are already determined statically.)
A special quirk of Python is that -- if no :keyword:`global` or :keyword:`nonlocal`
statement is in effect -- assignments to names always go i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
35bd23f2-26fc-4f6f-a3c9-2d9bba6ff794 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,897 | supabase-export-v2 | d134b7cd72d2f1ba | base class may end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively ``virtual``.)
An overriding method in a derived class may in fact want to extend rather than
simply replace the base class method of the same name. There is a simple way to
call the b... | trusted_official_docs | CPython Docs | base class may end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively ``virtual``.)
An overriding method in a derived class may in fact want to extend rather than
simply replace the base class method of the same name. There is a simple way to
call the b... | base class may end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively ``virtual``.)
An overriding method in a derived class may in fact want to extend rather than
simply replace the base class method of the same name. There is a simple way to
call the b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3706e77f-9298-4587-b78d-e99d32ed27cb | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,874 | supabase-export-v2 | 3ac2cb84aaa1d7ac | = 'west' ... >>> w1 = Warehouse() >>> print(w1.purpose, w1.region) storage west >>> w2 = Warehouse() >>> w2.region = 'east' >>> print(w2.purpose, w2.region) storage east
Data attributes may be referenced by methods as well as by ordinary users
("clients") of an object. In other words, classes are not usable to implemen... | trusted_official_docs | CPython Docs | = 'west' ... >>> w1 = Warehouse() >>> print(w1.purpose, w1.region) storage west >>> w2 = Warehouse() >>> w2.region = 'east' >>> print(w2.purpose, w2.region) storage east
Data attributes may be referenced by methods as well as by ordinary users
("clients") of an object. In other words, classes are not usable to implemen... | = 'west' ... >>> w1 = Warehouse() >>> print(w1.purpose, w1.region) storage west >>> w2 = Warehouse() >>> w2.region = 'east' >>> print(w2.purpose, w2.region) storage east
Data attributes may be referenced by methods as well as by ordinary users
("clients") of an object. In other words, classes are not usable to implemen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b8ff99b-cf59-48e1-b58e-f18d9307a1f1 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,847 | supabase-export-v2 | da90b3d1e3d461a5 | necessary to call a method right away: ``x.f`` is a method object, and can be stored away and called at a later time. For example::
xf = x.f
while True:
print(xf()) | trusted_official_docs | CPython Docs | necessary to call a method right away: ``x.f`` is a method object, and can be stored away and called at a later time. For example::
xf = x.f
while True:
print(xf()) | necessary to call a method right away: ``x.f`` is a method object, and can be stored away and called at a later time. For example::
xf = x.f
while True:
print(xf()) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f42c922-a559-4b3e-8dc4-73738874ab95 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,887 | supabase-export-v2 | c645e1715c4bf969 | def addtwice(self, x): self.add(x) self.add(x)
Methods may reference global names in the same way as ordinary functions. The
global scope associated with a method is the module containing its
definition. (A class is never used as a global scope.) While one
rarely encounters a good reason for using global data in a meth... | trusted_official_docs | CPython Docs | def addtwice(self, x): self.add(x) self.add(x)
Methods may reference global names in the same way as ordinary functions. The
global scope associated with a method is the module containing its
definition. (A class is never used as a global scope.) While one
rarely encounters a good reason for using global data in a meth... | def addtwice(self, x): self.add(x) self.add(x)
Methods may reference global names in the same way as ordinary functions. The
global scope associated with a method is the module containing its
definition. (A class is never used as a global scope.) While one
rarely encounters a good reason for using global data in a meth... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fb127fd-a876-40e5-a35b-7979a8c35f2a | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,936 | supabase-export-v2 | a6eaa9a280302da0 | By now you have probably noticed that most container objects can be looped over using a :keyword:`for` statement::
for element in [1, 2, 3]:
print(element)
for element in (1, 2, 3):
print(element)
for key in {'one':1, 'two':2}:
print(key)
for char in "123":
print(char)
for line in open("myfile.txt"):
print(lin... | trusted_official_docs | CPython Docs | By now you have probably noticed that most container objects can be looped over using a :keyword:`for` statement::
for element in [1, 2, 3]:
print(element)
for element in (1, 2, 3):
print(element)
for key in {'one':1, 'two':2}:
print(key)
for char in "123":
print(char)
for line in open("myfile.txt"):
print(lin... | By now you have probably noticed that most container objects can be looped over using a :keyword:`for` statement::
for element in [1, 2, 3]:
print(element)
for element in (1, 2, 3):
print(element)
for key in {'one':1, 'two':2}:
print(key)
for char in "123":
print(char)
for line in open("myfile.txt"):
print(lin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
406f1f14-6ad8-422f-8bbe-fbc2527df664 | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,938 | supabase-export-v2 | 13e4169e2d325195 | which tells the :keyword:`!for` loop to terminate. You can call the :meth:`~iterator.__next__` method using the :func:`next` built-in function; this example shows how it all works::
>>> s = 'abc'
>>> it = iter(s)
>>> it
<str_iterator object at 0x10c90e650>
>>> next(it)
'a'
>>> next(it)
'b'
>>> next(it)
'c'
>>... | trusted_official_docs | CPython Docs | which tells the :keyword:`!for` loop to terminate. You can call the :meth:`~iterator.__next__` method using the :func:`next` built-in function; this example shows how it all works::
>>> s = 'abc'
>>> it = iter(s)
>>> it
<str_iterator object at 0x10c90e650>
>>> next(it)
'a'
>>> next(it)
'b'
>>> next(it)
'c'
>>... | which tells the :keyword:`!for` loop to terminate. You can call the :meth:`~iterator.__next__` method using the :func:`next` built-in function; this example shows how it all works::
>>> s = 'abc'
>>> it = iter(s)
>>> it
<str_iterator object at 0x10c90e650>
>>> next(it)
'a'
>>> next(it)
'b'
>>> next(it)
'c'
>>... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
498e2b82-eb05-4d51-b8ee-542b5b6952aa | CPython Docs | file://datasets/cpython/Doc/tutorial/classes.rst | unknown | b594dc57-f00f-4188-81c5-6e58c66a5d7f | 52,836 | supabase-export-v2 | 112b2b2a6be8b0de | Instance Objects ----------------
Now what can we do with instance objects? The only operations understood by
instance objects are attribute references. There are two kinds of valid
attribute names: data attributes and methods. | trusted_official_docs | CPython Docs | Instance Objects ----------------
Now what can we do with instance objects? The only operations understood by
instance objects are attribute references. There are two kinds of valid
attribute names: data attributes and methods. | Instance Objects ----------------
Now what can we do with instance objects? The only operations understood by
instance objects are attribute references. There are two kinds of valid
attribute names: data attributes and methods. | 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.