Skip to content

Commit eac4912

Browse files
authored
Merge pull request #271 from python/master
Sync Fork from Upstream Repo
2 parents 0205f7c + 57c7a0b commit eac4912

File tree

99 files changed

+978
-206
lines changed

Some content is hidden

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

99 files changed

+978
-206
lines changed

Doc/c-api/arg.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ which disallows mutable objects such as :class:`bytearray`.
105105
Like ``s*``, but the Python object may also be ``None``, in which case the
106106
``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``.
107107

108-
``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \*, int]
108+
``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
109109
Like ``s#``, but the Python object may also be ``None``, in which case the C
110110
pointer is set to ``NULL``.
111111

@@ -124,7 +124,7 @@ which disallows mutable objects such as :class:`bytearray`.
124124
bytes-like objects. **This is the recommended way to accept
125125
binary data.**
126126

127-
``y#`` (read-only :term:`bytes-like object`) [const char \*, int]
127+
``y#`` (read-only :term:`bytes-like object`) [const char \*, int or :c:type:`Py_ssize_t`]
128128
This variant on ``s#`` doesn't accept Unicode objects, only bytes-like
129129
objects.
130130

@@ -155,7 +155,7 @@ which disallows mutable objects such as :class:`bytearray`.
155155
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
156156
:c:func:`PyUnicode_AsWideCharString`.
157157

158-
``u#`` (:class:`str`) [const Py_UNICODE \*, int]
158+
``u#`` (:class:`str`) [const Py_UNICODE \*, int or :c:type:`Py_ssize_t`]
159159
This variant on ``u`` stores into two C variables, the first one a pointer to a
160160
Unicode data buffer, the second one its length. This variant allows
161161
null code points.
@@ -172,7 +172,7 @@ which disallows mutable objects such as :class:`bytearray`.
172172
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
173173
:c:func:`PyUnicode_AsWideCharString`.
174174

175-
``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int]
175+
``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int or :c:type:`Py_ssize_t`]
176176
Like ``u#``, but the Python object may also be ``None``, in which case the
177177
:c:type:`Py_UNICODE` pointer is set to ``NULL``.
178178

@@ -213,7 +213,7 @@ which disallows mutable objects such as :class:`bytearray`.
213213
recoding them. Instead, the implementation assumes that the byte string object uses
214214
the encoding passed in as parameter.
215215

216-
``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, int \*buffer_length]
216+
``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, int or :c:type:`Py_ssize_t` \*buffer_length]
217217
This variant on ``s#`` is used for encoding Unicode into a character buffer.
218218
Unlike the ``es`` format, this variant allows input data which contains NUL
219219
characters.
@@ -244,7 +244,7 @@ which disallows mutable objects such as :class:`bytearray`.
244244
In both cases, *\*buffer_length* is set to the length of the encoded data
245245
without the trailing NUL byte.
246246

247-
``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer, int \*buffer_length]
247+
``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer, int or :c:type:`Py_ssize_t` \*buffer_length]
248248
Same as ``es#`` except that byte string objects are passed through without recoding
249249
them. Instead, the implementation assumes that the byte string object uses the
250250
encoding passed in as parameter.
@@ -549,7 +549,7 @@ Building values
549549
Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'``
550550
encoding. If the C string pointer is ``NULL``, ``None`` is used.
551551
552-
``s#`` (:class:`str` or ``None``) [const char \*, int]
552+
``s#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
553553
Convert a C string and its length to a Python :class:`str` object using ``'utf-8'``
554554
encoding. If the C string pointer is ``NULL``, the length is ignored and
555555
``None`` is returned.
@@ -558,30 +558,30 @@ Building values
558558
This converts a C string to a Python :class:`bytes` object. If the C
559559
string pointer is ``NULL``, ``None`` is returned.
560560
561-
``y#`` (:class:`bytes`) [const char \*, int]
561+
``y#`` (:class:`bytes`) [const char \*, int or :c:type:`Py_ssize_t`]
562562
This converts a C string and its lengths to a Python object. If the C
563563
string pointer is ``NULL``, ``None`` is returned.
564564
565565
``z`` (:class:`str` or ``None``) [const char \*]
566566
Same as ``s``.
567567
568-
``z#`` (:class:`str` or ``None``) [const char \*, int]
568+
``z#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
569569
Same as ``s#``.
570570
571571
``u`` (:class:`str`) [const wchar_t \*]
572572
Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
573573
data to a Python Unicode object. If the Unicode buffer pointer is ``NULL``,
574574
``None`` is returned.
575575
576-
``u#`` (:class:`str`) [const wchar_t \*, int]
576+
``u#`` (:class:`str`) [const wchar_t \*, int or :c:type:`Py_ssize_t`]
577577
Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python
578578
Unicode object. If the Unicode buffer pointer is ``NULL``, the length is ignored
579579
and ``None`` is returned.
580580
581581
``U`` (:class:`str` or ``None``) [const char \*]
582582
Same as ``s``.
583583
584-
``U#`` (:class:`str` or ``None``) [const char \*, int]
584+
``U#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t`]
585585
Same as ``s#``.
586586
587587
``i`` (:class:`int`) [int]

Include/patchlevel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#define PY_MINOR_VERSION 9
2121
#define PY_MICRO_VERSION 0
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
23-
#define PY_RELEASE_SERIAL 3
23+
#define PY_RELEASE_SERIAL 4
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.9.0a3+"
26+
#define PY_VERSION "3.9.0a4+"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

Lib/pydoc_data/topics.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Autogenerated by Sphinx on Fri Jan 24 22:03:37 2020
2+
# Autogenerated by Sphinx on Tue Feb 25 13:20:31 2020
33
topics = {'assert': 'The "assert" statement\n'
44
'**********************\n'
55
'\n'
@@ -5291,9 +5291,12 @@
52915291
'Changed in version 3.6: Added the "\'_\'" option (see also '
52925292
'**PEP 515**).\n'
52935293
'\n'
5294-
'*width* is a decimal integer defining the minimum field '
5295-
'width. If not\n'
5296-
'specified, then the field width will be determined by the '
5294+
'*width* is a decimal integer defining the minimum total '
5295+
'field width,\n'
5296+
'including any prefixes, separators, and other formatting '
5297+
'characters.\n'
5298+
'If not specified, then the field width will be determined '
5299+
'by the\n'
52975300
'content.\n'
52985301
'\n'
52995302
'When no explicit alignment is given, preceding the *width* '
@@ -9005,11 +9008,17 @@
90059008
'bases,\n'
90069009
'**kwds)" (where the additional keyword arguments, if any, '
90079010
'come from\n'
9008-
'the class definition).\n'
9011+
'the class definition). The "__prepare__" method should be '
9012+
'implemented\n'
9013+
'as a "classmethod()". The namespace returned by '
9014+
'"__prepare__" is\n'
9015+
'passed in to "__new__", but when the final class object is '
9016+
'created the\n'
9017+
'namespace is copied into a new "dict".\n'
90099018
'\n'
90109019
'If the metaclass has no "__prepare__" attribute, then the '
90119020
'class\n'
9012-
'namespace is initialised as an empty ordered mapping.\n'
9021+
'namespace is initialised as an empty "dict()".\n'
90139022
'\n'
90149023
'See also:\n'
90159024
'\n'

0 commit comments

Comments
 (0)