8000 gh-129667: Update annotation in documentation by donBarbos · Pull Request #129669 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-129667: Update annotation in documentation #129669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build applications which provide an interactive interpreter prompt.
``'__console__'`` and key ``'__doc__'`` set to ``None``.


.. class:: InteractiveConsole(locals=None, filename="<console>", local_exit=False)
.. class:: InteractiveConsole(locals=None, filename="<console>", *, local_exit=False)

Closely emulate the behavior of the interactive Python interpreter. This class
builds on :class:`InteractiveInterpreter` and adds prompting using the familiar
Expand Down Expand Up @@ -112,7 +112,7 @@ Interactive Interpreter Objects
with it.


.. method:: InteractiveInterpreter.showsyntaxerror(filename=None)
.. method:: InteractiveInterpreter.showsyntaxerror(filename=None, **kwargs)

Display the syntax error that just occurred. This does not display a stack
trace because there isn't one for syntax errors. If *filename* is given, it is
Expand Down Expand Up @@ -166,7 +166,7 @@ interpreter objects as well as the following additions.
Print an exit message when exiting.


.. method:: InteractiveConsole.push(line)
.. method:: InteractiveConsole.push(line, filename=None, _symbol="single")

Push a line of source text to the interpreter. The line should not have a
trailing newline; it may have internal newlines. The line is appended to a
Expand Down
20 changes: 10 additions & 10 deletions Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ any codec:

The full details for each codec can also be looked up directly:

.. function:: lookup(encoding)
.. function:: lookup(encoding, /)

Looks up the codec info in the Python codec registry and returns a
:class:`CodecInfo` object as defined below.
Expand All @@ -65,7 +65,7 @@ The full details for each codec can also be looked up directly:
found, a :exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object
is stored in the cache and returned to the caller.

.. class:: CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None)
.. class:: CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None, *, _is_text_encoding=None)

Codec details when looking up the codec registry. The constructor
arguments are stored in attributes of the same name:
Expand Down Expand Up @@ -156,7 +156,7 @@ these additional functions which use :func:`lookup` for the codec lookup:
Custom codecs are made available by registering a suitable codec search
function:

.. function:: register(search_function)
.. function:: register(search_function, /)

Register a codec search function. Search functions are expected to take one
argument, being the encoding name in all lower case letters with hyphens
Expand All @@ -168,7 +168,7 @@ function:
Hyphens and spaces are converted to underscore.


.. function:: unregister(search_function)
.. function:: unregister(search_function, /)

Unregister a codec search function and clear the registry's cache.
If the search function is not registered, do nothing.
Expand Down Expand Up @@ -416,7 +416,7 @@ In addition, the following error handler is specific to the given codecs:
The set of allowed values can be extended by registering a new named error
handler:

.. function:: register_error(name, error_handler)
.. function:: register_error(name, error_handler, /)

Register the error handling function *error_handler* under the name *name*.
The *error_handler* argument will be called during encoding and decoding
Expand All @@ -442,7 +442,7 @@ handler:
Previously registered error handlers (including the standard error handlers)
can be looked up by name:

.. function:: lookup_error(name)
.. function:: lookup_error(name, /)

Return the error handler previously registered under the name *name*.

Expand Down Expand Up @@ -607,9 +607,9 @@ define in order to be compatible with the Python codec registry.
object.


.. method:: encode(object, final=False)
.. method:: encode(input, final=False)

Encodes *object* (taking the current state of the encoder into account)
Encodes *input* (taking the current state of the encoder into account)
and returns the resulting encoded object. If this is the last call to
:meth:`encode` *final* must be true (the default is false).

Expand Down Expand Up @@ -664,9 +664,9 @@ define in order to be compatible with the Python codec registry.
object.


.. method:: decode(object, final=False)
.. method:: decode(input, final=False)

Decodes *object* (taking the current state of the decoder into account)
Decodes *input* (taking the current state of the decoder into account)
and returns the resulting decoded object. If this is the last call to
:meth:`decode` *final* must be true (the default is false). If *final* is
true the decoder must decode the input completely and must flush all
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/concurrent.futures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ And::
executor.submit(wait_on_future)


.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=())
.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=(), **ctxkwargs)

An :class:`Executor` subclass that uses a pool of at most *max_workers*
threads to execute calls asynchronously.
Expand Down
12 changes: 6 additions & 6 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1229,14 +1229,14 @@ ConfigParser Objects
interpolation.


.. method:: set(section, option, value)
.. method:: set(section, option, value=None)

If the given section exists, set the given option to the specified value;
otherwise raise :exc:`NoSectionError`. *option* and *value* must be
strings; if not, :exc:`TypeError` is raised.


.. method:: write(fileobject, space_around_delimiters=True)
.. method:: write(fp, space_around_delimiters=True)

Write a representation of the configuration to the specified :term:`file
object`, which must be opened in text mode (accepting strings). This
Expand Down Expand Up @@ -1266,12 +1266,12 @@ ConfigParser Objects
fact existed, return ``True``. Otherwise return ``False``.


.. method:: optionxform(option)
.. method:: optionxform(optionstr)

Transforms the option name *option* as found in an input file or as passed
Transforms the option name *optionstr* as found in an input file or as passed
in by client code to the form that should be used in the internal
structures. The default implementation returns a lower-case version of
*option*; subclasses may override this or client code can set an attribute
*optionstr*; subclasses may override this or client code can set an attribute
of this name on instances to affect this behavior.

You don't need to subclass the parser to use this method, you can also
Expand Down Expand Up @@ -1354,7 +1354,7 @@ RawConfigParser Objects
Added support for :const:`UNNAMED_SECTION`.


.. method:: set(section, option, value)
.. method:: set(section, option, value=None)

If the given section exists, set the given option to the specified value;
otherwise raise :exc:`NoSectionError`. While it is possible to use
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ directly specified in the :class:`!InventoryItem` definition shown above.
Module contents
---------------

.. decorator:: dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False)
.. decorator:: dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False)

This function is a :term:`decorator` that is used to add generated
:term:`special methods <special method>` to classes, as described below.
Expand Down
Loading
Loading
0