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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3793cf2e-b41a-4649-8d9e-46ca587d8f58 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,964 | supabase-export-v2 | 4160de1d4b15e74e | .. function:: setcbreak(fd, when=termios.TCSAFLUSH)
Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to cbreak mode; this value is ... | trusted_official_docs | CPython Docs | .. function:: setcbreak(fd, when=termios.TCSAFLUSH)
Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to cbreak mode; this value is ... | .. function:: setcbreak(fd, when=termios.TCSAFLUSH)
Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it
defaults to :const:`termios.TCSAFLUSH`, and is passed to
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
is saved before setting *fd* to cbreak mode; this value is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c5290ef-5dbb-4add-af87-167de22249a8 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,965 | supabase-export-v2 | f67383dd085c4956 | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to cbreak mode; this value is returned.
This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting
the minimum input to 1 byte with no delay. | trusted_official_docs | CPython Docs | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to cbreak mode; this value is returned.
This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting
the minimum input to 1 byte with no delay. | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to cbreak mode; this value is returned.
This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting
the minimum input to 1 byte with no delay. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
45369bb4-c599-4e40-b1c0-f32822b4fa5f | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,966 | supabase-export-v2 | 54fe16dac095d418 | This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting the minimum input to 1 byte with no delay.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | trusted_official_docs | CPython Docs | This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting the minimum input to 1 byte with no delay.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting the minimum input to 1 byte with no delay.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
595fb69e-eaca-44ac-bafc-0fa7f1444949 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,962 | supabase-export-v2 | db319998e917d508 | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to raw mode; this value is returned.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | trusted_official_docs | CPython Docs | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to raw mode; this value is returned.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before setting *fd* to raw mode; this value is returned.
.. versionchanged:: 3.12
The return value is now the original tty attributes, instead of ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad61053c-c199-45ab-8438-30263f3929b4 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,967 | supabase-export-v2 | 7b3a3381b6ff087c | .. versionchanged:: 3.12 The return value is now the original tty attributes, instead of ``None``.
.. versionchanged:: 3.12.2
The ``ICRNL`` flag is no longer cleared. This restores the behavior
of Python 3.11 and earlier as well as matching what Linux, macOS, & BSDs
describe in their ``stty(1)`` man pages regarding ... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.12 The return value is now the original tty attributes, instead of ``None``.
.. versionchanged:: 3.12.2
The ``ICRNL`` flag is no longer cleared. This restores the behavior
of Python 3.11 and earlier as well as matching what Linux, macOS, & BSDs
describe in their ``stty(1)`` man pages regarding ... | .. versionchanged:: 3.12 The return value is now the original tty attributes, instead of ``None``.
.. versionchanged:: 3.12.2
The ``ICRNL`` flag is no longer cleared. This restores the behavior
of Python 3.11 and earlier as well as matching what Linux, macOS, & BSDs
describe in their ``stty(1)`` man pages regarding ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d39d7b45-9f68-4b6e-81b3-0538aa98bb24 | CPython Docs | file://datasets/cpython/Doc/library/tty.rst | unknown | 87069e32-57db-4590-b070-606e546cae75 | 49,957 | supabase-export-v2 | 0cb0f85fcfa3e448 | Convert the tty attribute list *mode*, which is a list like the one returned by :func:`termios.tcgetattr`, to that of a tty in cbreak mode.
This clears the ``ECHO`` and ``ICANON`` local mode flags in *mode* as well
as setting the minimum input to 1 byte with no delay. | trusted_official_docs | CPython Docs | Convert the tty attribute list *mode*, which is a list like the one returned by :func:`termios.tcgetattr`, to that of a tty in cbreak mode.
This clears the ``ECHO`` and ``ICANON`` local mode flags in *mode* as well
as setting the minimum input to 1 byte with no delay. | Convert the tty attribute list *mode*, which is a list like the one returned by :func:`termios.tcgetattr`, to that of a tty in cbreak mode.
This clears the ``ECHO`` and ``ICANON`` local mode flags in *mode* as well
as setting the minimum input to 1 byte with no delay. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01c267d2-db82-4793-9427-6844d83e4acb | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,026 | supabase-export-v2 | 58726547bea646d7 | .. function:: compress(data, compresslevel=6, *, mtime=0)
Compress the *data*, returning a :class:`bytes` object containing
the compressed data. *compresslevel* and *mtime* have the same meaning as in
the :class:`GzipFile` constructor above,
but *mtime* defaults to 0 for reproducible output. | trusted_official_docs | CPython Docs | .. function:: compress(data, compresslevel=6, *, mtime=0)
Compress the *data*, returning a :class:`bytes` object containing
the compressed data. *compresslevel* and *mtime* have the same meaning as in
the :class:`GzipFile` constructor above,
but *mtime* defaults to 0 for reproducible output. | .. function:: compress(data, compresslevel=6, *, mtime=0)
Compress the *data*, returning a :class:`bytes` object containing
the compressed data. *compresslevel* and *mtime* have the same meaning as in
the :class:`GzipFile` constructor above,
but *mtime* defaults to 0 for reproducible output. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
093c3b74-fae7-4bc3-b0bb-0194ea17dbd1 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,978 | supabase-export-v2 | c585f5213c738e6c | functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files, automatically compressing or decompressing the data so that it looks like an ordinary :term:`file object`.
Note that additional file formats which can be decompressed by the
:program:`gzip` and :program:`gunzip` programs, such as th... | trusted_official_docs | CPython Docs | functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files, automatically compressing or decompressing the data so that it looks like an ordinary :term:`file object`.
Note that additional file formats which can be decompressed by the
:program:`gzip` and :program:`gunzip` programs, such as th... | functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files, automatically compressing or decompressing the data so that it looks like an ordinary :term:`file object`.
Note that additional file formats which can be decompressed by the
:program:`gzip` and :program:`gunzip` programs, such as th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11c13544-d84a-4884-bd18-a77ecbf91b12 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,977 | supabase-export-v2 | da8fc605a54763cd | The data compression is provided by the :mod:`zlib` module.
The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as the
:func:`.open`, :func:`compress` and :func:`decompress` convenience functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files,
automatically compressing or... | trusted_official_docs | CPython Docs | The data compression is provided by the :mod:`zlib` module.
The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as the
:func:`.open`, :func:`compress` and :func:`decompress` convenience functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files,
automatically compressing or... | The data compression is provided by the :mod:`zlib` module.
The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as the
:func:`.open`, :func:`compress` and :func:`decompress` convenience functions. The :class:`GzipFile` class reads and writes :program:`gzip`\ -format files,
automatically compressing or... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
169a33b7-6da0-47b4-b0b5-91261684cce2 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,984 | supabase-export-v2 | d7d8aa5163f202fc | ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``.
The *compresslevel* argument is an integer from 0 to 9, as for the
:class:`GzipFile` constructor. | trusted_official_docs | CPython Docs | ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``.
The *compresslevel* argument is an integer from 0 to 9, as for the
:class:`GzipFile` constructor. | ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``.
The *compresslevel* argument is an integer from 0 to 9, as for the
:class:`GzipFile` constructor. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16cd0aa7-6220-4aea-8914-69c228e90129 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,000 | supabase-export-v2 | 1ef108724f311745 | the file is always opened in binary mode. To open a compressed file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an :class:`io.TextIOWrapper`).
The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
the level of compression; ``1`` is fastest and produces the least
compressi... | trusted_official_docs | CPython Docs | the file is always opened in binary mode. To open a compressed file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an :class:`io.TextIOWrapper`).
The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
the level of compression; ``1`` is fastest and produces the least
compressi... | the file is always opened in binary mode. To open a compressed file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an :class:`io.TextIOWrapper`).
The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
the level of compression; ``1`` is fastest and produces the least
compressi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1789209f-b112-4137-9241-dd945655f852 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,016 | supabase-export-v2 | 31e045233d95104f | on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path, with no other normalization, resolution or expansion.
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added, along with the
*mtime* constructor argument and :attr:`mtime` attri... | trusted_official_docs | CPython Docs | on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path, with no other normalization, resolution or expansion.
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added, along with the
*mtime* constructor argument and :attr:`mtime` attri... | on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path, with no other normalization, resolution or expansion.
.. versionchanged:: 3.1
Support for the :keyword:`with` statement was added, along with the
*mtime* constructor argument and :attr:`mtime` attri... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f3f39e1-6f69-405a-a868-183a6e48011e | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,020 | supabase-export-v2 | f22c9512ed1a179f | .. versionchanged:: 3.4 Added support for the ``'x'`` and ``'xb'`` modes.
.. versionchanged:: 3.5
Added support for writing arbitrary
:term:`bytes-like objects <bytes-like object>`. The :meth:`~io.BufferedIOBase.read` method now accepts an argument of
``None``. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.4 Added support for the ``'x'`` and ``'xb'`` modes.
.. versionchanged:: 3.5
Added support for writing arbitrary
:term:`bytes-like objects <bytes-like object>`. The :meth:`~io.BufferedIOBase.read` method now accepts an argument of
``None``. | .. versionchanged:: 3.4 Added support for the ``'x'`` and ``'xb'`` modes.
.. versionchanged:: 3.5
Added support for writing arbitrary
:term:`bytes-like objects <bytes-like object>`. The :meth:`~io.BufferedIOBase.read` method now accepts an argument of
``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2371c27a-d6bc-4064-9f22-08c12f07193d | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,008 | supabase-export-v2 | 014a342a63625c37 | Read *n* uncompressed bytes without advancing the file position. The number of bytes returned may be more or less than requested.
.. note:: While calling :meth:`peek` does not change the file position of
the :class:`GzipFile`, it may change the position of the underlying
file object (e.g. if the :class:`GzipFile` was... | trusted_official_docs | CPython Docs | Read *n* uncompressed bytes without advancing the file position. The number of bytes returned may be more or less than requested.
.. note:: While calling :meth:`peek` does not change the file position of
the :class:`GzipFile`, it may change the position of the underlying
file object (e.g. if the :class:`GzipFile` was... | Read *n* uncompressed bytes without advancing the file position. The number of bytes returned may be more or less than requested.
.. note:: While calling :meth:`peek` does not change the file position of
the :class:`GzipFile`, it may change the position of the underlying
file object (e.g. if the :class:`GzipFile` was... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24fa6149-4b4b-444e-882e-6cf89b966694 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,979 | supabase-export-v2 | 0e724c73984d8235 | formats which can be decompressed by the :program:`gzip` and :program:`gunzip` programs, such as those produced by :program:`compress` and :program:`pack`, are not supported by this module.
The module defines the following items: | trusted_official_docs | CPython Docs | formats which can be decompressed by the :program:`gzip` and :program:`gunzip` programs, such as those produced by :program:`compress` and :program:`pack`, are not supported by this module.
The module defines the following items: | formats which can be decompressed by the :program:`gzip` and :program:`gunzip` programs, such as those produced by :program:`compress` and :program:`pack`, are not supported by this module.
The module defines the following items: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
271ab161-df31-4a65-b102-eb9fe3a02963 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,001 | supabase-export-v2 | 12c14b916a6c61ad | ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. ``0`` is no compression. The default is ``9``.
The optional *mtime* argument is the timestamp requested by gzip. The time
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If *mtime* is omit... | trusted_official_docs | CPython Docs | ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. ``0`` is no compression. The default is ``9``.
The optional *mtime* argument is the timestamp requested by gzip. The time
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If *mtime* is omit... | ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. ``0`` is no compression. The default is ``9``.
The optional *mtime* argument is the timestamp requested by gzip. The time
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If *mtime* is omit... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2dfaa993-ac81-49bf-8016-0c29c59fc6d5 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,027 | supabase-export-v2 | 13aa4b02532ebb4d | containing the compressed data. *compresslevel* and *mtime* have the same meaning as in the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for reproducible output.
.. versionadded:: 3.2
.. versionchanged:: 3.8
Added the *mtime* parameter for reproducible output. .. versionchanged:: 3.11
Speed is impr... | trusted_official_docs | CPython Docs | containing the compressed data. *compresslevel* and *mtime* have the same meaning as in the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for reproducible output.
.. versionadded:: 3.2
.. versionchanged:: 3.8
Added the *mtime* parameter for reproducible output. .. versionchanged:: 3.11
Speed is impr... | containing the compressed data. *compresslevel* and *mtime* have the same meaning as in the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for reproducible output.
.. versionadded:: 3.2
.. versionchanged:: 3.8
Added the *mtime* parameter for reproducible output. .. versionchanged:: 3.11
Speed is impr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4243116b-4a2e-4ac0-acac-5bfbf326e897 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,982 | supabase-export-v2 | 8b1f99c392e7aebe | Open a gzip-compressed file in binary or text mode, returning a :term:`file object`.
The *filename* argument can be an actual filename (a :class:`str` or
:class:`bytes` object), or an existing file object to read from or write to. | trusted_official_docs | CPython Docs | Open a gzip-compressed file in binary or text mode, returning a :term:`file object`.
The *filename* argument can be an actual filename (a :class:`str` or
:class:`bytes` object), or an existing file object to read from or write to. | Open a gzip-compressed file in binary or text mode, returning a :term:`file object`.
The *filename* argument can be an actual filename (a :class:`str` or
:class:`bytes` object), or an existing file object to read from or write to. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54575a0c-c32b-4842-b48b-e1340be916bc | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,998 | supabase-export-v2 | 05686889b8b6031e | filename of *fileobj*, if discernible; otherwise, it defaults to the empty string, and in this case the original filename is not included in the header.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``,
``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will be read or
writte... | trusted_official_docs | CPython Docs | filename of *fileobj*, if discernible; otherwise, it defaults to the empty string, and in this case the original filename is not included in the header.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``,
``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will be read or
writte... | filename of *fileobj*, if discernible; otherwise, it defaults to the empty string, and in this case the original filename is not included in the header.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``,
``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will be read or
writte... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
57dccfbb-272d-4cb5-a254-0b29e2892ab8 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,024 | supabase-export-v2 | 58f2d80f17fe1ea3 | .. versionchanged:: 3.12 Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute instead.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.12 Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute instead.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | .. versionchanged:: 3.12 Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute instead.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
58750dee-3d1e-43e6-b376-b95b6d97a411 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,996 | supabase-export-v2 | 60ebf13efb60d232 | methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate` method. At least one of *fileobj* and *filename* must be given a non-trivial value.
The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a fil... | trusted_official_docs | CPython Docs | methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate` method. At least one of *fileobj* and *filename* must be given a non-trivial value.
The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a fil... | methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate` method. At least one of *fileobj* and *filename* must be given a non-trivial value.
The new class instance is based on *fileobj*, which can be a regular file, an
:class:`io.BytesIO` object, or any other object which simulates a fil... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
596d7bfa-dbcc-4744-a036-901e5aeda910 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,002 | supabase-export-v2 | bf1bb5a07ddb9362 | is omitted or ``None``, the current time is used. Use *mtime* = 0 to generate a compressed stream that does not depend on creation time.
See below for the :attr:`mtime` attribute that is set when decompressing. | trusted_official_docs | CPython Docs | is omitted or ``None``, the current time is used. Use *mtime* = 0 to generate a compressed stream that does not depend on creation time.
See below for the :attr:`mtime` attribute that is set when decompressing. | is omitted or ``None``, the current time is used. Use *mtime* = 0 to generate a compressed stream that does not depend on creation time.
See below for the :attr:`mtime` attribute that is set when decompressing. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d2a372b-efe5-417b-839f-f5935dc2e176 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,983 | supabase-export-v2 | 855a86192fa44f09 | The *filename* argument can be an actual filename (a :class:`str` or :class:`bytes` object), or an existing file object to read from or write to.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``,
``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``,
``'at'``, ``'wt'``, or ``'xt'``... | trusted_official_docs | CPython Docs | The *filename* argument can be an actual filename (a :class:`str` or :class:`bytes` object), or an existing file object to read from or write to.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``,
``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``,
``'at'``, ``'wt'``, or ``'xt'``... | The *filename* argument can be an actual filename (a :class:`str` or :class:`bytes` object), or an existing file object to read from or write to.
The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``,
``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``,
``'at'``, ``'wt'``, or ``'xt'``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6f75d05b-d97d-4b3c-b4b5-960203523da8 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,017 | supabase-export-v2 | 64ecc98ec465554c | .. versionchanged:: 3.1 Support for the :keyword:`with` statement was added, along with the *mtime* constructor argument and :attr:`mtime` attribute.
.. versionchanged:: 3.2
Support for zero-padded and unseekable files was added. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.1 Support for the :keyword:`with` statement was added, along with the *mtime* constructor argument and :attr:`mtime` attribute.
.. versionchanged:: 3.2
Support for zero-padded and unseekable files was added. | .. versionchanged:: 3.1 Support for the :keyword:`with` statement was added, along with the *mtime* constructor argument and :attr:`mtime` attribute.
.. versionchanged:: 3.2
Support for zero-padded and unseekable files was added. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
730474e0-2804-4c39-8b52-25ece0fa3bef | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,003 | supabase-export-v2 | 53b117a08c0b4b70 | See below for the :attr:`mtime` attribute that is set when decompressing.
Calling a :class:`GzipFile` object's :meth:`!close` method does not close
*fileobj*, since you might wish to append more material after the compressed
data. This also allows you to pass an :class:`io.BytesIO` object opened for
writing as *file... | trusted_official_docs | CPython Docs | See below for the :attr:`mtime` attribute that is set when decompressing.
Calling a :class:`GzipFile` object's :meth:`!close` method does not close
*fileobj*, since you might wish to append more material after the compressed
data. This also allows you to pass an :class:`io.BytesIO` object opened for
writing as *file... | See below for the :attr:`mtime` attribute that is set when decompressing.
Calling a :class:`GzipFile` object's :meth:`!close` method does not close
*fileobj*, since you might wish to append more material after the compressed
data. This also allows you to pass an :class:`io.BytesIO` object opened for
writing as *file... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
781d50f8-2390-4d10-9ade-e84284cde5e4 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,015 | supabase-export-v2 | 59848438579f5500 | .. attribute:: name
The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path,
with no other normalization, resolution or expansion. | trusted_official_docs | CPython Docs | .. attribute:: name
The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path,
with no other normalization, resolution or expansion. | .. attribute:: name
The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path,
with no other normalization, resolution or expansion. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
78389c37-dc88-48b4-85cb-327e23eba7e4 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,995 | supabase-export-v2 | 67988b527431c57b | .. class:: GzipFile(filename=None, mode=None, compresslevel=6, fileobj=None, mtime=None)
Constructor for the :class:`GzipFile` class, which simulates most of the
methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate`
method. At least one of *fileobj* and *filename* must be given a non... | trusted_official_docs | CPython Docs | .. class:: GzipFile(filename=None, mode=None, compresslevel=6, fileobj=None, mtime=None)
Constructor for the :class:`GzipFile` class, which simulates most of the
methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate`
method. At least one of *fileobj* and *filename* must be given a non... | .. class:: GzipFile(filename=None, mode=None, compresslevel=6, fileobj=None, mtime=None)
Constructor for the :class:`GzipFile` class, which simulates most of the
methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate`
method. At least one of *fileobj* and *filename* must be given a non... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7cc47164-2f0e-45c9-a35a-5a4094ccfcb8 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,986 | supabase-export-v2 | ce2b22bb8a098508 | mode, this function is equivalent to the :class:`GzipFile` constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the *encoding*, *errors* and *newline* arguments must not be provided.
For text mode, a :class:`GzipFile` object is created, and wrapped in an
:class:`io.TextIOWrapper` instance with the s... | trusted_official_docs | CPython Docs | mode, this function is equivalent to the :class:`GzipFile` constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the *encoding*, *errors* and *newline* arguments must not be provided.
For text mode, a :class:`GzipFile` object is created, and wrapped in an
:class:`io.TextIOWrapper` instance with the s... | mode, this function is equivalent to the :class:`GzipFile` constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the *encoding*, *errors* and *newline* arguments must not be provided.
For text mode, a :class:`GzipFile` object is created, and wrapped in an
:class:`io.TextIOWrapper` instance with the s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7d8ec746-9bc1-440b-9070-feb965ab4382 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,988 | supabase-export-v2 | 8f053d9b438a5f2a | .. versionchanged:: 3.3 Added support for *filename* being a file object, support for text mode, and the *encoding*, *errors* and *newline* arguments.
.. versionchanged:: 3.4
Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 Added support for *filename* being a file object, support for text mode, and the *encoding*, *errors* and *newline* arguments.
.. versionchanged:: 3.4
Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes. | .. versionchanged:: 3.3 Added support for *filename* being a file object, support for text mode, and the *encoding*, *errors* and *newline* arguments.
.. versionchanged:: 3.4
Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
869c50d0-dfcd-4d65-8e05-43dae55b7e7f | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,028 | supabase-export-v2 | ff1a9ce8a63bfbaa | speed. In this situation the output may contain a gzip header "OS" byte value other than 255 "unknown" as supplied by the underlying zlib implementation.
.. versionchanged:: 3.13
The gzip header OS byte is guaranteed to be set to 255 when this function
is used as was the case in 3.10 and earlier. .. versionchanged:: ... | trusted_official_docs | CPython Docs | speed. In this situation the output may contain a gzip header "OS" byte value other than 255 "unknown" as supplied by the underlying zlib implementation.
.. versionchanged:: 3.13
The gzip header OS byte is guaranteed to be set to 255 when this function
is used as was the case in 3.10 and earlier. .. versionchanged:: ... | speed. In this situation the output may contain a gzip header "OS" byte value other than 255 "unknown" as supplied by the underlying zlib implementation.
.. versionchanged:: 3.13
The gzip header OS byte is guaranteed to be set to 255 when this function
is used as was the case in 3.10 and earlier. .. versionchanged:: ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9d9d0287-cd16-412b-8b2e-c1fa50cbcb86 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,987 | supabase-export-v2 | 7aad7a698ba5f049 | For text mode, a :class:`GzipFile` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line ending(s).
.. versionchanged:: 3.3
Added support for *filename* being a file object, support for text mode,
and the *encoding*, *errors* and *newlin... | trusted_official_docs | CPython Docs | For text mode, a :class:`GzipFile` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line ending(s).
.. versionchanged:: 3.3
Added support for *filename* being a file object, support for text mode,
and the *encoding*, *errors* and *newlin... | For text mode, a :class:`GzipFile` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line ending(s).
.. versionchanged:: 3.3
Added support for *filename* being a file object, support for text mode,
and the *encoding*, *errors* and *newlin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e026552-35f6-4422-8f76-34c09d953b03 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,004 | supabase-export-v2 | df3fad20923a580b | also allows you to pass an :class:`io.BytesIO` object opened for writing as *fileobj*, and retrieve the resulting memory buffer using the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
:class:`GzipFile` supports the :class:`io.BufferedIOBase` interface,
including iteration and the :keyword:`with` st... | trusted_official_docs | CPython Docs | also allows you to pass an :class:`io.BytesIO` object opened for writing as *fileobj*, and retrieve the resulting memory buffer using the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
:class:`GzipFile` supports the :class:`io.BufferedIOBase` interface,
including iteration and the :keyword:`with` st... | also allows you to pass an :class:`io.BytesIO` object opened for writing as *fileobj*, and retrieve the resulting memory buffer using the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
:class:`GzipFile` supports the :class:`io.BufferedIOBase` interface,
including iteration and the :keyword:`with` st... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a13531ef-33d5-4e0e-a25e-73f6658354de | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,013 | supabase-export-v2 | cdd1b4964b307a68 | .. attribute:: mtime
When decompressing, this attribute is set to the last timestamp in the most
recently read header. It is an integer, holding the number of seconds
since the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before reading any headers is ``None``. | trusted_official_docs | CPython Docs | .. attribute:: mtime
When decompressing, this attribute is set to the last timestamp in the most
recently read header. It is an integer, holding the number of seconds
since the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before reading any headers is ``None``. | .. attribute:: mtime
When decompressing, this attribute is set to the last timestamp in the most
recently read header. It is an integer, holding the number of seconds
since the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before reading any headers is ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a91e04ff-f85a-4e84-a527-4bce0aadf748 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,997 | supabase-export-v2 | 9e4752b6fa8856ef | :class:`io.BytesIO` object, or any other object which simulates a file. It defaults to ``None``, in which case *filename* is opened to provide a file object.
When *fileobj* is not ``None``, the *filename* argument is only used to be
included in the :program:`gzip` file header, which may include the original
filename ... | trusted_official_docs | CPython Docs | :class:`io.BytesIO` object, or any other object which simulates a file. It defaults to ``None``, in which case *filename* is opened to provide a file object.
When *fileobj* is not ``None``, the *filename* argument is only used to be
included in the :program:`gzip` file header, which may include the original
filename ... | :class:`io.BytesIO` object, or any other object which simulates a file. It defaults to ``None``, in which case *filename* is opened to provide a file object.
When *fileobj* is not ``None``, the *filename* argument is only used to be
included in the :program:`gzip` file header, which may include the original
filename ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0f28eb0-1ae5-4a9b-97c7-38ace307fdaf | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,030 | supabase-export-v2 | a76e84abaa4a27a2 | .. function:: decompress(data)
Decompress the *data*, returning a :class:`bytes` object containing the
uncompressed data. This function is capable of decompressing multi-member
gzip data (multiple gzip blocks concatenated together). When the data is
certain to contain only one member the :func:`zlib.decompress` func... | trusted_official_docs | CPython Docs | .. function:: decompress(data)
Decompress the *data*, returning a :class:`bytes` object containing the
uncompressed data. This function is capable of decompressing multi-member
gzip data (multiple gzip blocks concatenated together). When the data is
certain to contain only one member the :func:`zlib.decompress` func... | .. function:: decompress(data)
Decompress the *data*, returning a :class:`bytes` object containing the
uncompressed data. This function is capable of decompressing multi-member
gzip data (multiple gzip blocks concatenated together). When the data is
certain to contain only one member the :func:`zlib.decompress` func... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b259b2c8-61cc-48a1-8029-6aa3505b6470 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,999 | supabase-export-v2 | ef1f142c3f106167 | the default is ``'rb'``. In future Python releases the mode of *fileobj* will not be used. It is better to always specify *mode* for writing.
Note that the file is always opened in binary mode. To open a compressed file
in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
:class:`io.TextIOWrapper`)... | trusted_official_docs | CPython Docs | the default is ``'rb'``. In future Python releases the mode of *fileobj* will not be used. It is better to always specify *mode* for writing.
Note that the file is always opened in binary mode. To open a compressed file
in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
:class:`io.TextIOWrapper`)... | the default is ``'rb'``. In future Python releases the mode of *fileobj* will not be used. It is better to always specify *mode* for writing.
Note that the file is always opened in binary mode. To open a compressed file
in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
:class:`io.TextIOWrapper`)... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b7c23a2f-ac82-4555-80a8-d33341ded14f | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,044 | supabase-export-v2 | 430112ea758dc85f | Module :mod:`zlib` The basic data compression module needed to support the :program:`gzip` file format.
In case gzip (de)compression is a bottleneck, the `python-isal`_
package speeds up (de)compression with a mostly compatible API. | trusted_official_docs | CPython Docs | Module :mod:`zlib` The basic data compression module needed to support the :program:`gzip` file format.
In case gzip (de)compression is a bottleneck, the `python-isal`_
package speeds up (de)compression with a mostly compatible API. | Module :mod:`zlib` The basic data compression module needed to support the :program:`gzip` file format.
In case gzip (de)compression is a bottleneck, the `python-isal`_
package speeds up (de)compression with a mostly compatible API. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cc7b47bb-e69e-4895-ab9d-1c54ccad4a5c | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,990 | supabase-export-v2 | eec838fd11bd70d4 | .. versionchanged:: 3.6 Accepts a :term:`path-like object`.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.6 Accepts a :term:`path-like object`.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | .. versionchanged:: 3.6 Accepts a :term:`path-like object`.
.. versionchanged:: 3.15
The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better
tradeoff between speed and performance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfa4eb96-6743-4da3-8062-07cfe086e67f | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,025 | supabase-export-v2 | e9795d704c2a61d9 | was reduced to 6 (down from 9). It is the default level used by most compression tools and a better tradeoff between speed and performance.
.. function:: compress(data, compresslevel=6, *, mtime=0) | trusted_official_docs | CPython Docs | was reduced to 6 (down from 9). It is the default level used by most compression tools and a better tradeoff between speed and performance.
.. function:: compress(data, compresslevel=6, *, mtime=0) | was reduced to 6 (down from 9). It is the default level used by most compression tools and a better tradeoff between speed and performance.
.. function:: compress(data, compresslevel=6, *, mtime=0) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6db27c4-7e69-4833-bde8-06a711836551 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 49,985 | supabase-export-v2 | ccaac547170832ef | The *compresslevel* argument is an integer from 0 to 9, as for the :class:`GzipFile` constructor.
For binary mode, this function is equivalent to the :class:`GzipFile`
constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the
*encoding*, *errors* and *newline* arguments must not be provided. | trusted_official_docs | CPython Docs | The *compresslevel* argument is an integer from 0 to 9, as for the :class:`GzipFile` constructor.
For binary mode, this function is equivalent to the :class:`GzipFile`
constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the
*encoding*, *errors* and *newline* arguments must not be provided. | The *compresslevel* argument is an integer from 0 to 9, as for the :class:`GzipFile` constructor.
For binary mode, this function is equivalent to the :class:`GzipFile`
constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the
*encoding*, *errors* and *newline* arguments must not be provided. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ff141d42-a8db-4372-bbd4-82659cbd4a34 | CPython Docs | file://datasets/cpython/Doc/library/gzip.rst | unknown | 43b57843-4dfa-44bf-8b8b-ce353cade6a6 | 50,031 | supabase-export-v2 | 514b0f57d84bff3c | (multiple gzip blocks concatenated together). When the data is certain to contain only one member the :func:`zlib.decompress` function with *wbits* set to 31 is faster.
.. versionadded:: 3.2
.. versionchanged:: 3.11
Speed is improved by decompressing members at once in memory instead of in
a streamed fashion. | trusted_official_docs | CPython Docs | (multiple gzip blocks concatenated together). When the data is certain to contain only one member the :func:`zlib.decompress` function with *wbits* set to 31 is faster.
.. versionadded:: 3.2
.. versionchanged:: 3.11
Speed is improved by decompressing members at once in memory instead of in
a streamed fashion. | (multiple gzip blocks concatenated together). When the data is certain to contain only one member the :func:`zlib.decompress` function with *wbits* set to 31 is faster.
.. versionadded:: 3.2
.. versionchanged:: 3.11
Speed is improved by decompressing members at once in memory instead of in
a streamed fashion. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
05e8ad53-8590-4152-a42f-bb6e922f42c1 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,073 | supabase-export-v2 | 2bfa1cf57d3d64ad | is ``None`` if the type can't be guessed (missing or unknown suffix) or a string of the form ``'type/subtype'``, usable for a MIME :mailheader:`content-type` header.
*encoding* is ``None`` for no encoding or the name of the program used to encode
(e.g. :program:`compress` or :program:`gzip`). The encoding is suitable ... | trusted_official_docs | CPython Docs | is ``None`` if the type can't be guessed (missing or unknown suffix) or a string of the form ``'type/subtype'``, usable for a MIME :mailheader:`content-type` header.
*encoding* is ``None`` for no encoding or the name of the program used to encode
(e.g. :program:`compress` or :program:`gzip`). The encoding is suitable ... | is ``None`` if the type can't be guessed (missing or unknown suffix) or a string of the form ``'type/subtype'``, usable for a MIME :mailheader:`content-type` header.
*encoding* is ``None`` for no encoding or the name of the program used to encode
(e.g. :program:`compress` or :program:`gzip`). The encoding is suitable ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
084a4e73-29d4-4e0a-aaa4-b740ca3c0594 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,176 | supabase-export-v2 | d97cfc631c4a005f | $ # get a file extension by a MIME type $ python -m mimetypes --extension text/javascript .js
$ # get a file extension by a rare MIME type
$ python -m mimetypes --extension text/xul
error: unknown type text/xul | trusted_official_docs | CPython Docs | $ # get a file extension by a MIME type $ python -m mimetypes --extension text/javascript .js
$ # get a file extension by a rare MIME type
$ python -m mimetypes --extension text/xul
error: unknown type text/xul | $ # get a file extension by a MIME type $ python -m mimetypes --extension text/javascript .js
$ # get a file extension by a rare MIME type
$ python -m mimetypes --extension text/xul
error: unknown type text/xul | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0aff07ca-7528-4c1e-a682-babd6a711327 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,179 | supabase-export-v2 | 6e9b5805308dd6b8 | an unknown file extension $ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt type: application/x-sh encoding: None type: application/x-netcdf encoding: None error: unknown extension of filename.xxx
$ # try to feed an unknown MIME type
$ python -m mimetypes --extension audio/aac audio/opus audio/fu... | trusted_official_docs | CPython Docs | an unknown file extension $ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt type: application/x-sh encoding: None type: application/x-netcdf encoding: None error: unknown extension of filename.xxx
$ # try to feed an unknown MIME type
$ python -m mimetypes --extension audio/aac audio/opus audio/fu... | an unknown file extension $ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt type: application/x-sh encoding: None type: application/x-netcdf encoding: None error: unknown extension of filename.xxx
$ # try to feed an unknown MIME type
$ python -m mimetypes --extension audio/aac audio/opus audio/fu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0cf78e96-7d9b-43e9-9cac-8f9349996590 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,124 | supabase-export-v2 | e0dd613596b069bd | .. attribute:: MimeTypes.types_map
Tuple containing two dictionaries, mapping filename extensions to MIME types:
the first dictionary is for the non-standards types and the second one is for
the standard types. They are initialized by :data:`common_types` and
:data:`types_map`. | trusted_official_docs | CPython Docs | .. attribute:: MimeTypes.types_map
Tuple containing two dictionaries, mapping filename extensions to MIME types:
the first dictionary is for the non-standards types and the second one is for
the standard types. They are initialized by :data:`common_types` and
:data:`types_map`. | .. attribute:: MimeTypes.types_map
Tuple containing two dictionaries, mapping filename extensions to MIME types:
the first dictionary is for the non-standards types and the second one is for
the standard types. They are initialized by :data:`common_types` and
:data:`types_map`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a9edf44-acb4-4ee9-a298-11ba73555d33 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,164 | supabase-export-v2 | 6c8e9f7e6611d294 | Additionally search for some common, but non-standard types.
By default the script converts MIME types to file extensions. However, if ``--extension`` is specified,
it converts file extensions to MIME types. | trusted_official_docs | CPython Docs | Additionally search for some common, but non-standard types.
By default the script converts MIME types to file extensions. However, if ``--extension`` is specified,
it converts file extensions to MIME types. | Additionally search for some common, but non-standard types.
By default the script converts MIME types to file extensions. However, if ``--extension`` is specified,
it converts file extensions to MIME types. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27d90b59-e0af-4af8-8f12-a27b13de4339 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,178 | supabase-export-v2 | da1078b15b9a73f2 | $ # now look in the extended database again $ python -m mimetypes --extension --lenient text/xul .xul
$ # try to feed an unknown file extension
$ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt
type: application/x-sh encoding: None
type: application/x-netcdf encoding: None
error: unknown exten... | trusted_official_docs | CPython Docs | $ # now look in the extended database again $ python -m mimetypes --extension --lenient text/xul .xul
$ # try to feed an unknown file extension
$ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt
type: application/x-sh encoding: None
type: application/x-netcdf encoding: None
error: unknown exten... | $ # now look in the extended database again $ python -m mimetypes --extension --lenient text/xul .xul
$ # try to feed an unknown file extension
$ python -m mimetypes filename.sh filename.nc filename.xxx filename.txt
type: application/x-sh encoding: None
type: application/x-netcdf encoding: None
error: unknown exten... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b2cfa5a-1ba9-4ed4-978a-fd70b163447c | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,115 | supabase-export-v2 | 40e06737c71476fd | MimeTypes objects -----------------
The :class:`MimeTypes` class may be useful for applications which may want more
than one MIME-type database; it provides an interface similar to the one of the
:mod:`!mimetypes` module. | trusted_official_docs | CPython Docs | MimeTypes objects -----------------
The :class:`MimeTypes` class may be useful for applications which may want more
than one MIME-type database; it provides an interface similar to the one of the
:mod:`!mimetypes` module. | MimeTypes objects -----------------
The :class:`MimeTypes` class may be useful for applications which may want more
than one MIME-type database; it provides an interface similar to the one of the
:mod:`!mimetypes` module. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fc8bee9-8de8-4514-94f4-fc922ef1f80d | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,175 | supabase-export-v2 | 94492cd3d9b69593 | $ # now look in the extended database built into Python $ python -m mimetypes --lenient filename.pict type: image/pict encoding: None
$ # get a file extension by a MIME type
$ python -m mimetypes --extension text/javascript
.js | trusted_official_docs | CPython Docs | $ # now look in the extended database built into Python $ python -m mimetypes --lenient filename.pict type: image/pict encoding: None
$ # get a file extension by a MIME type
$ python -m mimetypes --extension text/javascript
.js | $ # now look in the extended database built into Python $ python -m mimetypes --lenient filename.pict type: image/pict encoding: None
$ # get a file extension by a MIME type
$ python -m mimetypes --extension text/javascript
.js | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39266c65-57f2-412b-bcac-e4f946d60dda | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,165 | supabase-export-v2 | aa98af0f120818c2 | By default the script converts MIME types to file extensions. However, if ``--extension`` is specified, it converts file extensions to MIME types.
For each ``type`` entry, the script writes a line into the standard output
stream. If an unknown type occurs, it writes an error message into the
standard error stream and e... | trusted_official_docs | CPython Docs | By default the script converts MIME types to file extensions. However, if ``--extension`` is specified, it converts file extensions to MIME types.
For each ``type`` entry, the script writes a line into the standard output
stream. If an unknown type occurs, it writes an error message into the
standard error stream and e... | By default the script converts MIME types to file extensions. However, if ``--extension`` is specified, it converts file extensions to MIME types.
For each ``type`` entry, the script writes a line into the standard output
stream. If an unknown type occurs, it writes an error message into the
standard error stream and e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d9e220e-e3fb-430c-850b-203901c01148 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,092 | supabase-export-v2 | 4ec1f023a71e617a | data structure is completely rebuilt to its initial default value. This is a stable operation and will produce the same results when called multiple times.
.. versionchanged:: 3.2
Previously, Windows registry settings were ignored. | trusted_official_docs | CPython Docs | data structure is completely rebuilt to its initial default value. This is a stable operation and will produce the same results when called multiple times.
.. versionchanged:: 3.2
Previously, Windows registry settings were ignored. | data structure is completely rebuilt to its initial default value. This is a stable operation and will produce the same results when called multiple times.
.. versionchanged:: 3.2
Previously, Windows registry settings were ignored. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f3a3352-d83b-48d5-a275-96ca46653d85 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,094 | supabase-export-v2 | 1406518d0e73dc9c | .. function:: read_mime_types(filename)
Load the type map given in the file *filename*, if it exists. The type map is
returned as a dictionary mapping filename extensions, including the leading dot
(``'.'``), to strings of the form ``'type/subtype'``. If the file *filename*
does not exist or cannot be read, ``None``... | trusted_official_docs | CPython Docs | .. function:: read_mime_types(filename)
Load the type map given in the file *filename*, if it exists. The type map is
returned as a dictionary mapping filename extensions, including the leading dot
(``'.'``), to strings of the form ``'type/subtype'``. If the file *filename*
does not exist or cannot be read, ``None``... | .. function:: read_mime_types(filename)
Load the type map given in the file *filename*, if it exists. The type map is
returned as a dictionary mapping filename extensions, including the leading dot
(``'.'``), to strings of the form ``'type/subtype'``. If the file *filename*
does not exist or cannot be read, ``None``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
40ff0830-7bd6-4ffa-9f63-360a3274cdf9 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,067 | supabase-export-v2 | f50f6d89e9374922 | filename extension. Conversions are provided from filename to MIME type and from MIME type to filename extension; encodings are not supported for the latter conversion.
The module provides one class and a number of convenience functions. The
functions are the normal interface to this module, but some applications may b... | trusted_official_docs | CPython Docs | filename extension. Conversions are provided from filename to MIME type and from MIME type to filename extension; encodings are not supported for the latter conversion.
The module provides one class and a number of convenience functions. The
functions are the normal interface to this module, but some applications may b... | filename extension. Conversions are provided from filename to MIME type and from MIME type to filename extension; encodings are not supported for the latter conversion.
The module provides one class and a number of convenience functions. The
functions are the normal interface to this module, but some applications may b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ad5e47c-10b8-4801-adfb-3818fe347553 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,177 | supabase-export-v2 | 660ceef8f72696c1 | $ # get a file extension by a rare MIME type $ python -m mimetypes --extension text/xul error: unknown type text/xul
$ # now look in the extended database again
$ python -m mimetypes --extension --lenient text/xul
.xul | trusted_official_docs | CPython Docs | $ # get a file extension by a rare MIME type $ python -m mimetypes --extension text/xul error: unknown type text/xul
$ # now look in the extended database again
$ python -m mimetypes --extension --lenient text/xul
.xul | $ # get a file extension by a rare MIME type $ python -m mimetypes --extension text/xul error: unknown type text/xul
$ # now look in the extended database again
$ python -m mimetypes --extension --lenient text/xul
.xul | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4e504694-70ec-43e1-8c37-1165d091b4e8 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,071 | supabase-export-v2 | df87ce91ad7a4bc5 | .. index:: pair: MIME; headers
Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`. | trusted_official_docs | CPython Docs | .. index:: pair: MIME; headers
Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`. | .. index:: pair: MIME; headers
Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
535c5245-e9d3-40a7-becb-44dd0e0fcc33 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,150 | supabase-export-v2 | 55e24663ad3b1aac | When *strict* is ``True`` (the default), the mapping will be added to the official MIME types, otherwise to the non-standard ones.
.. deprecated-removed:: 3.14 3.16
Invalid, undotted extensions will raise a
:exc:`ValueError` in Python 3.16. | trusted_official_docs | CPython Docs | When *strict* is ``True`` (the default), the mapping will be added to the official MIME types, otherwise to the non-standard ones.
.. deprecated-removed:: 3.14 3.16
Invalid, undotted extensions will raise a
:exc:`ValueError` in Python 3.16. | When *strict* is ``True`` (the default), the mapping will be added to the official MIME types, otherwise to the non-standard ones.
.. deprecated-removed:: 3.14 3.16
Invalid, undotted extensions will raise a
:exc:`ValueError` in Python 3.16. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53b0acde-cc35-4ec0-a6e9-79377e8411cb | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,068 | supabase-export-v2 | 4cfffe84b8c55601 | a number of convenience functions. The functions are the normal interface to this module, but some applications may be interested in the class as well.
The functions described below provide the primary interface for this module. If
the module has not been initialized, they will call :func:`init` if they rely on
the inf... | trusted_official_docs | CPython Docs | a number of convenience functions. The functions are the normal interface to this module, but some applications may be interested in the class as well.
The functions described below provide the primary interface for this module. If
the module has not been initialized, they will call :func:`init` if they rely on
the inf... | a number of convenience functions. The functions are the normal interface to this module, but some applications may be interested in the class as well.
The functions described below provide the primary interface for this module. If
the module has not been initialized, they will call :func:`init` if they rely on
the inf... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54076e82-9458-45c5-a78a-95b839539fb1 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,141 | supabase-export-v2 | e33b7a5e00955aeb | Load MIME type information from an open file *fp*. The file must have the format of the standard :file:`mime.types` files.
If *strict* is ``True``, information will be added to the list of standard
types, else to the list of non-standard types. | trusted_official_docs | CPython Docs | Load MIME type information from an open file *fp*. The file must have the format of the standard :file:`mime.types` files.
If *strict* is ``True``, information will be added to the list of standard
types, else to the list of non-standard types. | Load MIME type information from an open file *fp*. The file must have the format of the standard :file:`mime.types` files.
If *strict* is ``True``, information will be added to the list of standard
types, else to the list of non-standard types. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5481f7f2-7349-4fcb-a893-1f27b02d316e | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,104 | supabase-export-v2 | 682e2e75b51a6117 | .. data:: suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized separately. | trusted_official_docs | CPython Docs | .. data:: suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized separately. | .. data:: suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized separately. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
549873e3-fdd3-449f-afd0-1c8ed2af948f | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,079 | supabase-export-v2 | bf8ddad96de7c6c4 | .. index:: pair: MIME; headers
Guess the type of a file based on its path, given by *path*. Similar to the :func:`guess_type` function, but accepts a path instead of URL. Path can be a string, a bytes object or a :term:`path-like object`. | trusted_official_docs | CPython Docs | .. index:: pair: MIME; headers
Guess the type of a file based on its path, given by *path*. Similar to the :func:`guess_type` function, but accepts a path instead of URL. Path can be a string, a bytes object or a :term:`path-like object`. | .. index:: pair: MIME; headers
Guess the type of a file based on its path, given by *path*. Similar to the :func:`guess_type` function, but accepts a path instead of URL. Path can be a string, a bytes object or a :term:`path-like object`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6a447594-6c54-4ae0-9a29-67c8087b80e4 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,089 | supabase-export-v2 | 1bf3746791bd166c | .. function:: init(files=None)
Initialize the internal data structures. If given, *files* must be a sequence
of file names which should be used to augment the default type map. If omitted,
the file names to use are taken from :const:`knownfiles`; on Windows, the
current registry settings are loaded. Each file named ... | trusted_official_docs | CPython Docs | .. function:: init(files=None)
Initialize the internal data structures. If given, *files* must be a sequence
of file names which should be used to augment the default type map. If omitted,
the file names to use are taken from :const:`knownfiles`; on Windows, the
current registry settings are loaded. Each file named ... | .. function:: init(files=None)
Initialize the internal data structures. If given, *files* must be a sequence
of file names which should be used to augment the default type map. If omitted,
the file names to use are taken from :const:`knownfiles`; on Windows, the
current registry settings are loaded. Each file named ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
74c7b12b-86df-486e-a58d-60a140a7ca4d | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,074 | supabase-export-v2 | 7391e4c52b72544b | **not** as a :mailheader:`Content-Transfer-Encoding` header. The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitively, then case insensitively.
The optional *strict* argument is a flag specifying whether the list of known MIME types
is limited to only the offi... | trusted_official_docs | CPython Docs | **not** as a :mailheader:`Content-Transfer-Encoding` header. The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitively, then case insensitively.
The optional *strict* argument is a flag specifying whether the list of known MIME types
is limited to only the offi... | **not** as a :mailheader:`Content-Transfer-Encoding` header. The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitively, then case insensitively.
The optional *strict* argument is a flag specifying whether the list of known MIME types
is limited to only the offi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7a9dd002-3bf6-4a1c-aff8-20948b61d2a1 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,075 | supabase-export-v2 | 07857141a9888028 | is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized.
.. versionchanged:: 3.8
Added support for *url* being a :term:`path-like object`. | trusted_official_docs | CPython Docs | is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized.
.. versionchanged:: 3.8
Added support for *url* being a :term:`path-like object`. | is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized.
.. versionchanged:: 3.8
Added support for *url* being a :term:`path-like object`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
831b5d70-0b38-497b-be0e-9cac1f949852 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,090 | supabase-export-v2 | 8cdebeef3dc03220 | the current registry settings are loaded. Each file named in *files* or :const:`knownfiles` takes precedence over those named before it. Calling :func:`init` repeatedly is allowed.
Specifying an empty list for *files* will prevent the system defaults from
being applied: only the well-known values will be present from ... | trusted_official_docs | CPython Docs | the current registry settings are loaded. Each file named in *files* or :const:`knownfiles` takes precedence over those named before it. Calling :func:`init` repeatedly is allowed.
Specifying an empty list for *files* will prevent the system defaults from
being applied: only the well-known values will be present from ... | the current registry settings are loaded. Each file named in *files* or :const:`knownfiles` takes precedence over those named before it. Calling :func:`init` repeatedly is allowed.
Specifying an empty list for *files* will prevent the system defaults from
being applied: only the well-known values will be present from ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8bcb38c6-1a7a-40fb-a46b-2bbe8333ccc8 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,085 | supabase-export-v2 | e9a64d4dc5ec2cf6 | .. function:: guess_extension(type, strict=True)
Guess the extension for a file based on its MIME type, given by *type*. The
return value is a string giving a filename extension, including the leading dot
(``'.'``). The extension is not guaranteed to have been associated with any
particular data stream, but would be... | trusted_official_docs | CPython Docs | .. function:: guess_extension(type, strict=True)
Guess the extension for a file based on its MIME type, given by *type*. The
return value is a string giving a filename extension, including the leading dot
(``'.'``). The extension is not guaranteed to have been associated with any
particular data stream, but would be... | .. function:: guess_extension(type, strict=True)
Guess the extension for a file based on its MIME type, given by *type*. The
return value is a string giving a filename extension, including the leading dot
(``'.'``). The extension is not guaranteed to have been associated with any
particular data stream, but would be... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a0ca6049-39d9-4adc-a127-5e5f3923603a | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,082 | supabase-export-v2 | 1f6d5da270ec62d2 | .. function:: guess_all_extensions(type, strict=True)
Guess the extensions for a file based on its MIME type, given by *type*. The
return value is a list of strings giving all possible filename extensions,
including the leading dot (``'.'``). The extensions are not guaranteed to have
been associated with any particu... | trusted_official_docs | CPython Docs | .. function:: guess_all_extensions(type, strict=True)
Guess the extensions for a file based on its MIME type, given by *type*. The
return value is a list of strings giving all possible filename extensions,
including the leading dot (``'.'``). The extensions are not guaranteed to have
been associated with any particu... | .. function:: guess_all_extensions(type, strict=True)
Guess the extensions for a file based on its MIME type, given by *type*. The
return value is a list of strings giving all possible filename extensions,
including the leading dot (``'.'``). The extensions are not guaranteed to have
been associated with any particu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a4ea2233-be67-4fb9-855a-3e737a53bfc6 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,086 | supabase-export-v2 | a51a55b40ae447db | stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`. If no extension can be guessed for *type*, ``None`` is returned.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | trusted_official_docs | CPython Docs | stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`. If no extension can be guessed for *type*, ``None`` is returned.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`. If no extension can be guessed for *type*, ``None`` is returned.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a51bdc52-5946-4e8f-8029-a7c53547ee8e | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,120 | supabase-export-v2 | 49f1cd45715df2b1 | .. attribute:: MimeTypes.suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized... | trusted_official_docs | CPython Docs | .. attribute:: MimeTypes.suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized... | .. attribute:: MimeTypes.suffix_map
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6e81f91-cd44-49ab-9fc6-de6d998f7909 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,096 | supabase-export-v2 | 9b640bce91854f97 | .. function:: add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of known extensions. | trusted_official_docs | CPython Docs | .. function:: add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of known extensions. | .. function:: add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of known extensions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ae23f5a7-0217-4e64-8962-1ceee55240a6 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,148 | supabase-export-v2 | fa9df25006fae777 | .. method:: MimeTypes.add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. Valid extensions start with a '.' or are empty. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of k... | trusted_official_docs | CPython Docs | .. method:: MimeTypes.add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. Valid extensions start with a '.' or are empty. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of k... | .. method:: MimeTypes.add_type(type, ext, strict=True)
Add a mapping from the MIME type *type* to the extension *ext*. Valid extensions start with a '.' or are empty. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of k... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b866a38a-8262-4aeb-897b-0ac542196681 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,174 | supabase-export-v2 | 91d1409218b0e1de | $ # get a MIME type for a rare file extension $ python -m mimetypes filename.pict error: unknown extension of filename.pict
$ # now look in the extended database built into Python
$ python -m mimetypes --lenient filename.pict
type: image/pict encoding: None | trusted_official_docs | CPython Docs | $ # get a MIME type for a rare file extension $ python -m mimetypes filename.pict error: unknown extension of filename.pict
$ # now look in the extended database built into Python
$ python -m mimetypes --lenient filename.pict
type: image/pict encoding: None | $ # get a MIME type for a rare file extension $ python -m mimetypes filename.pict error: unknown extension of filename.pict
$ # now look in the extended database built into Python
$ python -m mimetypes --lenient filename.pict
type: image/pict encoding: None | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bd32145e-0256-4a60-80b9-629072c131e0 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,126 | supabase-export-v2 | 926607e88c164bda | .. attribute:: MimeTypes.types_map_inv
Tuple containing two dictionaries, mapping MIME types to a list of filename
extensions: the first dictionary is for the non-standards types and the
second one is for the standard types. They are initialized by
:data:`common_types` and :data:`types_map`. | trusted_official_docs | CPython Docs | .. attribute:: MimeTypes.types_map_inv
Tuple containing two dictionaries, mapping MIME types to a list of filename
extensions: the first dictionary is for the non-standards types and the
second one is for the standard types. They are initialized by
:data:`common_types` and :data:`types_map`. | .. attribute:: MimeTypes.types_map_inv
Tuple containing two dictionaries, mapping MIME types to a list of filename
extensions: the first dictionary is for the non-standards types and the
second one is for the standard types. They are initialized by
:data:`common_types` and :data:`types_map`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c4c34d28-61c4-420f-beab-84e6cfb7fb7b | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,117 | supabase-export-v2 | d59dc900be2f740e | .. class:: MimeTypes(filenames=(), strict=True)
This class represents a MIME-types database. By default, it provides access to
the same database as the rest of this module. The initial database is a copy of
that provided by the module, and may be extended by loading additional
:file:`mime.types`\ -style files into t... | trusted_official_docs | CPython Docs | .. class:: MimeTypes(filenames=(), strict=True)
This class represents a MIME-types database. By default, it provides access to
the same database as the rest of this module. The initial database is a copy of
that provided by the module, and may be extended by loading additional
:file:`mime.types`\ -style files into t... | .. class:: MimeTypes(filenames=(), strict=True)
This class represents a MIME-types database. By default, it provides access to
the same database as the rest of this module. The initial database is a copy of
that provided by the module, and may be extended by loading additional
:file:`mime.types`\ -style files into t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d2d0cd39-35b3-41ee-9657-e44513e9c51f | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,171 | supabase-export-v2 | d6886ec0046ec465 | $ # get a MIME type by a file name $ python -m mimetypes filename.png type: image/png encoding: None
$ # get a MIME type by a URL
$ python -m mimetypes https://example.com/filename.txt
type: text/plain encoding: None | trusted_official_docs | CPython Docs | $ # get a MIME type by a file name $ python -m mimetypes filename.png type: image/png encoding: None
$ # get a MIME type by a URL
$ python -m mimetypes https://example.com/filename.txt
type: text/plain encoding: None | $ # get a MIME type by a file name $ python -m mimetypes filename.png type: image/png encoding: None
$ # get a MIME type by a URL
$ python -m mimetypes https://example.com/filename.txt
type: text/plain encoding: None | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d6288ee7-bd8c-4281-a95a-b8ceaf6cc732 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,091 | supabase-export-v2 | 15adff58332d8b78 | Specifying an empty list for *files* will prevent the system defaults from being applied: only the well-known values will be present from a built-in list.
If *files* is ``None`` the internal data structure is completely rebuilt to its
initial default value. This is a stable operation and will produce the same results
... | trusted_official_docs | CPython Docs | Specifying an empty list for *files* will prevent the system defaults from being applied: only the well-known values will be present from a built-in list.
If *files* is ``None`` the internal data structure is completely rebuilt to its
initial default value. This is a stable operation and will produce the same results
... | Specifying an empty list for *files* will prevent the system defaults from being applied: only the well-known values will be present from a built-in list.
If *files* is ``None`` the internal data structure is completely rebuilt to its
initial default value. This is a stable operation and will produce the same results
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0e7ceb5-ce66-4e61-b501-3a2a9873ada9 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,095 | supabase-export-v2 | c799427c2328b65e | including the leading dot (``'.'``), to strings of the form ``'type/subtype'``. If the file *filename* does not exist or cannot be read, ``None`` is returned.
.. function:: add_type(type, ext, strict=True) | trusted_official_docs | CPython Docs | including the leading dot (``'.'``), to strings of the form ``'type/subtype'``. If the file *filename* does not exist or cannot be read, ``None`` is returned.
.. function:: add_type(type, ext, strict=True) | including the leading dot (``'.'``), to strings of the form ``'type/subtype'``. If the file *filename* does not exist or cannot be read, ``None`` is returned.
.. function:: add_type(type, ext, strict=True) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e29f310a-277e-4f13-b502-016a077e5d26 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,083 | supabase-export-v2 | 992c4b631a66e248 | are not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | trusted_official_docs | CPython Docs | are not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | are not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`.
The optional *strict* argument has the same meaning as with the :func:`guess_type` function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4cc1aa8-cce9-44ca-b6a1-9c45fdd5178e | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,066 | supabase-export-v2 | 5f068995b49b8f51 | --------------
The :mod:`!mimetypes` module converts between a filename or URL and the MIME type
associated with the filename extension. Conversions are provided from filename
to MIME type and from MIME type to filename extension; encodings are not
supported for the latter conversion. | trusted_official_docs | CPython Docs | --------------
The :mod:`!mimetypes` module converts between a filename or URL and the MIME type
associated with the filename extension. Conversions are provided from filename
to MIME type and from MIME type to filename extension; encodings are not
supported for the latter conversion. | --------------
The :mod:`!mimetypes` module converts between a filename or URL and the MIME type
associated with the filename extension. Conversions are provided from filename
to MIME type and from MIME type to filename extension; encodings are not
supported for the latter conversion. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4ef6526-9189-4c87-b351-76f55e79ebd0 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,072 | supabase-export-v2 | 6fc2e5784f2d1123 | Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`.
The return value is a tuple ``(type, encoding)`` where *type* is ``None`` if the
type can't be guessed (missing or unknown suffix) or a string of the form
``'type/subtype'``, usable for a MI... | trusted_official_docs | CPython Docs | Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`.
The return value is a tuple ``(type, encoding)`` where *type* is ``None`` if the
type can't be guessed (missing or unknown suffix) or a string of the form
``'type/subtype'``, usable for a MI... | Guess the type of a file based on its filename, path or URL, given by *url*. URL can be a string or a :term:`path-like object`.
The return value is a tuple ``(type, encoding)`` where *type* is ``None`` if the
type can't be guessed (missing or unknown suffix) or a string of the form
``'type/subtype'``, usable for a MI... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ebc0a3f8-dcab-43a9-a287-b6def449cd02 | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,097 | supabase-export-v2 | 575464d18c4ab70f | the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions.
When *strict* is ``True`` (the default), the mapping will be added to the
official MIME types, otherwise to the non-standard ones. | trusted_official_docs | CPython Docs | the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions.
When *strict* is ``True`` (the default), the mapping will be added to the
official MIME types, otherwise to the non-standard ones. | the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions.
When *strict* is ``True`` (the default), the mapping will be added to the
official MIME types, otherwise to the non-standard ones. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ef1ed248-804f-47ed-a6b3-82da22cbc8be | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,173 | supabase-export-v2 | 0a1d6ed6ed47aff1 | $ # get a complex MIME type $ python -m mimetypes filename.tar.gz type: application/x-tar encoding: gzip
$ # get a MIME type for a rare file extension
$ python -m mimetypes filename.pict
error: unknown extension of filename.pict | trusted_official_docs | CPython Docs | $ # get a complex MIME type $ python -m mimetypes filename.tar.gz type: application/x-tar encoding: gzip
$ # get a MIME type for a rare file extension
$ python -m mimetypes filename.pict
error: unknown extension of filename.pict | $ # get a complex MIME type $ python -m mimetypes filename.tar.gz type: application/x-tar encoding: gzip
$ # get a MIME type for a rare file extension
$ python -m mimetypes filename.pict
error: unknown extension of filename.pict | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f48bd9ce-8020-4394-9107-70316069ac3c | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,118 | supabase-export-v2 | ae392ff4bab9c4ff | database using the :meth:`read` or :meth:`readfp` methods. The mapping dictionaries may also be cleared before loading additional data if the default data is not desired.
The optional *filenames* parameter can be used to cause additional files to be
loaded "on top" of the default database. | trusted_official_docs | CPython Docs | database using the :meth:`read` or :meth:`readfp` methods. The mapping dictionaries may also be cleared before loading additional data if the default data is not desired.
The optional *filenames* parameter can be used to cause additional files to be
loaded "on top" of the default database. | database using the :meth:`read` or :meth:`readfp` methods. The mapping dictionaries may also be cleared before loading additional data if the default data is not desired.
The optional *filenames* parameter can be used to cause additional files to be
loaded "on top" of the default database. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa2c81bb-4ecc-4ac1-b0e3-227da264947e | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,172 | supabase-export-v2 | 4ee8c62aff1db0ae | $ # get a MIME type by a URL $ python -m mimetypes https://example.com/filename.txt type: text/plain encoding: None
$ # get a complex MIME type
$ python -m mimetypes filename.tar.gz
type: application/x-tar encoding: gzip | trusted_official_docs | CPython Docs | $ # get a MIME type by a URL $ python -m mimetypes https://example.com/filename.txt type: text/plain encoding: None
$ # get a complex MIME type
$ python -m mimetypes filename.tar.gz
type: application/x-tar encoding: gzip | $ # get a MIME type by a URL $ python -m mimetypes https://example.com/filename.txt type: text/plain encoding: None
$ # get a complex MIME type
$ python -m mimetypes filename.tar.gz
type: application/x-tar encoding: gzip | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb94b012-ff3d-4205-be6a-725c0a0894df | CPython Docs | file://datasets/cpython/Doc/library/mimetypes.rst | unknown | f97bc259-a136-4ca9-966f-cd860f7b81e5 | 50,138 | supabase-export-v2 | 1f14d34689edf8b8 | Load MIME information from a file named *filename*. This uses :meth:`readfp` to parse the file.
If *strict* is ``True``, information will be added to list of standard types,
else to the list of non-standard types. | trusted_official_docs | CPython Docs | Load MIME information from a file named *filename*. This uses :meth:`readfp` to parse the file.
If *strict* is ``True``, information will be added to list of standard types,
else to the list of non-standard types. | Load MIME information from a file named *filename*. This uses :meth:`readfp` to parse the file.
If *strict* is ``True``, information will be added to list of standard types,
else to the list of non-standard types. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
021db3e5-9b56-4fc3-bace-00a368d03091 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,483 | supabase-export-v2 | bc65670941c8e925 | - ``__str__`` uses the value and not the name of the enum member
- ``__format__``, because it uses ``__str__``, will also use the value of
the enum member instead of its name | trusted_official_docs | CPython Docs | - ``__str__`` uses the value and not the name of the enum member
- ``__format__``, because it uses ``__str__``, will also use the value of
the enum member instead of its name | - ``__str__`` uses the value and not the name of the enum member
- ``__format__``, because it uses ``__str__``, will also use the value of
the enum member instead of its name | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
034d3842-3485-4b79-98a2-3467be8df9d8 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,405 | supabase-export-v2 | a5e37e9f8ea49f5f | * :meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag` * :meth:`!str.__str__` for :class:`StrEnum`
Inherit from :class:`!ReprEnum` to keep the :class:`str() <str>` / :func:`format`
of the mixed-in data type instead of using the
:class:`Enum`-default :meth:`str() <Enum.__str__>`. | trusted_official_docs | CPython Docs | * :meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag` * :meth:`!str.__str__` for :class:`StrEnum`
Inherit from :class:`!ReprEnum` to keep the :class:`str() <str>` / :func:`format`
of the mixed-in data type instead of using the
:class:`Enum`-default :meth:`str() <Enum.__str__>`. | * :meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag` * :meth:`!str.__str__` for :class:`StrEnum`
Inherit from :class:`!ReprEnum` to keep the :class:`str() <str>` / :func:`format`
of the mixed-in data type instead of using the
:class:`Enum`-default :meth:`str() <Enum.__str__>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0749dea8-6d48-433c-96a4-f392ea9cc13f | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,453 | supabase-export-v2 | 6c61a45958daa4d1 | *auto* instances are only resolved when at the top level of an assignment, either by itself or as part of a tuple:
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
used to create the ``SECOND`` enum member;
* ``THIRD = [... | trusted_official_docs | CPython Docs | *auto* instances are only resolved when at the top level of an assignment, either by itself or as part of a tuple:
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
used to create the ``SECOND`` enum member;
* ``THIRD = [... | *auto* instances are only resolved when at the top level of an assignment, either by itself or as part of a tuple:
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
used to create the ``SECOND`` enum member;
* ``THIRD = [... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08120f59-68d0-465d-938b-80b03f55ffbd | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,342 | supabase-export-v2 | 0a521c4f228ec7fb | .. class:: IntEnum
*IntEnum* is the same as :class:`Enum`, but its members are also integers and can be
used anywhere that an integer can be used. If any integer operation is performed
with an *IntEnum* member, the resulting value loses its enumeration status. | trusted_official_docs | CPython Docs | .. class:: IntEnum
*IntEnum* is the same as :class:`Enum`, but its members are also integers and can be
used anywhere that an integer can be used. If any integer operation is performed
with an *IntEnum* member, the resulting value loses its enumeration status. | .. class:: IntEnum
*IntEnum* is the same as :class:`Enum`, but its members are also integers and can be
used anywhere that an integer can be used. If any integer operation is performed
with an *IntEnum* member, the resulting value loses its enumeration status. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08ec7196-7fa8-430a-8377-ce9bf3ad5d2c | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,471 | supabase-export-v2 | 72f07ad1fdb4c7dc | .. decorator:: global_enum
A decorator to change the :class:`str() <str>` and :func:`repr` of an enum
to show its members as belonging to the module instead of its class. Should only be used when the enum members are exported
to the module global namespace (see :class:`re.RegexFlag` for an example). | trusted_official_docs | CPython Docs | .. decorator:: global_enum
A decorator to change the :class:`str() <str>` and :func:`repr` of an enum
to show its members as belonging to the module instead of its class. Should only be used when the enum members are exported
to the module global namespace (see :class:`re.RegexFlag` for an example). | .. decorator:: global_enum
A decorator to change the :class:`str() <str>` and :func:`repr` of an enum
to show its members as belonging to the module instead of its class. Should only be used when the enum members are exported
to the module global namespace (see :class:`re.RegexFlag` for an example). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ae0d045-88c0-4e49-ae49-7aab9e84e99f | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,237 | supabase-export-v2 | bc019950ca69f3c9 | *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>` for details.
``EnumType`` is responsible for setting the correct :meth:`!__repr__`,
:meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the
fi... | trusted_official_docs | CPython Docs | *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>` for details.
``EnumType`` is responsible for setting the correct :meth:`!__repr__`,
:meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the
fi... | *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>` for details.
``EnumType`` is responsible for setting the correct :meth:`!__repr__`,
:meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the
fi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c0f4456-0e3b-4786-9afe-bb0d88d18e65 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,284 | supabase-export-v2 | 5c5563c3e1ec6e7e | No longer used, kept for backward compatibility. (class attribute, removed during class creation).
The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / Python 3 code in sync. It will be checked against the actual order of the enumeration and raise an error if the two do not match:: | trusted_official_docs | CPython Docs | No longer used, kept for backward compatibility. (class attribute, removed during class creation).
The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / Python 3 code in sync. It will be checked against the actual order of the enumeration and raise an error if the two do not match:: | No longer used, kept for backward compatibility. (class attribute, removed during class creation).
The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / Python 3 code in sync. It will be checked against the actual order of the enumeration and raise an error if the two do not match:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11c18dd4-4b17-40e2-bdca-be81430bf14d | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,295 | supabase-export-v2 | 2ea7d4d4298f4b48 | Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any public methods defined on *self.__class__*::
>>> from enum import Enum
>>> import datetime as dt
>>> class Weekday(Enum):
... MONDAY = 1
... TUESDAY = 2
... WEDNESDAY = 3
... THURSDAY = 4
... FRIDAY = 5
... SATURDAY = 6
... SUNDAY = 7
... | trusted_official_docs | CPython Docs | Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any public methods defined on *self.__class__*::
>>> from enum import Enum
>>> import datetime as dt
>>> class Weekday(Enum):
... MONDAY = 1
... TUESDAY = 2
... WEDNESDAY = 3
... THURSDAY = 4
... FRIDAY = 5
... SATURDAY = 6
... SUNDAY = 7
... | Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any public methods defined on *self.__class__*::
>>> from enum import Enum
>>> import datetime as dt
>>> class Weekday(Enum):
... MONDAY = 1
... TUESDAY = 2
... WEDNESDAY = 3
... THURSDAY = 4
... FRIDAY = 5
... SATURDAY = 6
... SUNDAY = 7
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a57e25f-7c0a-4f81-a47e-7e41fa85d18e | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,460 | supabase-export-v2 | 7695238ba1322907 | A decorator similar to the built-in *property*, but specifically for enumerations. It allows member attributes to have the same names as members themselves.
.. note:: The *property* and the member must be defined in separate classes;
for example, the *value* and *name* attributes are defined in the
*Enum* class, and ... | trusted_official_docs | CPython Docs | A decorator similar to the built-in *property*, but specifically for enumerations. It allows member attributes to have the same names as members themselves.
.. note:: The *property* and the member must be defined in separate classes;
for example, the *value* and *name* attributes are defined in the
*Enum* class, and ... | A decorator similar to the built-in *property*, but specifically for enumerations. It allows member attributes to have the same names as members themselves.
.. note:: The *property* and the member must be defined in separate classes;
for example, the *value* and *name* attributes are defined in the
*Enum* class, and ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d9f67e3-90a2-4414-ae00-ac6d2d677cbc | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,444 | supabase-export-v2 | 29e14fd2ae47dea2 | - :meth:`~Enum._generate_next_value_` -- used to get an appropriate value for an enum member; may be overridden
- :meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing
member. - :meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an
existing member. | trusted_official_docs | CPython Docs | - :meth:`~Enum._generate_next_value_` -- used to get an appropriate value for an enum member; may be overridden
- :meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing
member. - :meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an
existing member. | - :meth:`~Enum._generate_next_value_` -- used to get an appropriate value for an enum member; may be overridden
- :meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing
member. - :meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an
existing member. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23214b0a-14ef-484e-82e2-b20d84ccdab0 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,423 | supabase-export-v2 | fd28698f6305fac3 | Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`::
>>> from enum import Flag, STRICT, auto
>>> class StrictFlag(Flag, boundary=STRICT):
... RED = auto()
... GREEN = auto()
... BLUE = auto()
... >>> StrictFlag(2**2 + 2**4)
Traceback (most recent call last):
... Val... | trusted_official_docs | CPython Docs | Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`::
>>> from enum import Flag, STRICT, auto
>>> class StrictFlag(Flag, boundary=STRICT):
... RED = auto()
... GREEN = auto()
... BLUE = auto()
... >>> StrictFlag(2**2 + 2**4)
Traceback (most recent call last):
... Val... | Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`::
>>> from enum import Flag, STRICT, auto
>>> class StrictFlag(Flag, boundary=STRICT):
... RED = auto()
... GREEN = auto()
... BLUE = auto()
... >>> StrictFlag(2**2 + 2**4)
Traceback (most recent call last):
... Val... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2659bc18-2f35-40b9-b808-03d619592640 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,297 | supabase-export-v2 | 27d45793e82442ed | .. method:: Enum._generate_next_value_(name, start, count, last_values)
:name: The name of the member being defined (e.g. 'RED'). :start: The start value for the Enum; the default is 1. :count: The number of members currently defined, not including this one. :last_values: A list of the previous values. | trusted_official_docs | CPython Docs | .. method:: Enum._generate_next_value_(name, start, count, last_values)
:name: The name of the member being defined (e.g. 'RED'). :start: The start value for the Enum; the default is 1. :count: The number of members currently defined, not including this one. :last_values: A list of the previous values. | .. method:: Enum._generate_next_value_(name, start, count, last_values)
:name: The name of the member being defined (e.g. 'RED'). :start: The start value for the Enum; the default is 1. :count: The number of members currently defined, not including this one. :last_values: A list of the previous values. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
276d08b8-2a7b-4908-a7d8-f0fa1089c9b1 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,447 | supabase-export-v2 | 6ab640a97041ed15 | - ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_
.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
.. versionadded:: 3.7 ``_ignore_``
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
.. _`IPython's rich display`: https://ipython.readthedocs.i... | trusted_official_docs | CPython Docs | - ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_
.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
.. versionadded:: 3.7 ``_ignore_``
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
.. _`IPython's rich display`: https://ipython.readthedocs.i... | - ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_
.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
.. versionadded:: 3.7 ``_ignore_``
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
.. _`IPython's rich display`: https://ipython.readthedocs.i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2af5bb22-f932-469a-86b1-b246706ae082 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,485 | supabase-export-v2 | 07d89135d0e67ff7 | If you do not need/want those limitations, you can either create your own base class by mixing in the ``int`` or ``str`` type yourself::
>>> from enum import Enum
>>> class MyIntEnum(int, Enum):
... pass | trusted_official_docs | CPython Docs | If you do not need/want those limitations, you can either create your own base class by mixing in the ``int`` or ``str`` type yourself::
>>> from enum import Enum
>>> class MyIntEnum(int, Enum):
... pass | If you do not need/want those limitations, you can either create your own base class by mixing in the ``int`` or ``str`` type yourself::
>>> from enum import Enum
>>> class MyIntEnum(int, Enum):
... pass | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b44b4d5-fa8b-446e-8964-ef85cccc3972 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,349 | supabase-export-v2 | aaea0a7a3e87c7d8 | that a string can be used. The result of any string operation performed on or with a *StrEnum* member is not part of the enumeration.
>>> from enum import StrEnum, auto
>>> class Color(StrEnum):
... RED = 'r'
... GREEN = 'g'
... BLUE = 'b'
... UNKNOWN = auto()
... >>> Color.RED
<Color.RED: 'r'>
>>> Color.UNKNOW... | trusted_official_docs | CPython Docs | that a string can be used. The result of any string operation performed on or with a *StrEnum* member is not part of the enumeration.
>>> from enum import StrEnum, auto
>>> class Color(StrEnum):
... RED = 'r'
... GREEN = 'g'
... BLUE = 'b'
... UNKNOWN = auto()
... >>> Color.RED
<Color.RED: 'r'>
>>> Color.UNKNOW... | that a string can be used. The result of any string operation performed on or with a *StrEnum* member is not part of the enumeration.
>>> from enum import StrEnum, auto
>>> class Color(StrEnum):
... RED = 'r'
... GREEN = 'g'
... BLUE = 'b'
... UNKNOWN = auto()
... >>> Color.RED
<Color.RED: 'r'>
>>> Color.UNKNOW... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
30d7cff5-daaf-4fdc-85d1-9ee68504bfb4 | CPython Docs | file://datasets/cpython/Doc/library/enum.rst | unknown | a38f5727-9108-4b49-a985-c6ddcaba72f4 | 50,457 | supabase-export-v2 | fec005f6dc1ab33c | ``_generate_next_value_`` can be overridden to customize the values used by *auto*.
.. note:: In version 3.13 the default ``_generate_next_value_`` will always return
the highest member value incremented by 1, and will fail if any
member is an incompatible type. | trusted_official_docs | CPython Docs | ``_generate_next_value_`` can be overridden to customize the values used by *auto*.
.. note:: In version 3.13 the default ``_generate_next_value_`` will always return
the highest member value incremented by 1, and will fail if any
member is an incompatible type. | ``_generate_next_value_`` can be overridden to customize the values used by *auto*.
.. note:: In version 3.13 the default ``_generate_next_value_`` will always return
the highest member value incremented by 1, and will fail if any
member is an incompatible type. | 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.