Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4717786

Browse files
committed
merge heads
2 parents bd04876 + ca7e5d3 commit 4717786

69 files changed

Lines changed: 1526 additions & 521 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ And here's an example of changing the counter:
583583

584584
Because ``yield`` will often be returning ``None``, you should always check for
585585
this case. Don't just use its value in expressions unless you're sure that the
586-
:meth:`~generator.send` method will be the only method used resume your
586+
:meth:`~generator.send` method will be the only method used to resume your
587587
generator function.
588588

589589
In addition to :meth:`~generator.send`, there are two other methods on

Doc/library/asyncio-eventloop.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,10 @@ Creating listening connections
311311

312312
.. method:: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None)
313313

314-
A :ref:`coroutine <coroutine>` method which creates a TCP server bound to
315-
host and port.
314+
Create a TCP server bound to host and port. Return an
315+
:class:`AbstractServer` object which can be used to stop the service.
316316

317-
The return value is a :class:`AbstractServer` object which can be used to stop
318-
the service.
317+
This method is a :ref:`coroutine <coroutine>`.
319318

320319
If *host* is an empty string or None all interfaces are assumed
321320
and a list of multiple sockets will be returned (most likely
@@ -588,10 +587,14 @@ Debug mode
588587

589588
Get the debug mode (:class:`bool`) of the event loop, ``False`` by default.
590589

590+
.. versionadded:: 3.4.2
591+
591592
.. method:: BaseEventLoop.set_debug(enabled: bool)
592593

593594
Set the debug mode of the event loop.
594595

596+
.. versionadded:: 3.4.2
597+
595598
.. seealso::
596599

597600
The :ref:`Develop with asyncio <asyncio-dev>` section.

Doc/library/asyncio-subprocess.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Create a subprocess: high-level API using Process
2222

2323
.. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
2424

25-
Run the shell command *cmd* given as a string. Return a :class:`~asyncio.subprocess.Process`
26-
instance.
25+
Run the shell command *cmd*. See :meth:`BaseEventLoop.subprocess_shell` for
26+
parameters. Return a :class:`~asyncio.subprocess.Process` instance.
2727

2828
The optional *limit* parameter sets the buffer limit passed to the
2929
:class:`StreamReader`.
@@ -32,7 +32,8 @@ Create a subprocess: high-level API using Process
3232

3333
.. function:: create_subprocess_exec(\*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
3434

35-
Create a subprocess. Return a :class:`~asyncio.subprocess.Process` instance.
35+
Create a subprocess. See :meth:`BaseEventLoop.subprocess_exec` for
36+
parameters. Return a :class:`~asyncio.subprocess.Process` instance.
3637

3738
The optional *limit* parameter sets the buffer limit passed to the
3839
:class:`StreamReader`.
@@ -50,7 +51,9 @@ Run subprocesses asynchronously using the :mod:`subprocess` module.
5051

5152
.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
5253

53-
Create a subprocess from one or more string arguments, where the first string
54+
Create a subprocess from one or more string arguments (character strings or
55+
bytes strings encoded to the :ref:`filesystem encoding
56+
<filesystem-encoding>`), where the first string
5457
specifies the program to execute, and the remaining strings specify the
5558
program's arguments. (Thus, together the string arguments form the
5659
``sys.argv`` value of the program, assuming it is a Python script.) This is
@@ -94,8 +97,9 @@ Run subprocesses asynchronously using the :mod:`subprocess` module.
9497

9598
.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
9699

97-
Create a subprocess from *cmd*, which is a string using the platform's
98-
"shell" syntax. This is similar to the standard library
100+
Create a subprocess from *cmd*, which is a character string or a bytes
101+
string encoded to the :ref:`filesystem encoding <filesystem-encoding>`,
102+
using the platform's "shell" syntax. This is similar to the standard library
99103
:class:`subprocess.Popen` class called with ``shell=True``.
100104

101105
See :meth:`~BaseEventLoop.subprocess_exec` for more details about

Doc/library/exceptions.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,10 @@ The following exceptions are the exceptions that are usually raised.
274274

275275
Raised when the result of an arithmetic operation is too large to be
276276
represented. This cannot occur for integers (which would rather raise
277-
:exc:`MemoryError` than give up). Because of the lack of standardization of
278-
floating point exception handling in C, most floating point operations also
279-
aren't checked.
277+
:exc:`MemoryError` than give up). However, for historical reasons,
278+
OverflowError is sometimes raised for integers that are outside a required
279+
range. Because of the lack of standardization of floating point exception
280+
handling in C, most floating point operations are not checked.
280281

281282

282283
.. exception:: ReferenceError

Doc/library/functions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ are always available. They are listed here in alphabetical order.
742742
.. function:: len(s)
743743

744744
Return the length (the number of items) of an object. The argument may be a
745-
sequence (string, tuple or list) or a mapping (dictionary).
745+
sequence (such as a string, bytes, tuple, list, or range) or a collection
746+
(such as a dictionary, set, or frozen set).
746747

747748

748749
.. _func-list:

Doc/library/inspect.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ attributes:
159159
| | | arguments and local |
160160
| | | variables |
161161
+-----------+-----------------+---------------------------+
162+
| generator | __name__ | name |
163+
+-----------+-----------------+---------------------------+
164+
| | __qualname__ | qualified name |
165+
+-----------+-----------------+---------------------------+
166+
| | gi_frame | frame |
167+
+-----------+-----------------+---------------------------+
168+
| | gi_running | is the generator running? |
169+
+-----------+-----------------+---------------------------+
170+
| | gi_code | code |
171+
+-----------+-----------------+---------------------------+
162172
| builtin | __doc__ | documentation string |
163173
+-----------+-----------------+---------------------------+
164174
| | __name__ | original name of this |
@@ -169,6 +179,12 @@ attributes:
169179
| | | ``None`` |
170180
+-----------+-----------------+---------------------------+
171181

182+
.. versionchanged:: 3.5
183+
184+
Add ``__qualname__`` attribute to generators. The ``__name__`` attribute of
185+
generators is now set from the function name, instead of the code name, and
186+
it can now be modified.
187+
172188

173189
.. function:: getmembers(object[, predicate])
174190

Doc/library/io.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ I/O Base Classes
353353
is usual for each of the lines provided to have a line separator at the
354354
end.
355355

356+
.. method:: __del__()
357+
358+
Prepare for object destruction. :class:`IOBase` provides a default
359+
implementation of this method that calls the instance's
360+
:meth:`~IOBase.close` method.
361+
356362

357363
.. class:: RawIOBase
358364

Doc/library/os.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Notes on the availability of these functions:
6565

6666

6767
.. _os-filenames:
68+
.. _filesystem-encoding:
6869

6970
File Names, Command Line Arguments, and Environment Variables
7071
-------------------------------------------------------------
@@ -1094,7 +1095,8 @@ or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Window
10941095

10951096
.. note::
10961097

1097-
For a higher-level version of this see :mod:`socket.socket.sendfile`.
1098+
For a higher-level wrapper of :func:`sendfile`, see
1099+
:mod:`socket.socket.sendfile`.
10981100

10991101
.. versionadded:: 3.3
11001102

@@ -1903,6 +1905,11 @@ features:
19031905
* :attr:`st_creator`
19041906
* :attr:`st_type`
19051907

1908+
On Windows systems, the following attribute is also available:
1909+
1910+
* :attr:`st_file_attributes` - Windows file attribute bits (see the
1911+
``FILE_ATTRIBUTE_*`` constants in the :mod:`stat` module)
1912+
19061913
.. note::
19071914

19081915
The exact meaning and resolution of the :attr:`st_atime`,
@@ -1956,6 +1963,9 @@ features:
19561963
and the :attr:`st_atime_ns`, :attr:`st_mtime_ns`,
19571964
and :attr:`st_ctime_ns` members.
19581965

1966+
.. versionadded:: 3.5
1967+
Added the :attr:`st_file_attributes` member on Windows.
1968+
19591969

19601970
.. function:: stat_float_times([newvalue])
19611971

@@ -2235,9 +2245,11 @@ features:
22352245

22362246
If optional argument *topdown* is ``True`` or not specified, the triple for a
22372247
directory is generated before the triples for any of its subdirectories
2238-
(directories are generated top-down). If *topdown* is ``False``, the triple for a
2239-
directory is generated after the triples for all of its subdirectories
2240-
(directories are generated bottom-up).
2248+
(directories are generated top-down). If *topdown* is ``False``, the triple
2249+
for a directory is generated after the triples for all of its subdirectories
2250+
(directories are generated bottom-up). No matter the value of *topdown*, the
2251+
list of subdirectories is retrieved before the tuples for the directory and
2252+
its subdirectories are generated.
22412253

22422254
When *topdown* is ``True``, the caller can modify the *dirnames* list in-place
22432255
(perhaps using :keyword:`del` or slice assignment), and :func:`walk` will only

Doc/library/ossaudiodev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ The remaining methods are specific to audio mixing:
407407
(silent) to 100 (full volume). If the control is monophonic, a 2-tuple is still
408408
returned, but both volumes are the same.
409409

410-
Raises :exc:`OSSAudioError` if an invalid control was is specified, or
410+
Raises :exc:`OSSAudioError` if an invalid control is specified, or
411411
:exc:`OSError` if an unsupported control is specified.
412412

413413

Doc/library/re.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ form.
458458
.. function:: compile(pattern, flags=0)
459459

460460
Compile a regular expression pattern into a regular expression object, which
461-
can be used for matching using its :func:`match` and :func:`search` methods,
462-
described below.
461+
can be used for matching using its :func:`~regex.match` and
462+
:func:`~regex.search` methods, described below.
463463

464464
The expression's behaviour can be modified by specifying a *flags* value.
465465
Values can be any of the following variables, combined using bitwise OR (the

0 commit comments

Comments
 (0)