Skip to content

Commit

Permalink
Deploying to gh-pages from @ 80d2f31 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwang44 committed Feb 6, 2024
1 parent c035635 commit 4c1f160
Show file tree
Hide file tree
Showing 568 changed files with 5,975 additions and 5,928 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a68d8f173f8c6fb415ffea49c531dde2
config: 43b899311a5cc26111d9494a9d011c38
tags: 645f666f9bcd5a90fca523b33c5a78b7
9 changes: 7 additions & 2 deletions _sources/c-api/file.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ the :mod:`io` APIs instead.
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
through the provided handler.
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
The handler is a function of type:
.. c:type:: Py_OpenCodeHookFunction
Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be
:c:type:`PyUnicodeObject`.
The *userData* pointer is passed into the hook function. Since hook
functions may be called from different runtimes, this pointer should not
Expand Down
16 changes: 2 additions & 14 deletions _sources/c-api/import.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,8 @@ Importing Modules
single: __all__ (package variable)
single: modules (in module sys)
This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below,
leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set
to 0. When the *name*
argument contains a dot (when it specifies a submodule of a package), the
*fromlist* argument is set to the list ``['*']`` so that the return value is the
named module rather than the top-level package containing it as would otherwise
be the case. (Unfortunately, this has an additional side effect when *name* in
fact specifies a subpackage instead of a submodule: the submodules specified in
the package's ``__all__`` variable are loaded.) Return a new reference to the
imported module, or ``NULL`` with an exception set on failure. A failing
import of a module doesn't leave the module in :data:`sys.modules`.
This function always uses absolute imports.
This is a wrapper around :c:func:`PyImport_Import()` which takes a
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
Expand Down
13 changes: 13 additions & 0 deletions _sources/c-api/memoryview.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ any other object.
read/write, otherwise it may be either read-only or read/write at the
discretion of the exporter.
.. c:macro:: PyBUF_READ
Flag to request a readonly buffer.
.. c:macro:: PyBUF_WRITE
Flag to request a writable buffer.
.. c:function:: PyObject *PyMemoryView_FromMemory(char *mem, Py_ssize_t size, int flags)
Create a memoryview object using *mem* as the underlying buffer.
Expand All @@ -41,6 +52,8 @@ any other object.
original memory. Otherwise, a copy is made and the memoryview points to a
new bytes object.
*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`.
.. c:function:: int PyMemoryView_Check(PyObject *obj)
Expand Down
8 changes: 8 additions & 0 deletions _sources/c-api/object.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Object Protocol
to NotImplemented and return it).


.. c:macro:: Py_PRINT_RAW
Flag to be used with multiple functions that print the object (like
:c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
If passed, these function would use the :func:`str` of the object
instead of the :func:`repr`.


.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
Expand Down
8 changes: 5 additions & 3 deletions _sources/glossary.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Glossary
docstring
A string literal which appears as the first expression in a class,
function or module. While ignored when the suite is executed, it is
recognized by the compiler and put into the :attr:`__doc__` attribute
recognized by the compiler and put into the :attr:`!__doc__` attribute
of the enclosing class, function or module. Since it is available via
introspection, it is the canonical place for documentation of the
object.
Expand Down Expand Up @@ -1103,10 +1103,12 @@ Glossary
The :class:`collections.abc.Sequence` abstract base class
defines a much richer interface that goes beyond just
:meth:`~object.__getitem__` and :meth:`~object.__len__`, adding
:meth:`count`, :meth:`index`, :meth:`~object.__contains__`, and
:meth:`!count`, :meth:`!index`, :meth:`~object.__contains__`, and
:meth:`~object.__reversed__`. Types that implement this expanded
interface can be registered explicitly using
:func:`~abc.ABCMeta.register`.
:func:`~abc.ABCMeta.register`. For more documentation on sequence
methods generally, see
:ref:`Common Sequence Operations <typesseq-common>`.

set comprehension
A compact way to process all or part of the elements in an iterable and
Expand Down
25 changes: 11 additions & 14 deletions _sources/howto/logging-cookbook.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1933,30 +1933,28 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration

LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
'style': '{',
},
'simple': {
'format': '%(levelname)s %(message)s'
'format': '{levelname} {message}',
'style': '{',
},
},
'filters': {
'special': {
'()': 'project.logging.SpecialFilter',
'foo': 'bar',
}
},
},
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'simple',
},
'mail_admins': {
'level': 'ERROR',
Expand All @@ -1966,9 +1964,8 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
},
'loggers': {
'django': {
'handlers':['null'],
'handlers': ['console'],
'propagate': True,
'level':'INFO',
},
'django.request': {
'handlers': ['mail_admins'],
Expand Down
43 changes: 22 additions & 21 deletions _sources/howto/logging.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ custom handlers) are the following configuration methods:

* The :meth:`~Handler.setLevel` method, just as in logger objects, specifies the
lowest severity that will be dispatched to the appropriate destination. Why
are there two :func:`setLevel` methods? The level set in the logger
are there two :meth:`~Handler.setLevel` methods? The level set in the logger
determines which severity of messages it will pass to its handlers. The level
set in each handler determines which messages that handler will send on.

Expand Down Expand Up @@ -775,29 +775,29 @@ What happens if no configuration is provided

If no logging configuration is provided, it is possible to have a situation
where a logging event needs to be output, but no handlers can be found to
output the event. The behaviour of the logging package in these
circumstances is dependent on the Python version.
output the event.

For versions of Python prior to 3.2, the behaviour is as follows:
The event is output using a 'handler of last resort', stored in
:data:`lastResort`. This internal handler is not associated with any
logger, and acts like a :class:`~logging.StreamHandler` which writes the
event description message to the current value of ``sys.stderr`` (therefore
respecting any redirections which may be in effect). No formatting is
done on the message - just the bare event description message is printed.
The handler's level is set to ``WARNING``, so all events at this and
greater severities will be output.

* If *logging.raiseExceptions* is ``False`` (production mode), the event is
silently dropped.
.. versionchanged:: 3.2

* If *logging.raiseExceptions* is ``True`` (development mode), a message
'No handlers could be found for logger X.Y.Z' is printed once.
For versions of Python prior to 3.2, the behaviour is as follows:

In Python 3.2 and later, the behaviour is as follows:
* If :data:`raiseExceptions` is ``False`` (production mode), the event is
silently dropped.

* The event is output using a 'handler of last resort', stored in
``logging.lastResort``. This internal handler is not associated with any
logger, and acts like a :class:`~logging.StreamHandler` which writes the
event description message to the current value of ``sys.stderr`` (therefore
respecting any redirections which may be in effect). No formatting is
done on the message - just the bare event description message is printed.
The handler's level is set to ``WARNING``, so all events at this and
greater severities will be output.
* If :data:`raiseExceptions` is ``True`` (development mode), a message
'No handlers could be found for logger X.Y.Z' is printed once.

To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to ``None``.
To obtain the pre-3.2 behaviour,
:data:`lastResort` can be set to ``None``.

.. _library-config:

Expand Down Expand Up @@ -999,7 +999,7 @@ Logged messages are formatted for presentation through instances of the
use with the % operator and a dictionary.

For formatting multiple messages in a batch, instances of
:class:`~handlers.BufferingFormatter` can be used. In addition to the format
:class:`BufferingFormatter` can be used. In addition to the format
string (which is applied to each message in the batch), there is provision for
header and trailer format strings.

Expand Down Expand Up @@ -1035,7 +1035,8 @@ checks to see if a module-level variable, :data:`raiseExceptions`, is set. If
set, a traceback is printed to :data:`sys.stderr`. If not set, the exception is
swallowed.

.. note:: The default value of :data:`raiseExceptions` is ``True``. This is
.. note::
The default value of :data:`raiseExceptions` is ``True``. This is
because during development, you typically want to be notified of any
exceptions that occur. It's advised that you set :data:`raiseExceptions` to
``False`` for production usage.
Expand Down Expand Up @@ -1073,7 +1074,7 @@ You can write code like this::
expensive_func2())

so that if the logger's threshold is set above ``DEBUG``, the calls to
:func:`expensive_func1` and :func:`expensive_func2` are never made.
``expensive_func1`` and ``expensive_func2`` are never made.

.. note:: In some cases, :meth:`~Logger.isEnabledFor` can itself be more
expensive than you'd like (e.g. for deeply nested loggers where an explicit
Expand Down
98 changes: 56 additions & 42 deletions _sources/library/__future__.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,68 @@

--------------

:mod:`__future__` is a real module, and serves three purposes:
Imports of the form ``from __future__ import feature`` are called
:ref:`future statements <future>`. These are special-cased by the Python compiler
to allow the use of new Python features in modules containing the future statement
before the release in which the feature becomes standard.

While these future statements are given additional special meaning by the
Python compiler, they are still executed like any other import statement and
the :mod:`__future__` exists and is handled by the import system the same way
any other Python module would be. This design serves three purposes:

* To avoid confusing existing tools that analyze import statements and expect to
find the modules they're importing.

* To ensure that :ref:`future statements <future>` run under releases prior to
2.1 at least yield runtime exceptions (the import of :mod:`__future__` will
fail, because there was no module of that name prior to 2.1).

* To document when incompatible changes were introduced, and when they will be
--- or were --- made mandatory. This is a form of executable documentation, and
can be inspected programmatically via importing :mod:`__future__` and examining
its contents.

* To ensure that :ref:`future statements <future>` run under releases prior to
Python 2.1 at least yield runtime exceptions (the import of :mod:`__future__`
will fail, because there was no module of that name prior to 2.1).

Module Contents
---------------

No feature description will ever be deleted from :mod:`__future__`. Since its
introduction in Python 2.1 the following features have found their way into the
language using this mechanism:

+------------------+-------------+--------------+---------------------------------------------+
| feature | optional in | mandatory in | effect |
+==================+=============+==============+=============================================+
| nested_scopes | 2.1.0b1 | 2.2 | :pep:`227`: |
| | | | *Statically Nested Scopes* |
+------------------+-------------+--------------+---------------------------------------------+
| generators | 2.2.0a1 | 2.3 | :pep:`255`: |
| | | | *Simple Generators* |
+------------------+-------------+--------------+---------------------------------------------+
| division | 2.2.0a2 | 3.0 | :pep:`238`: |
| | | | *Changing the Division Operator* |
+------------------+-------------+--------------+---------------------------------------------+
| absolute_import | 2.5.0a1 | 3.0 | :pep:`328`: |
| | | | *Imports: Multi-Line and Absolute/Relative* |
+------------------+-------------+--------------+---------------------------------------------+
| with_statement | 2.5.0a1 | 2.6 | :pep:`343`: |
| | | | *The "with" Statement* |
+------------------+-------------+--------------+---------------------------------------------+
| print_function | 2.6.0a2 | 3.0 | :pep:`3105`: |
| | | | *Make print a function* |
+------------------+-------------+--------------+---------------------------------------------+
| unicode_literals | 2.6.0a2 | 3.0 | :pep:`3112`: |
| | | | *Bytes literals in Python 3000* |
+------------------+-------------+--------------+---------------------------------------------+
| generator_stop | 3.5.0b1 | 3.7 | :pep:`479`: |
| | | | *StopIteration handling inside generators* |
+------------------+-------------+--------------+---------------------------------------------+
| annotations | 3.7.0b1 | TBD [1]_ | :pep:`563`: |
| | | | *Postponed evaluation of annotations* |
+------------------+-------------+--------------+---------------------------------------------+

.. XXX Adding a new entry? Remember to update simple_stmts.rst, too.
.. _future-classes:

.. class:: _Feature
Expand Down Expand Up @@ -65,43 +113,6 @@
dynamically compiled code. This flag is stored in the :attr:`_Feature.compiler_flag`
attribute on :class:`_Feature` instances.

No feature description will ever be deleted from :mod:`__future__`. Since its
introduction in Python 2.1 the following features have found their way into the
language using this mechanism:

+------------------+-------------+--------------+---------------------------------------------+
| feature | optional in | mandatory in | effect |
+==================+=============+==============+=============================================+
| nested_scopes | 2.1.0b1 | 2.2 | :pep:`227`: |
| | | | *Statically Nested Scopes* |
+------------------+-------------+--------------+---------------------------------------------+
| generators | 2.2.0a1 | 2.3 | :pep:`255`: |
| | | | *Simple Generators* |
+------------------+-------------+--------------+---------------------------------------------+
| division | 2.2.0a2 | 3.0 | :pep:`238`: |
| | | | *Changing the Division Operator* |
+------------------+-------------+--------------+---------------------------------------------+
| absolute_import | 2.5.0a1 | 3.0 | :pep:`328`: |
| | | | *Imports: Multi-Line and Absolute/Relative* |
+------------------+-------------+--------------+---------------------------------------------+
| with_statement | 2.5.0a1 | 2.6 | :pep:`343`: |
| | | | *The "with" Statement* |
+------------------+-------------+--------------+---------------------------------------------+
| print_function | 2.6.0a2 | 3.0 | :pep:`3105`: |
| | | | *Make print a function* |
+------------------+-------------+--------------+---------------------------------------------+
| unicode_literals | 2.6.0a2 | 3.0 | :pep:`3112`: |
| | | | *Bytes literals in Python 3000* |
+------------------+-------------+--------------+---------------------------------------------+
| generator_stop | 3.5.0b1 | 3.7 | :pep:`479`: |
| | | | *StopIteration handling inside generators* |
+------------------+-------------+--------------+---------------------------------------------+
| annotations | 3.7.0b1 | TBD [1]_ | :pep:`563`: |
| | | | *Postponed evaluation of annotations* |
+------------------+-------------+--------------+---------------------------------------------+

.. XXX Adding a new entry? Remember to update simple_stmts.rst, too.
.. [1]
``from __future__ import annotations`` was previously scheduled to
become mandatory in Python 3.10, but the Python Steering Council
Expand All @@ -115,3 +126,6 @@ language using this mechanism:

:ref:`future`
How the compiler treats future imports.

:pep:`236` - Back to the __future__
The original proposal for the __future__ mechanism.
4 changes: 2 additions & 2 deletions _sources/library/collections.abc.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ ABC Inherits from Abstract Methods Mi
:class:`Collection` ``__len__`` ``index``, and ``count``

:class:`MutableSequence` :class:`Sequence` ``__getitem__``, Inherited :class:`Sequence` methods and
``__setitem__``, ``append``, ``reverse``, ``extend``, ``pop``,
``__delitem__``, ``remove``, and ``__iadd__``
``__setitem__``, ``append``, ``clear``, ``reverse``, ``extend``,
``__delitem__``, ``pop``, ``remove``, and ``__iadd__``
``__len__``,
``insert``

Expand Down
Loading

0 comments on commit 4c1f160

Please sign in to comment.