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
0bba633d-4ec5-4bf4-b853-966179b311b2
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,162
supabase-export-v2
5001bf81e1df9cfc
can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a subclass of the :exc:`Warning` class. The following warnings category classes are currently defined:
trusted_official_docs
CPython Docs
can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a subclass of the :exc:`Warning` class. The following warnings category classes are currently defined:
can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a subclass of the :exc:`Warning` class. The following warnings category classes are currently defined:
python, official-docs, cpython, P0
Local_Trusted_Corpus
0bc4cec3-ca82-472b-8f78-48e930395d8d
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,190
supabase-export-v2
58df2174505d52f4
entries without interpretation in :data:`sys.warnoptions`; the :mod:`!warnings` module parses these when it is first imported (invalid options are ignored, after printing a message to :data:`sys.stderr`). Individual warnings filters are specified as a sequence of fields separated by colons::
trusted_official_docs
CPython Docs
entries without interpretation in :data:`sys.warnoptions`; the :mod:`!warnings` module parses these when it is first imported (invalid options are ignored, after printing a message to :data:`sys.stderr`). Individual warnings filters are specified as a sequence of fields separated by colons::
entries without interpretation in :data:`sys.warnoptions`; the :mod:`!warnings` module parses these when it is first imported (invalid options are ignored, after printing a message to :data:`sys.stderr`). Individual warnings filters are specified as a sequence of fields separated by colons::
python, official-docs, cpython, P0
Local_Trusted_Corpus
0c1675d9-b911-481a-b510-28840788f945
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,175
supabase-export-v2
80b7747da9e6f0e5
match is found; the filter determines the disposition of the match. Each entry is a tuple of the form (*action*, *message*, *category*, *module*, *lineno*), where: * *action* is one of the following strings:
trusted_official_docs
CPython Docs
match is found; the filter determines the disposition of the match. Each entry is a tuple of the form (*action*, *message*, *category*, *module*, *lineno*), where: * *action* is one of the following strings:
match is found; the filter determines the disposition of the match. Each entry is a tuple of the form (*action*, *message*, *category*, *module*, *lineno*), where: * *action* is one of the following strings:
python, official-docs, cpython, P0
Local_Trusted_Corpus
0c2e53d7-e394-4916-9878-5794e5c6a05b
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,262
supabase-export-v2
3ecad045b306ce5d
.. versionchanged:: 3.6 Add the *source* parameter. .. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.6 Add the *source* parameter. .. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself.
.. versionchanged:: 3.6 Add the *source* parameter. .. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0e3f872d-06c9-4ba3-ae0e-c8eac647a8dd
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,263
supabase-export-v2
ee2ce4ae3710bf11
.. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself. .. function:: showwarning(message, category, filename, lineno, file=None, line=None)
trusted_official_docs
CPython Docs
.. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself. .. function:: showwarning(message, category, filename, lineno, file=None, line=None)
.. versionchanged:: 3.15 If no module is passed, test the filter regular expression against module names created from the path, not only the path itself. .. function:: showwarning(message, category, filename, lineno, file=None, line=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
0e714c93-b375-4b39-b95c-e166332e66eb
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,298
supabase-export-v2
92911c6e0241f550
multiple threads or using asyncio coroutines). For example, if two or more threads use the :class:`catch_warnings` class at the same time, the behavior is undefined. If the flag is true, :class:`catch_warnings` will not modify global attributes and will instead use a :class:`~contextvars.ContextVar` to store the newly ...
trusted_official_docs
CPython Docs
multiple threads or using asyncio coroutines). For example, if two or more threads use the :class:`catch_warnings` class at the same time, the behavior is undefined. If the flag is true, :class:`catch_warnings` will not modify global attributes and will instead use a :class:`~contextvars.ContextVar` to store the newly ...
multiple threads or using asyncio coroutines). For example, if two or more threads use the :class:`catch_warnings` class at the same time, the behavior is undefined. If the flag is true, :class:`catch_warnings` will not modify global attributes and will instead use a :class:`~contextvars.ContextVar` to store the newly ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
13008435-e6d9-4d10-82c9-b02f46a2137c
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,270
supabase-export-v2
48e70e44244bad98
.. function:: simplefilter(action, category=Warning, lineno=0, append=False) Insert a simple entry into the list of :ref:`warnings filter specifications <warning-filter>`. The meaning of the function parameters is as for :func:`filterwarnings`, but regular expressions are not needed as the filter inserted always mat...
trusted_official_docs
CPython Docs
.. function:: simplefilter(action, category=Warning, lineno=0, append=False) Insert a simple entry into the list of :ref:`warnings filter specifications <warning-filter>`. The meaning of the function parameters is as for :func:`filterwarnings`, but regular expressions are not needed as the filter inserted always mat...
.. function:: simplefilter(action, category=Warning, lineno=0, append=False) Insert a simple entry into the list of :ref:`warnings filter specifications <warning-filter>`. The meaning of the function parameters is as for :func:`filterwarnings`, but regular expressions are not needed as the filter inserted always mat...
python, official-docs, cpython, P0
Local_Trusted_Corpus
166594f5-58d9-451f-9a96-4e09e53aa388
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,193
supabase-export-v2
97e09274a517b01a
filters listed later take precedence over those listed before them (as they're applied left-to-right, and the most recently applied filters take precedence over earlier ones). Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packa...
trusted_official_docs
CPython Docs
filters listed later take precedence over those listed before them (as they're applied left-to-right, and the most recently applied filters take precedence over earlier ones). Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packa...
filters listed later take precedence over those listed before them (as they're applied left-to-right, and the most recently applied filters take precedence over earlier ones). Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packa...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1ceedb4e-b707-44b4-8787-3842b85275b1
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,246
supabase-export-v2
f812a63c8c911712
the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message). The *skip_file_prefixes* keyword argument can be used to indicate which stack frames are ignored when counting stack levels. This can be useful wh...
trusted_official_docs
CPython Docs
the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message). The *skip_file_prefixes* keyword argument can be used to indicate which stack frames are ignored when counting stack levels. This can be useful wh...
the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message). The *skip_file_prefixes* keyword argument can be used to indicate which stack frames are ignored when counting stack levels. This can be useful wh...
python, official-docs, cpython, P0
Local_Trusted_Corpus
25fca105-9663-4cdc-b288-e72e1754c811
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,198
supabase-export-v2
800b63b9d362b8b9
By default, Python installs several warning filters, which can be overridden by the :option:`-W` command-line option, the :envvar:`PYTHONWARNINGS` environment variable and calls to :func:`filterwarnings`. In regular release builds, the default warning filter has the following entries (in order of precedence)::
trusted_official_docs
CPython Docs
By default, Python installs several warning filters, which can be overridden by the :option:`-W` command-line option, the :envvar:`PYTHONWARNINGS` environment variable and calls to :func:`filterwarnings`. In regular release builds, the default warning filter has the following entries (in order of precedence)::
By default, Python installs several warning filters, which can be overridden by the :option:`-W` command-line option, the :envvar:`PYTHONWARNINGS` environment variable and calls to :func:`filterwarnings`. In regular release builds, the default warning filter has the following entries (in order of precedence)::
python, official-docs, cpython, P0
Local_Trusted_Corpus
2622c4fb-d697-4df0-ad63-a34b7ccbd388
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,300
supabase-export-v2
6004b6f145151aba
is true and the flag is false, the context manager works by replacing and then later restoring the module's :func:`showwarning` function. That is not concurrent-safe. When *record* is true and the flag is true, the :func:`showwarning` function is not replaced. Instead, the recording status is indicated by an internal p...
trusted_official_docs
CPython Docs
is true and the flag is false, the context manager works by replacing and then later restoring the module's :func:`showwarning` function. That is not concurrent-safe. When *record* is true and the flag is true, the :func:`showwarning` function is not replaced. Instead, the recording status is indicated by an internal p...
is true and the flag is false, the context manager works by replacing and then later restoring the module's :func:`showwarning` function. That is not concurrent-safe. When *record* is true and the flag is true, the :func:`showwarning` function is not replaced. Instead, the recording status is indicated by an internal p...
python, official-docs, cpython, P0
Local_Trusted_Corpus
28e4665f-a220-4391-97d7-e467f1eb0adb
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,299
supabase-export-v2
6f668f389e7e1d1c
use a :class:`~contextvars.ContextVar` to store the newly established warning filtering state. A context variable provides thread-local storage and it makes the use of :class:`catch_warnings` thread-safe. The *record* parameter of the context handler also behaves differently depending on the value of the flag. When *re...
trusted_official_docs
CPython Docs
use a :class:`~contextvars.ContextVar` to store the newly established warning filtering state. A context variable provides thread-local storage and it makes the use of :class:`catch_warnings` thread-safe. The *record* parameter of the context handler also behaves differently depending on the value of the flag. When *re...
use a :class:`~contextvars.ContextVar` to store the newly established warning filtering state. A context variable provides thread-local storage and it makes the use of :class:`catch_warnings` thread-safe. The *record* parameter of the context handler also behaves differently depending on the value of the flag. When *re...
python, official-docs, cpython, P0
Local_Trusted_Corpus
33d8dd45-6b80-4fb5-aa42-23a25d34f5c5
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,203
supabase-export-v2
669dd06e7c466de7
.. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``. .. versionchanged:: 3.7 :exc:`BytesWarning` no longer appears in the default filter list and is instead configured via :data:`sys.warnoptions` when :option:`-b` is specified twice.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``. .. versionchanged:: 3.7 :exc:`BytesWarning` no longer appears in the default filter list and is instead configured via :data:`sys.warnoptions` when :option:`-b` is specified twice.
.. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``. .. versionchanged:: 3.7 :exc:`BytesWarning` no longer appears in the default filter list and is instead configured via :data:`sys.warnoptions` when :option:`-b` is specified twice.
python, official-docs, cpython, P0
Local_Trusted_Corpus
33fac94f-be23-4be4-b102-766d25d450cf
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,264
supabase-export-v2
e0509eef33ce3ce4
.. function:: showwarning(message, category, filename, lineno, file=None, line=None) Write a warning to a file. The default implementation calls ``formatwarning(message, category, filename, lineno, line)`` and writes the resulting string to *file*, which defaults to :data:`sys.stderr`. You may replace this function ...
trusted_official_docs
CPython Docs
.. function:: showwarning(message, category, filename, lineno, file=None, line=None) Write a warning to a file. The default implementation calls ``formatwarning(message, category, filename, lineno, line)`` and writes the resulting string to *file*, which defaults to :data:`sys.stderr`. You may replace this function ...
.. function:: showwarning(message, category, filename, lineno, file=None, line=None) Write a warning to a file. The default implementation calls ``formatwarning(message, category, filename, lineno, line)`` and writes the resulting string to *file*, which defaults to :data:`sys.stderr`. You may replace this function ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
353eb0ef-1a20-40ad-98e9-1bab2be6420f
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,265
supabase-export-v2
0a34e48a3d8d8682
code to be included in the warning message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno, line=None)
trusted_official_docs
CPython Docs
code to be included in the warning message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno, line=None)
code to be included in the warning message; if *line* is not supplied, :func:`showwarning` will try to read the line specified by *filename* and *lineno*. .. function:: formatwarning(message, category, filename, lineno, line=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
459942d7-51d4-4215-99ac-8b13b9875335
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,202
supabase-export-v2
3085a7537bebf1df
.. versionchanged:: 3.2 :exc:`DeprecationWarning` is now ignored by default in addition to :exc:`PendingDeprecationWarning`. .. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.2 :exc:`DeprecationWarning` is now ignored by default in addition to :exc:`PendingDeprecationWarning`. .. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``.
.. versionchanged:: 3.2 :exc:`DeprecationWarning` is now ignored by default in addition to :exc:`PendingDeprecationWarning`. .. versionchanged:: 3.7 :exc:`DeprecationWarning` is once again shown by default when triggered directly by code in ``__main__``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4964e18a-b45a-4cd3-a276-4bb7d1fbca13
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,179
supabase-export-v2
baefd35e828ed530
* *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match. * *module* is a string containing a regular expression that the start of the fully qualified module name must match, case-sensitively. In :option:`-W` and :envvar:`PYTHONWARNINGS`, if *module* st...
trusted_official_docs
CPython Docs
* *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match. * *module* is a string containing a regular expression that the start of the fully qualified module name must match, case-sensitively. In :option:`-W` and :envvar:`PYTHONWARNINGS`, if *module* st...
* *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match. * *module* is a string containing a regular expression that the start of the fully qualified module name must match, case-sensitively. In :option:`-W` and :envvar:`PYTHONWARNINGS`, if *module* st...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d7c4459-19b5-42e4-9c2f-bbf99de33459
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,152
supabase-export-v2
5368b366be028a2a
Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` for details). Warning messages are normally written to :data:`sys.stderr`, but their disposition can be changed flexibly, from ignoring all warnings to t...
trusted_official_docs
CPython Docs
Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` for details). Warning messages are normally written to :data:`sys.stderr`, but their disposition can be changed flexibly, from ignoring all warnings to t...
Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` for details). Warning messages are normally written to :data:`sys.stderr`, but their disposition can be changed flexibly, from ignoring all warnings to t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d95a5ec-87fb-47b5-ad4c-a217a6b2d856
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,289
supabase-export-v2
193c70654cbe966c
If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on entering the context. See :ref:`warning-filter` for the meaning of the *category* and *lineno* parameters.
trusted_official_docs
CPython Docs
If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on entering the context. See :ref:`warning-filter` for the meaning of the *category* and *lineno* parameters.
If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on entering the context. See :ref:`warning-filter` for the meaning of the *category* and *lineno* parameters.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5103b34e-56a2-4371-b9b3-52b72e31035f
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,181
supabase-export-v2
fdfc880a7a3a040c
* *lineno* is an integer that the line number where the warning occurred must match, or ``0`` to match all line numbers. Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``.
trusted_official_docs
CPython Docs
* *lineno* is an integer that the line number where the warning occurred must match, or ``0`` to match all line numbers. Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``.
* *lineno* is an integer that the line number where the warning occurred must match, or ``0`` to match all line numbers. Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
51660a96-950a-4c28-8773-ce3bd0ce87dd
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,243
supabase-export-v2
56a110ed0686daac
.. function:: warn(message, category=None, stacklevel=1, source=None, *, skip_file_prefixes=()) Issue a warning, or maybe ignore it or raise an exception. The *category* argument, if given, must be a :ref:`warning category class <warning-categories>`; it defaults to :exc:`UserWarning`. Alternatively, *message* can be...
trusted_official_docs
CPython Docs
.. function:: warn(message, category=None, stacklevel=1, source=None, *, skip_file_prefixes=()) Issue a warning, or maybe ignore it or raise an exception. The *category* argument, if given, must be a :ref:`warning category class <warning-categories>`; it defaults to :exc:`UserWarning`. Alternatively, *message* can be...
.. function:: warn(message, category=None, stacklevel=1, source=None, *, skip_file_prefixes=()) Issue a warning, or maybe ignore it or raise an exception. The *category* argument, if given, must be a :ref:`warning category class <warning-categories>`; it defaults to :exc:`UserWarning`. Alternatively, *message* can be...
python, official-docs, cpython, P0
Local_Trusted_Corpus
53d1225d-e5f5-4c10-82aa-ea749e1585d4
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,239
supabase-export-v2
fe8a7d6e527524dd
and the test runner will take care of implicitly enabling all warnings when running tests (the test runner provided by the :mod:`unittest` module does this). In less ideal cases, applications can be checked for use of deprecated interfaces by passing :option:`-Wd <-W>` to the Python interpreter (this is shorthand for :...
trusted_official_docs
CPython Docs
and the test runner will take care of implicitly enabling all warnings when running tests (the test runner provided by the :mod:`unittest` module does this). In less ideal cases, applications can be checked for use of deprecated interfaces by passing :option:`-Wd <-W>` to the Python interpreter (this is shorthand for :...
and the test runner will take care of implicitly enabling all warnings when running tests (the test runner provided by the :mod:`unittest` module does this). In less ideal cases, applications can be checked for use of deprecated interfaces by passing :option:`-Wd <-W>` to the Python interpreter (this is shorthand for :...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5784dc0a-7c53-4b8d-bc81-1d324ea3425c
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,156
supabase-export-v2
3c2cd38a1d2c9af8
which may be overridden; the default implementation of this function formats the message by calling :func:`formatwarning`, which is also available for use by custom implementations. .. seealso:: :func:`logging.captureWarnings` allows you to handle all warnings with the standard logging infrastructure.
trusted_official_docs
CPython Docs
which may be overridden; the default implementation of this function formats the message by calling :func:`formatwarning`, which is also available for use by custom implementations. .. seealso:: :func:`logging.captureWarnings` allows you to handle all warnings with the standard logging infrastructure.
which may be overridden; the default implementation of this function formats the message by calling :func:`formatwarning`, which is also available for use by custom implementations. .. seealso:: :func:`logging.captureWarnings` allows you to handle all warnings with the standard logging infrastructure.
python, official-docs, cpython, P0
Local_Trusted_Corpus
592d7ec5-90b0-43b3-bf3b-81b3982d2342
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,155
supabase-export-v2
b31468ed04ef5020
sequence of matching rules and actions. Rules can be added to the filter by calling :func:`filterwarnings` and reset to its default state by calling :func:`resetwarnings`. The printing of warning messages is done by calling :func:`showwarning`, which may be overridden; the default implementation of this function format...
trusted_official_docs
CPython Docs
sequence of matching rules and actions. Rules can be added to the filter by calling :func:`filterwarnings` and reset to its default state by calling :func:`resetwarnings`. The printing of warning messages is done by calling :func:`showwarning`, which may be overridden; the default implementation of this function format...
sequence of matching rules and actions. Rules can be added to the filter by calling :func:`filterwarnings` and reset to its default state by calling :func:`resetwarnings`. The printing of warning messages is done by calling :func:`showwarning`, which may be overridden; the default implementation of this function format...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5f16701c-b286-4808-9a2e-57c93cf225a9
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,192
supabase-export-v2
0b37bbfe13579bc6
action:message:category:module:line The meaning of each of these fields is as described in :ref:`warning-filter`. When listing multiple filters on a single line (as for :envvar:`PYTHONWARNINGS`), the individual filters are separated by commas and the filters listed later take precedence over those listed before them (a...
trusted_official_docs
CPython Docs
action:message:category:module:line The meaning of each of these fields is as described in :ref:`warning-filter`. When listing multiple filters on a single line (as for :envvar:`PYTHONWARNINGS`), the individual filters are separated by commas and the filters listed later take precedence over those listed before them (a...
action:message:category:module:line The meaning of each of these fields is as described in :ref:`warning-filter`. When listing multiple filters on a single line (as for :envvar:`PYTHONWARNINGS`), the individual filters are separated by commas and the filters listed later take precedence over those listed before them (a...
python, official-docs, cpython, P0
Local_Trusted_Corpus
616e4c73-5640-4a3d-ab4f-5c13080d4251
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,269
supabase-export-v2
de9706417a2e2f22
front of the list override entries later in the list, if both match a particular warning. Omitted arguments default to a value that matches everything. .. function:: simplefilter(action, category=Warning, lineno=0, append=False)
trusted_official_docs
CPython Docs
front of the list override entries later in the list, if both match a particular warning. Omitted arguments default to a value that matches everything. .. function:: simplefilter(action, category=Warning, lineno=0, append=False)
front of the list override entries later in the list, if both match a particular warning. Omitted arguments default to a value that matches everything. .. function:: simplefilter(action, category=Warning, lineno=0, append=False)
python, official-docs, cpython, P0
Local_Trusted_Corpus
6558c4ab-2fd9-44b1-9246-ecf0e0bc5665
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,259
supabase-export-v2
dba5132b9f0ffefb
If no registry is passed, each warning is treated as the first occurrence, that is, filter actions ``"default"``, ``"module"`` and ``"once"`` are handled as ``"always"``. *module_globals*, if supplied, should be the global namespace in use by the code for which the warning is issued. (This argument is used to support ...
trusted_official_docs
CPython Docs
If no registry is passed, each warning is treated as the first occurrence, that is, filter actions ``"default"``, ``"module"`` and ``"once"`` are handled as ``"always"``. *module_globals*, if supplied, should be the global namespace in use by the code for which the warning is issued. (This argument is used to support ...
If no registry is passed, each warning is treated as the first occurrence, that is, filter actions ``"default"``, ``"module"`` and ``"once"`` are handled as ``"always"``. *module_globals*, if supplied, should be the global namespace in use by the code for which the warning is issued. (This argument is used to support ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
671381bd-9d52-403c-9aab-7c466b8b4058
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,176
supabase-export-v2
4d56daf601385f07
* *action* is one of the following strings: +---------------+----------------------------------------------+ | Value | Disposition | +===============+==============================================+ | ``"default"`` | print the first occurrence of matching | | | warnings for each location (module + | | | line number...
trusted_official_docs
CPython Docs
* *action* is one of the following strings: +---------------+----------------------------------------------+ | Value | Disposition | +===============+==============================================+ | ``"default"`` | print the first occurrence of matching | | | warnings for each location (module + | | | line number...
* *action* is one of the following strings: +---------------+----------------------------------------------+ | Value | Disposition | +===============+==============================================+ | ``"default"`` | print the first occurrence of matching | | | warnings for each location (module + | | | line number...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6c0ebef7-600d-44d5-89fd-8d175d5c9796
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,283
supabase-export-v2
58ab5f8f432dcf4d
If applied to an overload, the decorator must be after the :deco:`~typing.overload` decorator for the attribute to exist on the overload as returned by :func:`typing.get_overloads`. .. versionadded:: 3.13 See :pep:`702`.
trusted_official_docs
CPython Docs
If applied to an overload, the decorator must be after the :deco:`~typing.overload` decorator for the attribute to exist on the overload as returned by :func:`typing.get_overloads`. .. versionadded:: 3.13 See :pep:`702`.
If applied to an overload, the decorator must be after the :deco:`~typing.overload` decorator for the attribute to exist on the overload as returned by :func:`typing.get_overloads`. .. versionadded:: 3.13 See :pep:`702`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6cc26c46-67ff-4960-99a1-4abd4a5344a2
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,301
supabase-export-v2
75543028e06bf9e2
is indicated by an internal property in the context variable. In this case, the :func:`showwarning` function will not be restored when exiting the context handler. The :data:`~sys.flags.context_aware_warnings` flag can be set the :option:`-X context_aware_warnings<-X>` command-line option or by the :envvar:`PYTHON_CONT...
trusted_official_docs
CPython Docs
is indicated by an internal property in the context variable. In this case, the :func:`showwarning` function will not be restored when exiting the context handler. The :data:`~sys.flags.context_aware_warnings` flag can be set the :option:`-X context_aware_warnings<-X>` command-line option or by the :envvar:`PYTHON_CONT...
is indicated by an internal property in the context variable. In this case, the :func:`showwarning` function will not be restored when exiting the context handler. The :data:`~sys.flags.context_aware_warnings` flag can be set the :option:`-X context_aware_warnings<-X>` command-line option or by the :envvar:`PYTHON_CONT...
python, official-docs, cpython, P0
Local_Trusted_Corpus
75755af3-962d-486d-92b6-1178bcd3844f
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,273
supabase-export-v2
68b73b3f32a8e365
the warnings filter. This discards the effect of all previous calls to :func:`filterwarnings`, including that of the :option:`-W` command line options and calls to :func:`simplefilter`. .. decorator:: deprecated(msg, *, category=DeprecationWarning, stacklevel=1)
trusted_official_docs
CPython Docs
the warnings filter. This discards the effect of all previous calls to :func:`filterwarnings`, including that of the :option:`-W` command line options and calls to :func:`simplefilter`. .. decorator:: deprecated(msg, *, category=DeprecationWarning, stacklevel=1)
the warnings filter. This discards the effect of all previous calls to :func:`filterwarnings`, including that of the :option:`-W` command line options and calls to :func:`simplefilter`. .. decorator:: deprecated(msg, *, category=DeprecationWarning, stacklevel=1)
python, official-docs, cpython, P0
Local_Trusted_Corpus
783fda9a-0321-4448-a540-aaea9d403d37
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,220
supabase-export-v2
3a4fe6b03fb4d233
with warnings.catch_warnings(): warnings.simplefilter("ignore") fxn() While within the context manager all warnings will simply be ignored. This allows you to use known-deprecated code without having to see the warning while not suppressing the warning for other code that might not be aware of its use of deprecated cod...
trusted_official_docs
CPython Docs
with warnings.catch_warnings(): warnings.simplefilter("ignore") fxn() While within the context manager all warnings will simply be ignored. This allows you to use known-deprecated code without having to see the warning while not suppressing the warning for other code that might not be aware of its use of deprecated cod...
with warnings.catch_warnings(): warnings.simplefilter("ignore") fxn() While within the context manager all warnings will simply be ignored. This allows you to use known-deprecated code without having to see the warning while not suppressing the warning for other code that might not be aware of its use of deprecated cod...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7ef10a7c-860f-4b19-a1f4-a44a4b447375
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,164
supabase-export-v2
cc27acb24e158e44
.. tabularcolumns:: |l|p{0.6\linewidth}| +----------------------------------+-----------------------------------------------+ | Class | Description | +==================================+===============================================+ | :exc:`Warning` | This is the base class of all warning | | | category classes. It i...
trusted_official_docs
CPython Docs
.. tabularcolumns:: |l|p{0.6\linewidth}| +----------------------------------+-----------------------------------------------+ | Class | Description | +==================================+===============================================+ | :exc:`Warning` | This is the base class of all warning | | | category classes. It i...
.. tabularcolumns:: |l|p{0.6\linewidth}| +----------------------------------+-----------------------------------------------+ | Class | Description | +==================================+===============================================+ | :exc:`Warning` | This is the base class of all warning | | | category classes. It i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
81473305-3592-4df7-8ff3-628915ba45c9
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,216
supabase-export-v2
53635e10a21d5aae
Temporarily Suppressing Warnings -------------------------------- If you are using code that you know will raise a warning, such as a deprecated function, but do not want to see the warning (even when warnings have been explicitly configured via the command line), then it is possible to suppress the warning using the :...
trusted_official_docs
CPython Docs
Temporarily Suppressing Warnings -------------------------------- If you are using code that you know will raise a warning, such as a deprecated function, but do not want to see the warning (even when warnings have been explicitly configured via the command line), then it is possible to suppress the warning using the :...
Temporarily Suppressing Warnings -------------------------------- If you are using code that you know will raise a warning, such as a deprecated function, but do not want to see the warning (even when warnings have been explicitly configured via the command line), then it is possible to suppress the warning using the :...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8161edec-7b23-481f-8f95-e7c0f480a4ca
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,296
supabase-export-v2
180c8fea8e841e87
Concurrent safety of Context Managers ------------------------------------- The behavior of :class:`catch_warnings` context manager depends on the :data:`sys.flags.context_aware_warnings` flag. If the flag is true, the context manager behaves in a concurrent-safe fashion and otherwise not. Concurrent-safe means that it...
trusted_official_docs
CPython Docs
Concurrent safety of Context Managers ------------------------------------- The behavior of :class:`catch_warnings` context manager depends on the :data:`sys.flags.context_aware_warnings` flag. If the flag is true, the context manager behaves in a concurrent-safe fashion and otherwise not. Concurrent-safe means that it...
Concurrent safety of Context Managers ------------------------------------- The behavior of :class:`catch_warnings` context manager depends on the :data:`sys.flags.context_aware_warnings` flag. If the flag is true, the context manager behaves in a concurrent-safe fashion and otherwise not. Concurrent-safe means that it...
python, official-docs, cpython, P0
Local_Trusted_Corpus
825215e1-f696-40c5-a010-aa25847cdf1b
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,178
supabase-export-v2
45bdb6905b2af08e
it is a literal string that the start of the warning message must match (case-insensitively), ignoring any whitespace at the start or end of *message*. * *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match.
trusted_official_docs
CPython Docs
it is a literal string that the start of the warning message must match (case-insensitively), ignoring any whitespace at the start or end of *message*. * *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match.
it is a literal string that the start of the warning message must match (case-insensitively), ignoring any whitespace at the start or end of *message*. * *category* is a class (a subclass of :exc:`Warning`) of which the warning category must be a subclass in order to match.
python, official-docs, cpython, P0
Local_Trusted_Corpus
83cc6951-3495-4e29-b992-29f586316ff2
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,169
supabase-export-v2
e651f8b343e3a29e
for warnings related to | | | Unicode. | +----------------------------------+-----------------------------------------------+ | :exc:`BytesWarning` | Base category for warnings related to | | | :class:`bytes` and :class:`bytearray`. | +----------------------------------+-----------------------------------------------+ ...
trusted_official_docs
CPython Docs
for warnings related to | | | Unicode. | +----------------------------------+-----------------------------------------------+ | :exc:`BytesWarning` | Base category for warnings related to | | | :class:`bytes` and :class:`bytearray`. | +----------------------------------+-----------------------------------------------+ ...
for warnings related to | | | Unicode. | +----------------------------------+-----------------------------------------------+ | :exc:`BytesWarning` | Base category for warnings related to | | | :class:`bytes` and :class:`bytearray`. | +----------------------------------+-----------------------------------------------+ ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8601b8a6-51c4-4685-b9ba-e086ee2bbd9f
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,238
supabase-export-v2
0aaae256c02773d0
typically ignored warnings made visible in order to receive timely notifications of future breaking API changes (whether in the standard library or third party packages). In the ideal case, the code will have a suitable test suite, and the test runner will take care of implicitly enabling all warnings when running test...
trusted_official_docs
CPython Docs
typically ignored warnings made visible in order to receive timely notifications of future breaking API changes (whether in the standard library or third party packages). In the ideal case, the code will have a suitable test suite, and the test runner will take care of implicitly enabling all warnings when running test...
typically ignored warnings made visible in order to receive timely notifications of future breaking API changes (whether in the standard library or third party packages). In the ideal case, the code will have a suitable test suite, and the test runner will take care of implicitly enabling all warnings when running test...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8606cb01-31a4-42a8-9103-6078bb39c65a
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,225
supabase-export-v2
2900f6792d560363
Testing Warnings ---------------- To test warnings raised by code, use the :class:`catch_warnings` context manager. With it you can temporarily mutate the warnings filter to facilitate your testing. For instance, do the following to capture all raised warnings to check::
trusted_official_docs
CPython Docs
Testing Warnings ---------------- To test warnings raised by code, use the :class:`catch_warnings` context manager. With it you can temporarily mutate the warnings filter to facilitate your testing. For instance, do the following to capture all raised warnings to check::
Testing Warnings ---------------- To test warnings raised by code, use the :class:`catch_warnings` context manager. With it you can temporarily mutate the warnings filter to facilitate your testing. For instance, do the following to capture all raised warnings to check::
python, official-docs, cpython, P0
Local_Trusted_Corpus
87687164-593b-44fb-a29d-c5b0864bda8b
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,252
supabase-export-v2
a2d4866a92ab5be8
This makes the warning refer to both the ``example.lower.one_way()`` and ``example.higher.another_way()`` call sites only from calling code living outside of ``example`` package. *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
trusted_official_docs
CPython Docs
This makes the warning refer to both the ``example.lower.one_way()`` and ``example.higher.another_way()`` call sites only from calling code living outside of ``example`` package. *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
This makes the warning refer to both the ``example.lower.one_way()`` and ``example.higher.another_way()`` call sites only from calling code living outside of ``example`` package. *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
89434060-fa61-4378-9239-a7f8a22b567a
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,212
supabase-export-v2
99aab34cc8765713
if not sys.warnoptions: import os, warnings warnings.simplefilter("default") # Change the filter in this process os.environ["PYTHONWARNINGS"] = "default" # Also affect subprocesses Finally, developers of interactive shells that run user code in a namespace other than ``__main__`` are advised to ensure that :exc:`Deprec...
trusted_official_docs
CPython Docs
if not sys.warnoptions: import os, warnings warnings.simplefilter("default") # Change the filter in this process os.environ["PYTHONWARNINGS"] = "default" # Also affect subprocesses Finally, developers of interactive shells that run user code in a namespace other than ``__main__`` are advised to ensure that :exc:`Deprec...
if not sys.warnoptions: import os, warnings warnings.simplefilter("default") # Change the filter in this process os.environ["PYTHONWARNINGS"] = "default" # Also affect subprocesses Finally, developers of interactive shells that run user code in a namespace other than ``__main__`` are advised to ensure that :exc:`Deprec...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9102edc7-5c36-4f8e-a26d-74401354055a
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,150
supabase-export-v2
60049ea29e4a971e
-------------- Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that condition (normally) doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module.
trusted_official_docs
CPython Docs
-------------- Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that condition (normally) doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module.
-------------- Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that condition (normally) doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9636f038-4dae-4826-b85e-53e75b1393bd
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,303
supabase-export-v2
697a338efab5ba51
.. note:: It is likely that most programs that desire thread-safe behaviour of the warnings module will also want to set the :data:`~sys.flags.thread_inherit_context` flag to true. That flag causes threads created by :class:`threading.Thread` to start with a copy of the context variables from the thread starting i...
trusted_official_docs
CPython Docs
.. note:: It is likely that most programs that desire thread-safe behaviour of the warnings module will also want to set the :data:`~sys.flags.thread_inherit_context` flag to true. That flag causes threads created by :class:`threading.Thread` to start with a copy of the context variables from the thread starting i...
.. note:: It is likely that most programs that desire thread-safe behaviour of the warnings module will also want to set the :data:`~sys.flags.thread_inherit_context` flag to true. That flag causes threads created by :class:`threading.Thread` to start with a copy of the context variables from the thread starting i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
970741d5-11d6-443d-9a70-639b5ce3a258
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,230
supabase-export-v2
cbdc0e19b5d83808
then no matter what filters are set the warning will not be seen again unless the warnings registry related to the warning has been cleared. Once the context manager exits, the warnings filter is restored to its state when the context was entered. This prevents tests from changing the warnings filter in unexpected ways...
trusted_official_docs
CPython Docs
then no matter what filters are set the warning will not be seen again unless the warnings registry related to the warning has been cleared. Once the context manager exits, the warnings filter is restored to its state when the context was entered. This prevents tests from changing the warnings filter in unexpected ways...
then no matter what filters are set the warning will not be seen again unless the warnings registry related to the warning has been cleared. Once the context manager exits, the warnings filter is restored to its state when the context was entered. This prevents tests from changing the warnings filter in unexpected ways...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9d0e8028-8037-43f2-a92d-66f412ef0bb0
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,256
supabase-export-v2
4e03aa20f3d20367
.. function:: warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None, source=None) This is a low-level interface to the functionality of :func:`warn`, passing in explicitly the message, category, filename and line number, and optionally other arguments. *message* must be a ...
trusted_official_docs
CPython Docs
.. function:: warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None, source=None) This is a low-level interface to the functionality of :func:`warn`, passing in explicitly the message, category, filename and line number, and optionally other arguments. *message* must be a ...
.. function:: warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None, source=None) This is a low-level interface to the functionality of :func:`warn`, passing in explicitly the message, category, filename and line number, and optionally other arguments. *message* must be a ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9d99d54f-9340-463d-8223-db7a77ed2e5a
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,161
supabase-export-v2
3f8b24e40aa485ae
While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings mechanism. User code can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a s...
trusted_official_docs
CPython Docs
While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings mechanism. User code can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a s...
While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings mechanism. User code can define additional warning categories by subclassing one of the standard warning categories. A warning category must always be a s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9e6b9608-673b-48e8-97cc-a7209f865d29
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,153
supabase-export-v2
f85e9345caba29f8
of the warning message, and the source location where it is issued. Repetitions of a particular warning for the same source location are typically suppressed. There are two stages in warning control: first, each time a warning is issued, a determination is made whether a message should be issued or not; next, if a mess...
trusted_official_docs
CPython Docs
of the warning message, and the source location where it is issued. Repetitions of a particular warning for the same source location are typically suppressed. There are two stages in warning control: first, each time a warning is issued, a determination is made whether a message should be issued or not; next, if a mess...
of the warning message, and the source location where it is issued. Repetitions of a particular warning for the same source location are typically suppressed. There are two stages in warning control: first, each time a warning is issued, a determination is made whether a message should be issued or not; next, if a mess...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9eefa31b-01bb-413a-a860-e5c56803f6a6
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,286
supabase-export-v2
afdc6cd2423bbd02
.. class:: catch_warnings(*, record=False, module=None, action=None, category=Warning, lineno=0, append=False) A context manager that copies and, upon exit, restores the warnings filter and the :func:`showwarning` function. If the *record* argument is :const:`False` (the default) the context manager returns :class:`N...
trusted_official_docs
CPython Docs
.. class:: catch_warnings(*, record=False, module=None, action=None, category=Warning, lineno=0, append=False) A context manager that copies and, upon exit, restores the warnings filter and the :func:`showwarning` function. If the *record* argument is :const:`False` (the default) the context manager returns :class:`N...
.. class:: catch_warnings(*, record=False, module=None, action=None, category=Warning, lineno=0, append=False) A context manager that copies and, upon exit, restores the warnings filter and the :func:`showwarning` function. If the *record* argument is :const:`False` (the default) the context manager returns :class:`N...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a09e98f2-fb22-42a4-9858-e8bab5eb93f6
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,166
supabase-export-v2
96a27f1b6886bc9b
features when those warnings are intended for | | | other Python developers (ignored by default, | | | unless triggered by code in ``__main__``). | +----------------------------------+-----------------------------------------------+ | :exc:`SyntaxWarning` | Base category for warnings about dubious | | | syntactic featu...
trusted_official_docs
CPython Docs
features when those warnings are intended for | | | other Python developers (ignored by default, | | | unless triggered by code in ``__main__``). | +----------------------------------+-----------------------------------------------+ | :exc:`SyntaxWarning` | Base category for warnings about dubious | | | syntactic featu...
features when those warnings are intended for | | | other Python developers (ignored by default, | | | unless triggered by code in ``__main__``). | +----------------------------------+-----------------------------------------------+ | :exc:`SyntaxWarning` | Base category for warnings about dubious | | | syntactic featu...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a4a06284-b3d9-4e17-81fd-59e16e8720cc
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,266
supabase-export-v2
01ca3d5f8eefbda2
.. function:: formatwarning(message, category, filename, lineno, line=None) Format a warning the standard way. This returns a string which may contain embedded newlines and ends in a newline. *line* is a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will ...
trusted_official_docs
CPython Docs
.. function:: formatwarning(message, category, filename, lineno, line=None) Format a warning the standard way. This returns a string which may contain embedded newlines and ends in a newline. *line* is a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will ...
.. function:: formatwarning(message, category, filename, lineno, line=None) Format a warning the standard way. This returns a string which may contain embedded newlines and ends in a newline. *line* is a line of source code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a4bd685e-13a3-426a-88d3-14e034d55e64
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,174
supabase-export-v2
9d504c73746c0058
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains an ordered list of filter specifications; any specific warning is matched against each filter specification in the list in turn until a match is found; the filt...
trusted_official_docs
CPython Docs
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains an ordered list of filter specifications; any specific warning is matched against each filter specification in the list in turn until a match is found; the filt...
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains an ordered list of filter specifications; any specific warning is matched against each filter specification in the list in turn until a match is found; the filt...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a50f091b-2b7e-46cf-8242-787546d16d43
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,247
supabase-export-v2
9562edbf8457b529
implicitly overridden to be ``max(2, stacklevel)``. To cause a warning to be attributed to the caller from outside of the current package you might write:: # example/lower.py _warn_skips = (os.path.dirname(__file__),)
trusted_official_docs
CPython Docs
implicitly overridden to be ``max(2, stacklevel)``. To cause a warning to be attributed to the caller from outside of the current package you might write:: # example/lower.py _warn_skips = (os.path.dirname(__file__),)
implicitly overridden to be ``max(2, stacklevel)``. To cause a warning to be attributed to the caller from outside of the current package you might write:: # example/lower.py _warn_skips = (os.path.dirname(__file__),)
python, official-docs, cpython, P0
Local_Trusted_Corpus
a757b607-de36-496a-b426-3b3926aac021
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,194
supabase-export-v2
d0b7a8a929f9c7fe
Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packages. Some examples:: default # Show all warnings (even those ignored by default) ignore # Ignore all warnings error # Convert all warnings to errors error::ResourceWarning #...
trusted_official_docs
CPython Docs
Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packages. Some examples:: default # Show all warnings (even those ignored by default) ignore # Ignore all warnings error # Convert all warnings to errors error::ResourceWarning #...
Commonly used warning filters apply to either all warnings, warnings in a particular category, or warnings raised by particular modules or packages. Some examples:: default # Show all warnings (even those ignored by default) ignore # Ignore all warnings error # Convert all warnings to errors error::ResourceWarning #...
python, official-docs, cpython, P0
Local_Trusted_Corpus
a7fda9e6-11fa-46fb-8d94-44bbc97e4bd8
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,260
supabase-export-v2
5bc3c0205552990c
code for which the warning is issued. (This argument is used to support displaying source for modules found in zipfiles or other non-filesystem import sources). *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
trusted_official_docs
CPython Docs
code for which the warning is issued. (This argument is used to support displaying source for modules found in zipfiles or other non-filesystem import sources). *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
code for which the warning is issued. (This argument is used to support displaying source for modules found in zipfiles or other non-filesystem import sources). *source*, if supplied, is the destroyed object which emitted a :exc:`ResourceWarning`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
aaf705e4-847c-4f7a-8edd-b06feb9faa73
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,236
supabase-export-v2
4c4b4e500b1ee385
Updating Code For New Versions of Dependencies ---------------------------------------------- Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default.
trusted_official_docs
CPython Docs
Updating Code For New Versions of Dependencies ---------------------------------------------- Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default.
Updating Code For New Versions of Dependencies ---------------------------------------------- Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b3686ff2-01e6-4720-a724-a75cc1970e81
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,165
supabase-export-v2
aad46f830661b0bc
warning | | | category classes. It is a subclass of | | | :exc:`Exception`. | +----------------------------------+-----------------------------------------------+ | :exc:`UserWarning` | The default category for :func:`warn`. | +----------------------------------+-----------------------------------------------+ | :exc:`...
trusted_official_docs
CPython Docs
warning | | | category classes. It is a subclass of | | | :exc:`Exception`. | +----------------------------------+-----------------------------------------------+ | :exc:`UserWarning` | The default category for :func:`warn`. | +----------------------------------+-----------------------------------------------+ | :exc:`...
warning | | | category classes. It is a subclass of | | | :exc:`Exception`. | +----------------------------------+-----------------------------------------------+ | :exc:`UserWarning` | The default category for :func:`warn`. | +----------------------------------+-----------------------------------------------+ | :exc:`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ba3cadff-1fc0-416d-8724-8fc9c394b119
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,154
supabase-export-v2
ae658199b0f2e005
whether a message should be issued or not; next, if a message is to be issued, it is formatted and printed using a user-settable hook. The determination whether to issue a warning message is controlled by the :ref:`warning filter <warning-filter>`, which is a sequence of matching rules and actions. Rules can be added t...
trusted_official_docs
CPython Docs
whether a message should be issued or not; next, if a message is to be issued, it is formatted and printed using a user-settable hook. The determination whether to issue a warning message is controlled by the :ref:`warning filter <warning-filter>`, which is a sequence of matching rules and actions. Rules can be added t...
whether a message should be issued or not; next, if a message is to be issued, it is formatted and printed using a user-settable hook. The determination whether to issue a warning message is controlled by the :ref:`warning filter <warning-filter>`, which is a sequence of matching rules and actions. Rules can be added t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
bb360593-2705-4aba-b8c3-5b8569518465
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,168
supabase-export-v2
9f756d48a79afbe8
| :exc:`PendingDeprecationWarning` | Base category for warnings about features | | | that will be deprecated in the future | | | (ignored by default). | +----------------------------------+-----------------------------------------------+ | :exc:`ImportWarning` | Base category for warnings triggered during | | | the pro...
trusted_official_docs
CPython Docs
| :exc:`PendingDeprecationWarning` | Base category for warnings about features | | | that will be deprecated in the future | | | (ignored by default). | +----------------------------------+-----------------------------------------------+ | :exc:`ImportWarning` | Base category for warnings triggered during | | | the pro...
| :exc:`PendingDeprecationWarning` | Base category for warnings about features | | | that will be deprecated in the future | | | (ignored by default). | +----------------------------------+-----------------------------------------------+ | :exc:`ImportWarning` | Base category for warnings triggered during | | | the pro...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c3b896ae-5333-4f6e-bd5c-901a37cfa619
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,170
supabase-export-v2
b4befebe22f372c3
| +----------------------------------+-----------------------------------------------+ | :exc:`ResourceWarning` | Base category for warnings related to | | | resource usage (ignored by default). | +----------------------------------+-----------------------------------------------+ .. versionchanged:: 3.7 Previously :e...
trusted_official_docs
CPython Docs
| +----------------------------------+-----------------------------------------------+ | :exc:`ResourceWarning` | Base category for warnings related to | | | resource usage (ignored by default). | +----------------------------------+-----------------------------------------------+ .. versionchanged:: 3.7 Previously :e...
| +----------------------------------+-----------------------------------------------+ | :exc:`ResourceWarning` | Base category for warnings related to | | | resource usage (ignored by default). | +----------------------------------+-----------------------------------------------+ .. versionchanged:: 3.7 Previously :e...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c6ffd07f-aedb-4e9b-bfe3-25038484c871
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,228
supabase-export-v2
711da24535c7bd0c
def fxn(): warnings.warn("deprecated", DeprecationWarning) with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Trigger a warning. fxn() # Verify some things assert len(w) == 1 assert issubclass(w[-1].category, DeprecationWarning) assert "d...
trusted_official_docs
CPython Docs
def fxn(): warnings.warn("deprecated", DeprecationWarning) with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Trigger a warning. fxn() # Verify some things assert len(w) == 1 assert issubclass(w[-1].category, DeprecationWarning) assert "d...
def fxn(): warnings.warn("deprecated", DeprecationWarning) with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Trigger a warning. fxn() # Verify some things assert len(w) == 1 assert issubclass(w[-1].category, DeprecationWarning) assert "d...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c72b896c-8af1-4a01-99c0-2a1e71f26d8a
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,209
supabase-export-v2
6d0cdca56a0e3543
if not sys.warnoptions: import warnings warnings.simplefilter("ignore") Developers of test runners for Python code are advised to instead ensure that *all* warnings are displayed by default for the code under test, using code like::
trusted_official_docs
CPython Docs
if not sys.warnoptions: import warnings warnings.simplefilter("ignore") Developers of test runners for Python code are advised to instead ensure that *all* warnings are displayed by default for the code under test, using code like::
if not sys.warnoptions: import warnings warnings.simplefilter("ignore") Developers of test runners for Python code are advised to instead ensure that *all* warnings are displayed by default for the code under test, using code like::
python, official-docs, cpython, P0
Local_Trusted_Corpus
cafee4d3-7ebd-47ba-b758-f1304e8838e0
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,282
supabase-export-v2
0a1f3e9d339411e2
object; if it is higher, it is emitted further up the stack. Static type checker behavior is not affected by the *category* and *stacklevel* arguments. The deprecation message passed to the decorator is saved in the ``__deprecated__`` attribute on the decorated object. If applied to an overload, the decorator must be...
trusted_official_docs
CPython Docs
object; if it is higher, it is emitted further up the stack. Static type checker behavior is not affected by the *category* and *stacklevel* arguments. The deprecation message passed to the decorator is saved in the ``__deprecated__`` attribute on the decorated object. If applied to an overload, the decorator must be...
object; if it is higher, it is emitted further up the stack. Static type checker behavior is not affected by the *category* and *stacklevel* arguments. The deprecation message passed to the decorator is saved in the ``__deprecated__`` attribute on the decorated object. If applied to an overload, the decorator must be...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ccb6b515-2077-49ff-8653-03a85c21dcd7
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,297
supabase-export-v2
7e823791d68c8c6d
<coroutine>` and tasks. Being thread-safe means that behavior is predictable in a multi-threaded program. The flag defaults to true for free-threaded builds and false otherwise. If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:`catch_warnings` will modify the global attributes of the :mod:`!w...
trusted_official_docs
CPython Docs
<coroutine>` and tasks. Being thread-safe means that behavior is predictable in a multi-threaded program. The flag defaults to true for free-threaded builds and false otherwise. If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:`catch_warnings` will modify the global attributes of the :mod:`!w...
<coroutine>` and tasks. Being thread-safe means that behavior is predictable in a multi-threaded program. The flag defaults to true for free-threaded builds and false otherwise. If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:`catch_warnings` will modify the global attributes of the :mod:`!w...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d0e837e4-5cb2-489f-a22a-03193356f106
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,275
supabase-export-v2
12d11d557e97494e
Decorator to indicate that a class, function or overload is deprecated. When this decorator is applied to an object, deprecation warnings may be emitted at runtime when the object is used. :term:`static type checkers <static type checker>` will also generate a diagnostic on usage of the deprecated object.
trusted_official_docs
CPython Docs
Decorator to indicate that a class, function or overload is deprecated. When this decorator is applied to an object, deprecation warnings may be emitted at runtime when the object is used. :term:`static type checkers <static type checker>` will also generate a diagnostic on usage of the deprecated object.
Decorator to indicate that a class, function or overload is deprecated. When this decorator is applied to an object, deprecation warnings may be emitted at runtime when the object is used. :term:`static type checkers <static type checker>` will also generate a diagnostic on usage of the deprecated object.
python, official-docs, cpython, P0
Local_Trusted_Corpus
d661172e-bada-460b-81f2-223772dd2605
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,233
supabase-export-v2
5c264e767bc11b98
See :ref:`warning-concurrent-safe` for details on the concurrency-safety of the :class:`catch_warnings` context manager when used in programs using multiple threads or async functions. When testing multiple operations that raise the same kind of warning, it is important to test them in a manner that confirms each opera...
trusted_official_docs
CPython Docs
See :ref:`warning-concurrent-safe` for details on the concurrency-safety of the :class:`catch_warnings` context manager when used in programs using multiple threads or async functions. When testing multiple operations that raise the same kind of warning, it is important to test them in a manner that confirms each opera...
See :ref:`warning-concurrent-safe` for details on the concurrency-safety of the :class:`catch_warnings` context manager when used in programs using multiple threads or async functions. When testing multiple operations that raise the same kind of warning, it is important to test them in a manner that confirms each opera...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d6733ed4-aa27-401e-bbaa-c96a527eb6ec
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,186
supabase-export-v2
b5b19738b57e5764
The filters that suppress repeated warnings apply the following criteria to determine if a warning is considered a repeat: - ``"default"``: A warning is considered a repeat only if the (*message*, *category*, *module*, *lineno*) are all the same. - ``"module"``: A warning is considered a repeat if the (*message*, *cate...
trusted_official_docs
CPython Docs
The filters that suppress repeated warnings apply the following criteria to determine if a warning is considered a repeat: - ``"default"``: A warning is considered a repeat only if the (*message*, *category*, *module*, *lineno*) are all the same. - ``"module"``: A warning is considered a repeat if the (*message*, *cate...
The filters that suppress repeated warnings apply the following criteria to determine if a warning is considered a repeat: - ``"default"``: A warning is considered a repeat only if the (*message*, *category*, *module*, *lineno*) are all the same. - ``"module"``: A warning is considered a repeat if the (*message*, *cate...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d6a46625-b698-47ed-a570-6c13143fda03
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,268
supabase-export-v2
0c2c5df02119a6a2
.. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False) Insert an entry into the list of :ref:`warnings filter specifications <warning-filter>`. The entry is inserted at the front by default; if *append* is true, it is inserted at the end. This checks the types of the ar...
trusted_official_docs
CPython Docs
.. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False) Insert an entry into the list of :ref:`warnings filter specifications <warning-filter>`. The entry is inserted at the front by default; if *append* is true, it is inserted at the end. This checks the types of the ar...
.. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False) Insert an entry into the list of :ref:`warnings filter specifications <warning-filter>`. The entry is inserted at the front by default; if *append* is true, it is inserted at the end. This checks the types of the ar...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d6d2c777-67ea-4e3e-8656-d58b96f35044
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,288
supabase-export-v2
74fe2b092dba1296
used instead of the module returned when you import :mod:`!warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`!warnings` module itself. If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on e...
trusted_official_docs
CPython Docs
used instead of the module returned when you import :mod:`!warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`!warnings` module itself. If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on e...
used instead of the module returned when you import :mod:`!warnings` whose filter will be protected. This argument exists primarily for testing the :mod:`!warnings` module itself. If the *action* argument is not ``None``, the remaining arguments are passed to :func:`simplefilter` as if it were called immediately on e...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d9afd266-e1dd-4204-bde8-4818e76975d1
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,245
supabase-export-v2
9814fbe08560e463
def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2) This makes the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message).
trusted_official_docs
CPython Docs
def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2) This makes the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message).
def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2) This makes the warning refer to ``deprecated_api``'s caller, rather than to the source of ``deprecated_api`` itself (since the latter would defeat the purpose of the warning message).
python, official-docs, cpython, P0
Local_Trusted_Corpus
dc374a67-48dd-41e6-b422-2618b79b1e37
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,160
supabase-export-v2
6b5666c61d8ce62f
There are a number of built-in exceptions that represent warning categories. This categorization is useful to be able to filter out groups of warnings. While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings me...
trusted_official_docs
CPython Docs
There are a number of built-in exceptions that represent warning categories. This categorization is useful to be able to filter out groups of warnings. While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings me...
There are a number of built-in exceptions that represent warning categories. This categorization is useful to be able to filter out groups of warnings. While these are technically :ref:`built-in exceptions <warning-categories-as-exceptions>`, they are documented here, because conceptually they belong to the warnings me...
python, official-docs, cpython, P0
Local_Trusted_Corpus
dce2fda0-3ead-4f5b-99b1-a3a2253fa06f
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,258
supabase-export-v2
d0dce5dbd6c1d855
and against the filename with ``.py`` stripped. For example, when the filename is ``'/path/to/package/module.py'``, it will be tested against ``'path.to.package.module'``, ``'to.package.module'`` ``'package.module'``, ``'module'``, and ``'/path/to/package/module'``. *registry*, if supplied, should be the ``__warningreg...
trusted_official_docs
CPython Docs
and against the filename with ``.py`` stripped. For example, when the filename is ``'/path/to/package/module.py'``, it will be tested against ``'path.to.package.module'``, ``'to.package.module'`` ``'package.module'``, ``'module'``, and ``'/path/to/package/module'``. *registry*, if supplied, should be the ``__warningreg...
and against the filename with ``.py`` stripped. For example, when the filename is ``'/path/to/package/module.py'``, it will be tested against ``'path.to.package.module'``, ``'to.package.module'`` ``'package.module'``, ``'module'``, and ``'/path/to/package/module'``. *registry*, if supplied, should be the ``__warningreg...
python, official-docs, cpython, P0
Local_Trusted_Corpus
defec8ac-7b00-403a-9d15-14e8b0ea0bb4
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,189
supabase-export-v2
238bfb9353e64a45
Describing Warning Filters ~~~~~~~~~~~~~~~~~~~~~~~~~~ The warnings filter is initialized by :option:`-W` options passed to the Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment variable. The interpreter saves the arguments for all supplied entries without interpretation in :data:`sys.warnopti...
trusted_official_docs
CPython Docs
Describing Warning Filters ~~~~~~~~~~~~~~~~~~~~~~~~~~ The warnings filter is initialized by :option:`-W` options passed to the Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment variable. The interpreter saves the arguments for all supplied entries without interpretation in :data:`sys.warnopti...
Describing Warning Filters ~~~~~~~~~~~~~~~~~~~~~~~~~~ The warnings filter is initialized by :option:`-W` options passed to the Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment variable. The interpreter saves the arguments for all supplied entries without interpretation in :data:`sys.warnopti...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e1607f0a-3d4d-4c12-ac0b-52455b4ba986
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,281
supabase-export-v2
06e67183502156b6
@overload @deprecated("int support is deprecated") def g(x: int) -> int: ... @overload def g(x: str) -> int: ... The warning specified by *category* will be emitted at runtime on use of deprecated objects. For functions, that happens on calls; for classes, on instantiation and on creation of subclasses. If the *categ...
trusted_official_docs
CPython Docs
@overload @deprecated("int support is deprecated") def g(x: int) -> int: ... @overload def g(x: str) -> int: ... The warning specified by *category* will be emitted at runtime on use of deprecated objects. For functions, that happens on calls; for classes, on instantiation and on creation of subclasses. If the *categ...
@overload @deprecated("int support is deprecated") def g(x: int) -> int: ... @overload def g(x: str) -> int: ... The warning specified by *category* will be emitted at runtime on use of deprecated objects. For functions, that happens on calls; for classes, on instantiation and on creation of subclasses. If the *categ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e279c4bd-eb19-4715-8c00-00910f5539fa
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,237
supabase-export-v2
b66d2f4662a3f764
Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default. Notably, this "ignored by default" list includes :exc:`DeprecationWarning` (for every module except ``__main__``), which means developers should make sure to test thei...
trusted_official_docs
CPython Docs
Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default. Notably, this "ignored by default" list includes :exc:`DeprecationWarning` (for every module except ``__main__``), which means developers should make sure to test thei...
Warning categories that are primarily of interest to Python developers (rather than end users of applications written in Python) are ignored by default. Notably, this "ignored by default" list includes :exc:`DeprecationWarning` (for every module except ``__main__``), which means developers should make sure to test thei...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e4769f9f-9833-4a63-9f4b-029dd70c43bf
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,151
supabase-export-v2
2d347700f4644109
doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module. Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` ...
trusted_official_docs
CPython Docs
doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module. Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` ...
doesn't warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module. Python programmers issue warnings by calling the :func:`warn` function defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:`exceptionhandling` ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e876bf9b-c5f6-41ff-9e7b-7f91d6784a71
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,167
supabase-export-v2
555cbd5cd6cc1749
| | may not be suppressed by runtime filters) | +----------------------------------+-----------------------------------------------+ | :exc:`RuntimeWarning` | Base category for warnings about dubious | | | runtime features. | +----------------------------------+-----------------------------------------------+ | :exc:`F...
trusted_official_docs
CPython Docs
| | may not be suppressed by runtime filters) | +----------------------------------+-----------------------------------------------+ | :exc:`RuntimeWarning` | Base category for warnings about dubious | | | runtime features. | +----------------------------------+-----------------------------------------------+ | :exc:`F...
| | may not be suppressed by runtime filters) | +----------------------------------+-----------------------------------------------+ | :exc:`RuntimeWarning` | Base category for warnings about dubious | | | runtime features. | +----------------------------------+-----------------------------------------------+ | :exc:`F...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e9940809-519f-4e0c-b6b0-483ed2c5c6ca
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,182
supabase-export-v2
77295c11f62e7513
Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``. If a warning is reported and doesn't match any registered filter then the "default" action is applied (hence its name).
trusted_official_docs
CPython Docs
Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``. If a warning is reported and doesn't match any registered filter then the "default" action is applied (hence its name).
Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` class, to turn a warning into an error we simply raise ``category(message)``. If a warning is reported and doesn't match any registered filter then the "default" action is applied (hence its name).
python, official-docs, cpython, P0
Local_Trusted_Corpus
e9bcff56-3dda-4dd2-982a-45f13ae0d67d
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,177
supabase-export-v2
bfd48ecc595b520c
(regardless of line number) | +---------------+----------------------------------------------+ | ``"once"`` | print only the first occurrence of matching | | | warnings, regardless of location | +---------------+----------------------------------------------+ * *message* is a string containing a regular expression that...
trusted_official_docs
CPython Docs
(regardless of line number) | +---------------+----------------------------------------------+ | ``"once"`` | print only the first occurrence of matching | | | warnings, regardless of location | +---------------+----------------------------------------------+ * *message* is a string containing a regular expression that...
(regardless of line number) | +---------------+----------------------------------------------+ | ``"once"`` | print only the first occurrence of matching | | | warnings, regardless of location | +---------------+----------------------------------------------+ * *message* is a string containing a regular expression that...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e9c6738d-1c96-471d-abdc-04177ac82780
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,267
supabase-export-v2
1e0a776b0360c86d
code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False)
trusted_official_docs
CPython Docs
code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False)
code to be included in the warning message; if *line* is not supplied, :func:`formatwarning` will try to read the line specified by *filename* and *lineno*. .. function:: filterwarnings(action, message='', category=Warning, module='', lineno=0, append=False)
python, official-docs, cpython, P0
Local_Trusted_Corpus
eb2498b7-db6a-49db-a962-648ba73a48b6
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,213
supabase-export-v2
850a7f80d18f0c8b
ensure that :exc:`DeprecationWarning` messages are made visible by default, using code like the following (where ``user_ns`` is the module used to execute code entered interactively):: import warnings warnings.filterwarnings("default", category=DeprecationWarning, module=user_ns.get("__name__"))
trusted_official_docs
CPython Docs
ensure that :exc:`DeprecationWarning` messages are made visible by default, using code like the following (where ``user_ns`` is the module used to execute code entered interactively):: import warnings warnings.filterwarnings("default", category=DeprecationWarning, module=user_ns.get("__name__"))
ensure that :exc:`DeprecationWarning` messages are made visible by default, using code like the following (where ``user_ns`` is the module used to execute code entered interactively):: import warnings warnings.filterwarnings("default", category=DeprecationWarning, module=user_ns.get("__name__"))
python, official-docs, cpython, P0
Local_Trusted_Corpus
ebc737cc-c260-4e8b-bf0e-81470b7d8c2e
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,305
supabase-export-v2
212f97e6bec94aa6
.. versionchanged:: 3.14 Added the :data:`sys.flags.context_aware_warnings` flag and the use of a context variable for :class:`catch_warnings` if the flag is true. Previous versions of Python acted as if the flag was always set to false.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.14 Added the :data:`sys.flags.context_aware_warnings` flag and the use of a context variable for :class:`catch_warnings` if the flag is true. Previous versions of Python acted as if the flag was always set to false.
.. versionchanged:: 3.14 Added the :data:`sys.flags.context_aware_warnings` flag and the use of a context variable for :class:`catch_warnings` if the flag is true. Previous versions of Python acted as if the flag was always set to false.
python, official-docs, cpython, P0
Local_Trusted_Corpus
efee61b2-3afc-466d-b681-1b2b43c15e71
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,287
supabase-export-v2
113e3ddf67fb22fa
custom :func:`showwarning` function (which also suppresses output to ``sys.stdout``). Each object in the list has attributes with the same names as the arguments to :func:`showwarning`. The *module* argument takes a module that will be used instead of the module returned when you import :mod:`!warnings` whose filter w...
trusted_official_docs
CPython Docs
custom :func:`showwarning` function (which also suppresses output to ``sys.stdout``). Each object in the list has attributes with the same names as the arguments to :func:`showwarning`. The *module* argument takes a module that will be used instead of the module returned when you import :mod:`!warnings` whose filter w...
custom :func:`showwarning` function (which also suppresses output to ``sys.stdout``). Each object in the list has attributes with the same names as the arguments to :func:`showwarning`. The *module* argument takes a module that will be used instead of the module returned when you import :mod:`!warnings` whose filter w...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f52f3e2c-01ce-406d-ba32-d9212bfc0235
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,244
supabase-export-v2
841ee17c767e951a
issued is changed into an error by the :ref:`warnings filter <warning-filter>`. The *stacklevel* argument can be used by wrapper functions written in Python, like this:: def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2)
trusted_official_docs
CPython Docs
issued is changed into an error by the :ref:`warnings filter <warning-filter>`. The *stacklevel* argument can be used by wrapper functions written in Python, like this:: def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2)
issued is changed into an error by the :ref:`warnings filter <warning-filter>`. The *stacklevel* argument can be used by wrapper functions written in Python, like this:: def deprecated_api(message): warnings.warn(message, DeprecationWarning, stacklevel=2)
python, official-docs, cpython, P0
Local_Trusted_Corpus
f5530866-54dc-4749-bb49-56adc9ab887e
CPython Docs
file://datasets/cpython/Doc/library/warnings.rst
unknown
e7dbb631-5f7e-431c-902d-15239d39eaf9
46,257
supabase-export-v2
da8818dfa8229756
*message* must be a string and *category* a subclass of :exc:`Warning` or *message* may be a :exc:`Warning` instance, in which case *category* will be ignored. *module*, if supplied, should be the module name. If no module is passed, the module regular expression in :ref:`warnings filter <warning-filter>` will be test...
trusted_official_docs
CPython Docs
*message* must be a string and *category* a subclass of :exc:`Warning` or *message* may be a :exc:`Warning` instance, in which case *category* will be ignored. *module*, if supplied, should be the module name. If no module is passed, the module regular expression in :ref:`warnings filter <warning-filter>` will be test...
*message* must be a string and *category* a subclass of :exc:`Warning` or *message* may be a :exc:`Warning` instance, in which case *category* will be ignored. *module*, if supplied, should be the module name. If no module is passed, the module regular expression in :ref:`warnings filter <warning-filter>` will be test...
python, official-docs, cpython, P0
Local_Trusted_Corpus
00cb9f78-d996-4888-b153-e796ea8ca6c4
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,710
supabase-export-v2
fab0e8c8bea3a54a
Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is *not* an identity operation. .. method:: power(x, y, modulo=None)
trusted_official_docs
CPython Docs
Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is *not* an identity operation. .. method:: power(x, y, modulo=None)
Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is *not* an identity operation. .. method:: power(x, y, modulo=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
00cdd878-89ee-4dc3-bfd8-dc6d3b3836dd
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,865
supabase-export-v2
e4389b31fa3c15e2
>>> D = decimal.Decimal >>> D('1.23') + D('3.45') Decimal('4.68') Q: In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. Others are not supposed to have excess digits and need to be validated. What methods should be used?
trusted_official_docs
CPython Docs
>>> D = decimal.Decimal >>> D('1.23') + D('3.45') Decimal('4.68') Q: In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. Others are not supposed to have excess digits and need to be validated. What methods should be used?
>>> D = decimal.Decimal >>> D('1.23') + D('3.45') Decimal('4.68') Q: In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. Others are not supposed to have excess digits and need to be validated. What methods should be used?
python, official-docs, cpython, P0
Local_Trusted_Corpus
024938d4-77d3-4999-8922-73497eb15daf
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,889
supabase-export-v2
e357e915c8bedb58
Q: Is there a way to convert a regular float to a :class:`Decimal`? A: Yes, any binary floating-point number can be exactly expressed as a Decimal though an exact conversion may take more precision than intuition would suggest:
trusted_official_docs
CPython Docs
Q: Is there a way to convert a regular float to a :class:`Decimal`? A: Yes, any binary floating-point number can be exactly expressed as a Decimal though an exact conversion may take more precision than intuition would suggest:
Q: Is there a way to convert a regular float to a :class:`Decimal`? A: Yes, any binary floating-point number can be exactly expressed as a Decimal though an exact conversion may take more precision than intuition would suggest:
python, official-docs, cpython, P0
Local_Trusted_Corpus
02cb38c4-0406-4c40-853e-290beb71d194
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,854
supabase-export-v2
6283f55b09834f5a
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(cos(Decimal('0.5'))) 0.8775825618903727161162815826 >>> print(cos(0.5)) 0.87758256189 >>> print(cos(0.5+0j)) (0.87758256189+0j)
trusted_official_docs
CPython Docs
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(cos(Decimal('0.5'))) 0.8775825618903727161162815826 >>> print(cos(0.5)) 0.87758256189 >>> print(cos(0.5+0j)) (0.87758256189+0j)
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(cos(Decimal('0.5'))) 0.8775825618903727161162815826 >>> print(cos(0.5)) 0.87758256189 >>> print(cos(0.5+0j)) (0.87758256189+0j)
python, official-docs, cpython, P0
Local_Trusted_Corpus
069ef6b1-76db-43f5-bb70-db95018a40dc
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,390
supabase-export-v2
8ad3fb74668a87be
>>> (-7) % 4 1 >>> Decimal(-7) % Decimal(4) Decimal('-3') The integer division operator ``//`` behaves analogously, returning the integer part of the true quotient (truncating towards zero) rather than its floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::
trusted_official_docs
CPython Docs
>>> (-7) % 4 1 >>> Decimal(-7) % Decimal(4) Decimal('-3') The integer division operator ``//`` behaves analogously, returning the integer part of the true quotient (truncating towards zero) rather than its floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::
>>> (-7) % 4 1 >>> Decimal(-7) % Decimal(4) Decimal('-3') The integer division operator ``//`` behaves analogously, returning the integer part of the true quotient (truncating towards zero) rather than its floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::
python, official-docs, cpython, P0
Local_Trusted_Corpus
0985ad59-6c70-4c66-bff7-4a0ff2ad639f
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,826
supabase-export-v2
b45945f7cb6b0afc
``NaN`` were taken from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal.compare_signal` methods instead. The signed zeros can result from calculations that underflow. They keep the sign that would have resulted if the calcul...
trusted_official_docs
CPython Docs
``NaN`` were taken from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal.compare_signal` methods instead. The signed zeros can result from calculations that underflow. They keep the sign that would have resulted if the calcul...
``NaN`` were taken from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal.compare_signal` methods instead. The signed zeros can result from calculations that underflow. They keep the sign that would have resulted if the calcul...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a3827fc-8844-44c4-a1dd-5329695ee434
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,378
supabase-export-v2
5847de5928de0024
infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity numeric-string ::= [sign] numeric-value | [sign] nan Other Unicode decimal digits are also permitted where ``digit`` appears above. These include decimal digits from various other alphabe...
trusted_official_docs
CPython Docs
infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity numeric-string ::= [sign] numeric-value | [sign] nan Other Unicode decimal digits are also permitted where ``digit`` appears above. These include decimal digits from various other alphabe...
infinity ::= 'Infinity' | 'Inf' nan ::= 'NaN' [digits] | 'sNaN' [digits] numeric-value ::= decimal-part [exponent-part] | infinity numeric-string ::= [sign] numeric-value | [sign] nan Other Unicode decimal digits are also permitted where ``digit`` appears above. These include decimal digits from various other alphabe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0b449a7c-7995-4124-83a2-9afe8094f52b
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,882
supabase-export-v2
efdad51ad02053a3
precision than current context. Computations process with those exact inputs and then rounding (or other context operations) is applied to the *result* of the computation:: >>> getcontext().prec = 5 >>> pi = Decimal('3.1415926535') # More than 5 digits >>> pi # All digits are retained Decimal('3.1415926535') >>> pi...
trusted_official_docs
CPython Docs
precision than current context. Computations process with those exact inputs and then rounding (or other context operations) is applied to the *result* of the computation:: >>> getcontext().prec = 5 >>> pi = Decimal('3.1415926535') # More than 5 digits >>> pi # All digits are retained Decimal('3.1415926535') >>> pi...
precision than current context. Computations process with those exact inputs and then rounding (or other context operations) is applied to the *result* of the computation:: >>> getcontext().prec = 5 >>> pi = Decimal('3.1415926535') # More than 5 digits >>> pi # All digits are retained Decimal('3.1415926535') >>> pi...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0b9ef4c7-0967-4c5e-a126-ecc99dda7a41
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,906
supabase-export-v2
01b86e7a837ba534
precision arithmetic. :attr:`~Context.Emin` and :attr:`~Context.Emax` should always be set to the maximum values, :attr:`~Context.clamp` should always be 0 (the default). Setting :attr:`~Context.prec` requires some care. The easiest approach for trying out bignum arithmetic is to use the maximum value for :attr:`~Conte...
trusted_official_docs
CPython Docs
precision arithmetic. :attr:`~Context.Emin` and :attr:`~Context.Emax` should always be set to the maximum values, :attr:`~Context.clamp` should always be 0 (the default). Setting :attr:`~Context.prec` requires some care. The easiest approach for trying out bignum arithmetic is to use the maximum value for :attr:`~Conte...
precision arithmetic. :attr:`~Context.Emin` and :attr:`~Context.Emax` should always be set to the maximum values, :attr:`~Context.clamp` should always be 0 (the default). Setting :attr:`~Context.prec` requires some care. The easiest approach for trying out bignum arithmetic is to use the maximum value for :attr:`~Conte...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0d080f5d-8401-4114-9834-1cd813e3c9bb
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,412
supabase-export-v2
acbd072fdafe10ad
.. method:: compare_total(other, context=None) Compare two operands using their abstract representation rather than their numerical value. Similar to the :meth:`compare` method, but the result gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances with the same numeric value but differe...
trusted_official_docs
CPython Docs
.. method:: compare_total(other, context=None) Compare two operands using their abstract representation rather than their numerical value. Similar to the :meth:`compare` method, but the result gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances with the same numeric value but differe...
.. method:: compare_total(other, context=None) Compare two operands using their abstract representation rather than their numerical value. Similar to the :meth:`compare` method, but the result gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances with the same numeric value but differe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0d9029e2-5888-47d3-b7b6-f9190a0bf8e6
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,338
supabase-export-v2
4404b54ea520dcee
Decimal(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') >>> Decimal((0, (3, 1, 4), -2)) Decimal('3.14') >>> Decimal(str(2.0 ** 0.5)) Decimal('1.4142135623730951') >>> Decimal(2) ** Decimal('0.5') Decimal('1.414213562373095048801688724') >>> Decimal('NaN') Decimal('NaN') >>> Decimal('-Infinity') D...
trusted_official_docs
CPython Docs
Decimal(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') >>> Decimal((0, (3, 1, 4), -2)) Decimal('3.14') >>> Decimal(str(2.0 ** 0.5)) Decimal('1.4142135623730951') >>> Decimal(2) ** Decimal('0.5') Decimal('1.414213562373095048801688724') >>> Decimal('NaN') Decimal('NaN') >>> Decimal('-Infinity') D...
Decimal(3.14) Decimal('3.140000000000000124344978758017532527446746826171875') >>> Decimal((0, (3, 1, 4), -2)) Decimal('3.14') >>> Decimal(str(2.0 ** 0.5)) Decimal('1.4142135623730951') >>> Decimal(2) ** Decimal('0.5') Decimal('1.414213562373095048801688724') >>> Decimal('NaN') Decimal('NaN') >>> Decimal('-Infinity') D...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0ff9427e-93dd-4dea-b28e-44cc686ef706
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,874
supabase-export-v2
7b7011dcb3947675
# So does integer multiplication Decimal('4314.24') >>> (a * b).quantize(TWOPLACES) # Must quantize non-integer multiplication Decimal('325.62') >>> (b / a).quantize(TWOPLACES) # And quantize division Decimal('0.03') In developing fixed-point applications, it is convenient to define functions to handle the :meth:`~Deci...
trusted_official_docs
CPython Docs
# So does integer multiplication Decimal('4314.24') >>> (a * b).quantize(TWOPLACES) # Must quantize non-integer multiplication Decimal('325.62') >>> (b / a).quantize(TWOPLACES) # And quantize division Decimal('0.03') In developing fixed-point applications, it is convenient to define functions to handle the :meth:`~Deci...
# So does integer multiplication Decimal('4314.24') >>> (a * b).quantize(TWOPLACES) # Must quantize non-integer multiplication Decimal('325.62') >>> (b / a).quantize(TWOPLACES) # And quantize division Decimal('0.03') In developing fixed-point applications, it is convenient to define functions to handle the :meth:`~Deci...
python, official-docs, cpython, P0
Local_Trusted_Corpus
10a0d1ba-7a79-4f58-bb48-51b75beefb55
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,382
supabase-export-v2
1e363b06eaf80909
is determined exclusively by the number of digits in *value*. For example, ``Decimal('3.00000')`` records all five zeros even if the context precision is only three. The purpose of the *context* argument is determining what to do if *value* is a malformed string. If the context traps :const:`InvalidOperation`, an exce...
trusted_official_docs
CPython Docs
is determined exclusively by the number of digits in *value*. For example, ``Decimal('3.00000')`` records all five zeros even if the context precision is only three. The purpose of the *context* argument is determining what to do if *value* is a malformed string. If the context traps :const:`InvalidOperation`, an exce...
is determined exclusively by the number of digits in *value*. For example, ``Decimal('3.00000')`` records all five zeros even if the context precision is only three. The purpose of the *context* argument is determining what to do if *value* is a malformed string. If the context traps :const:`InvalidOperation`, an exce...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1148adb9-c597-42f9-839e-27c473953803
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,318
supabase-export-v2
8faa0c2018e295c4
zero, the differences prevent reliable equality testing and differences can accumulate. For this reason, decimal is preferred in accounting applications which have strict equality invariants. * The decimal module incorporates a notion of significant places so that ``1.30 + 1.20`` is ``2.50``. The trailing zero is kept...
trusted_official_docs
CPython Docs
zero, the differences prevent reliable equality testing and differences can accumulate. For this reason, decimal is preferred in accounting applications which have strict equality invariants. * The decimal module incorporates a notion of significant places so that ``1.30 + 1.20`` is ``2.50``. The trailing zero is kept...
zero, the differences prevent reliable equality testing and differences can accumulate. For this reason, decimal is preferred in accounting applications which have strict equality invariants. * The decimal module incorporates a notion of significant places so that ``1.30 + 1.20`` is ``2.50``. The trailing zero is kept...
python, official-docs, cpython, P0
Local_Trusted_Corpus
11501a8b-8934-4f7e-9ecc-1183134c9c98
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,877
supabase-export-v2
8b0f7016d85cc38b
>>> mul(a, b) # Automatically preserve fixed-point Decimal('325.62') >>> div(b, a) Decimal('0.03') Q: There are many ways to express the same value. The numbers ``200``, ``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various precisions. Is there a way to transform them to a single recognizable canonica...
trusted_official_docs
CPython Docs
>>> mul(a, b) # Automatically preserve fixed-point Decimal('325.62') >>> div(b, a) Decimal('0.03') Q: There are many ways to express the same value. The numbers ``200``, ``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various precisions. Is there a way to transform them to a single recognizable canonica...
>>> mul(a, b) # Automatically preserve fixed-point Decimal('325.62') >>> div(b, a) Decimal('0.03') Q: There are many ways to express the same value. The numbers ``200``, ``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various precisions. Is there a way to transform them to a single recognizable canonica...
python, official-docs, cpython, P0
Local_Trusted_Corpus
11cd14b3-b59b-420a-87f6-a7e9c9b2ff5e
CPython Docs
file://datasets/cpython/Doc/library/decimal.rst
unknown
7faf20f8-9cc8-43f8-9c7b-724dffea11bf
46,858
supabase-export-v2
58174c5b9dce6d13
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(sin(Decimal('0.5'))) 0.4794255386042030002732879352 >>> print(sin(0.5)) 0.479425538604 >>> print(sin(0.5+0j)) (0.479425538604+0j)
trusted_official_docs
CPython Docs
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(sin(Decimal('0.5'))) 0.4794255386042030002732879352 >>> print(sin(0.5)) 0.479425538604 >>> print(sin(0.5+0j)) (0.479425538604+0j)
The Taylor series approximation works best for a small value of x. For larger values, first compute x = x % (2 * pi). >>> print(sin(Decimal('0.5'))) 0.4794255386042030002732879352 >>> print(sin(0.5)) 0.479425538604 >>> print(sin(0.5+0j)) (0.479425538604+0j)
python, official-docs, cpython, P0
Local_Trusted_Corpus