Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
donBarbos wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
fromdonBarbos:issue-129667
Open
Show file tree
Hide file tree
Changes fromall 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
4 changes: 2 additions & 2 deletionsDoc/library/code.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -112,7 +112,7 @@ Interactive Interpreter Objects
with it.


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't really know whatkwargs means here so I would appreciate that it's documented in a separate PR as well.


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 DownExpand 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think we should have a separate PR for re-documentingInteractiveConsole methods. In addition, I'm still unsure whether private parameters should be exposed or not. Personally, I would rather prefer not having them exposed but if subclasses need to override the method, I think their signature should then be compatible. Note thathttps://github.com/python/typeshed/blob/1c17cd429c2f91b0066547deb99c537af3e54d39/stdlib/code.pyi#L23-L37 doesnot expose this private parameter, so I think we shouldn't as well (and let this inconsistency with the signature remain; mypy wouldn't complain as typeshed also doesn't specify it.

Finally,filename seems to be only 3.13+ so we should also be careful with the backports (therefore I'd prefer having a separate PR forInteractiveConsole)

donBarbos reacted with thumbs up emoji

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
8 changes: 4 additions & 4 deletionsDoc/library/codecs.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
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 DownExpand 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
6 changes: 5 additions & 1 deletionDoc/library/concurrent.futures.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -194,6 +194,10 @@ And::
Default value of *max_workers* is changed to
``min(32, (os.process_cpu_count() or 1) + 4)``.

.. versionchanged:: next
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's not "next" as this was added in a previous release (just find the major.minor version where it was added, I think it's still 3.14)

Added *ctxkwargs* to pass additional arguments to ``cls.prepare_context``
class method.


.. _threadpoolexecutor-example:

Expand Down
12 changes: 6 additions & 6 deletionsDoc/library/configparser.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 DownExpand 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
4 changes: 2 additions & 2 deletionsDoc/library/enum.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -196,9 +196,9 @@ Data Types
:start: The first integer value for the Enum (used by :class:`auto`).
:boundary: How to handle out-of-range values from bit operations (:class:`Flag` only).

.. method:: EnumType.__contains__(cls,member)
.. method:: EnumType.__contains__(cls,value)

Returns ``True`` ifmember belongs to the ``cls``::
Returns ``True`` ifvalue belongs to the ``cls``::

>>> some_var = Color.RED
>>> some_var in Color
Expand Down
10 changes: 6 additions & 4 deletionsDoc/library/http.server.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,14 +34,16 @@ handler. Code to create and run the server looks like this::
httpd.serve_forever()


.. class:: HTTPServer(server_address, RequestHandlerClass)
.. class:: HTTPServer(server_address, RequestHandlerClass, \
bind_and_activate=True)

This class builds on the :class:`~socketserver.TCPServer` class by storing
the server address as instance variables named :attr:`server_name` and
:attr:`server_port`. The server is accessible by the handler, typically
through the handler's :attr:`server` instance variable.

.. class:: ThreadingHTTPServer(server_address, RequestHandlerClass)
.. class:: ThreadingHTTPServer(server_address, RequestHandlerClass, \
bind_and_activate=True)

This class is identical to HTTPServer but uses threads to handle
requests by using the :class:`~socketserver.ThreadingMixIn`. This
Expand DownExpand Up@@ -281,14 +283,14 @@ provides three different variants:
HTTP code associated with the response. If a size of the response is
available, then it should be passed as the *size* parameter.

.. method:: log_error(...)
.. method:: log_error(format, *args)

Logs an error when a request cannot be fulfilled. By default, it passes
the message to :meth:`log_message`, so it takes the same arguments
(*format* and additional values).


.. method:: log_message(format,...)
.. method:: log_message(format,*args)

Logs an arbitrary message to ``sys.stderr``. This is typically overridden
to create custom error logging mechanisms. The *format* argument is a
Expand Down
2 changes: 1 addition & 1 deletionLib/configparser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -134,7 +134,7 @@
remove_option(section, option)
Remove the given option from the given section.

set(section, option, value)
set(section, option, value=None)
Set the given option.

write(fp, space_around_delimiters=True)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp