Skip to content
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

bpo-16575: Add checks for unions passed by value to functions. #16430

Closed
wants to merge 149 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
3796a4c
bpo-16575: Add checks for unions passed by value to functions.
vsajip Sep 26, 2019
f6f496a
Updated the logic for propagation of flags.
vsajip Sep 26, 2019
dc31b8f
Corrected typos in test.
vsajip Sep 26, 2019
b92f55a
Removed debugging code.
vsajip Sep 26, 2019
01ba08e
Improved tests.
vsajip Sep 26, 2019
0bcbfa4
bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672)
aixtools Sep 26, 2019
6ce03ec
cleanup ababstractproperty in typing.py (GH-16432)
hongweipeng Sep 27, 2019
5faff97
bpo-38206: Clarify tp_dealloc requirements for heap allocated types. …
ammaraskar Sep 27, 2019
9055815
bpo-38270: More fixes for strict crypto policy (GH-16418)
tiran Sep 27, 2019
6693f73
bpo-38187: Fix a refleak in Tools/c-analyzer. (gh-16304)
ericsnowcurrently Sep 27, 2019
5d6f5b6
bpo-32820: Simplify __format__ implementation for ipaddress. (GH-16378)
serhiy-storchaka Sep 27, 2019
dd6117c
Fix typo in the "Porting to Python 3.8" section. (GH-16435)
bariod Sep 27, 2019
e8650a4
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
corona10 Sep 27, 2019
52d1b86
bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (…
jcea Sep 28, 2019
441b10c
bpo-38304: Add PyConfig.struct_size (GH-16451)
vstinner Sep 28, 2019
7774d78
bpo-38216, bpo-36274: Allow subclasses to separately override validat…
jaraco Sep 28, 2019
c816503
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)
Yhg1s Sep 28, 2019
c5a7e0c
bpo-37408: Precise that Tarfile "format" argument only concerns writi…
pakal Sep 28, 2019
f185a73
bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (G…
brandtbucher Sep 29, 2019
9a7d951
bpo-38108: Makes mock objects inherit from Base (GH-16060)
lisroach Sep 29, 2019
58498bc
bpo-38019: correctly handle pause/resume reading of closed asyncio un…
asvetlov Sep 29, 2019
fb4ae15
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
vstinner Sep 29, 2019
25e115e
bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443)
lisroach Sep 30, 2019
5bcc6d8
bpo-37096: Add large-file tests for modules using sendfile(2) (GH-13676)
giampaolo Sep 30, 2019
3667e1e
bpo-38163: Child mocks detect their type as sync or async (GH-16471)
lisroach Sep 30, 2019
6758e6e
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
1st1 Sep 30, 2019
fc4a044
bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in pa…
1st1 Sep 30, 2019
89f8177
bpo-38304: Fix PyConfig usage in python_uwp.cpp (GH-16487)
vstinner Sep 30, 2019
dec3971
bpo-38322: Fix gotlandmark() of PC/getpathp.c (GH-16489)
vstinner Sep 30, 2019
efe74b6
bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)
vstinner Sep 30, 2019
c9a413e
bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)
vstinner Sep 30, 2019
bcda460
Clear weakrefs in garbage found by the GC (#16495)
nascheme Sep 30, 2019
aca8c40
bpo-38321: Fix _testcapimodule.c warning (GH-16494)
vstinner Sep 30, 2019
e407013
Fix and improve `asyncio.run()` docs (GH-16403)
aeros Oct 1, 2019
cf57cab
bpo-32689: Updates shutil.move to allow for Path objects to be used a…
maxwellmckinnon Oct 1, 2019
94e1650
bpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block …
giampaolo Oct 1, 2019
3c30a76
bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)
vstinner Oct 1, 2019
8462a49
bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)
vstinner Oct 1, 2019
982bfa4
bpo-36670: Multiple regrtest bugfixes (GH-16511)
vstinner Oct 1, 2019
2f90261
bpo-38321: Fix compiler warning in _randommodule.c (GH-16512)
vstinner Oct 1, 2019
5e0ea75
bpo-37474: Don't call fedisableexcept() on FreeBSD (GH-16515)
vstinner Oct 1, 2019
6314abc
bpo-37802: Fix a compiler warning in longobject.c (GH-16517)
vstinner Oct 1, 2019
b9a8b82
bpo-38343: Fixes version handling for nuget packages (GH-16527)
zooba Oct 1, 2019
2ea71a0
bpo-36670: regrtest bug fixes (GH-16537)
vstinner Oct 2, 2019
b3e7045
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
vstinner Oct 2, 2019
61691d8
bpo-38353: Cleanup includes in the internal C API (GH-16548)
vstinner Oct 2, 2019
3e04cd2
bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16…
vstinner Oct 2, 2019
c65119d
bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553)
vstinner Oct 3, 2019
098e256
bpo-36670: Enhance regrtest (GH-16556)
vstinner Oct 3, 2019
a0e3d27
bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)
zooba Oct 3, 2019
353fb1e
bpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16…
zooba Oct 3, 2019
b23a842
bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16…
idomic Oct 3, 2019
86ec5c6
bpo-38353: Fix calculate_argv0_path() for symlinks (GH-16549)
vstinner Oct 3, 2019
c515b57
bpo-38353: Fix compiler warning in pycore_initconfig.h (GH-16570)
vstinner Oct 3, 2019
e982d8b
bpo-38353: Fix compiler warning in internal headers (GH-16573)
vstinner Oct 4, 2019
03a8a56
bpo-38353: Add subfunctions to getpath.c (GH-16572)
vstinner Oct 4, 2019
f0c8579
bpo-38353: Rework ismodule() in getpath.c (GH-16574)
vstinner Oct 4, 2019
3142c66
bpo-38235: Correct some arguments names in logging documentation (GH-…
AWhetter Oct 4, 2019
2290b23
Updated CODEOWNERS to indicate ownership of some modules. (GH-16578)
vsajip Oct 4, 2019
06cb94b
bpo-13153: Use OS native encoding for converting between Python and T…
serhiy-storchaka Oct 4, 2019
8855e47
bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Inter…
nanjekyejoannah Oct 4, 2019
abd7cd8
bpo-38353: getpath.c uses dynamically allocated strings (GH-16582)
vstinner Oct 4, 2019
c02b41b
bpo-38353: getpath.c: allocates strings on the heap (GH-16585)
vstinner Oct 4, 2019
3faf826
bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (#16525)
rockwelln Oct 5, 2019
65dcc8a
bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)
aft90 Oct 5, 2019
c38e725
bpo-38210: Fix intersection operation with dict view and iterator. (G…
corona10 Oct 6, 2019
24ddd9c
bpo-38383: Fix possible integer overflow in startswith() of bytes and…
shihai1991 Oct 6, 2019
9e71917
bpo-26510: Add versionchanged for required arg of add_subparsers (GH…
adamjstewart Oct 7, 2019
ef092fe
bpo-25988: Do not expose abstract collection classes in the collectio…
serhiy-storchaka Oct 7, 2019
ed8efd8
Fix a compile warning in dictobject.c (GH-16610)
shihai1991 Oct 7, 2019
d97f1ce
bpo-38210: Fix compiler warning in dictobject.c (GH-16611)
vstinner Oct 7, 2019
b96145a
bpo-38353: Simplify calculate_pybuilddir() (GH-16614)
vstinner Oct 7, 2019
038503e
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)
kmoza Oct 7, 2019
303475e
Fix a compile warning in selectmodule.c. (GH-16617)
zhangyangyu Oct 7, 2019
321def8
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
btharper Oct 7, 2019
6876257
bpo-36389: _PyObject_CheckConsistency() available in release mode (GH…
vstinner Oct 7, 2019
60ec6ef
bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)
vstinner Oct 7, 2019
15ae75d
bpo-38294: Add list of no-longer-escaped chars to re.escape documenta…
rbanffy Oct 7, 2019
e310af9
bpo-38344: Fix syntax in activate.bat (GH-16533)
jamesabel Oct 7, 2019
7775349
bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)
vstinner Oct 7, 2019
1b18455
bpo-38392: PyObject_GC_Track() validates object in debug mode (GH-16615)
vstinner Oct 7, 2019
36e33c3
bpo-38400 Don't check for NULL linked list pointers in _PyObject_IsFr…
pablogsal Oct 7, 2019
4d5f94b
bpo-38070: Enhance visit_decref() debug trace (GH-16631)
vstinner Oct 8, 2019
0d3fe8a
closes bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599)
chibby0ne Oct 8, 2019
5dfbb4d
Fix typo in _warnings.warn_explicit() docstring (GH-16625)
hansrajdas Oct 8, 2019
d7c3873
bpo-33714: Output an exception raised in module's m_clear(). (GH-16592)
serhiy-storchaka Oct 8, 2019
d05b000
bpo-38371: Tkinter: deprecate the split() method. (GH-16584)
serhiy-storchaka Oct 8, 2019
b690a27
bpo-36698: IDLE no longer fails when write non-encodable characters t…
serhiy-storchaka Oct 8, 2019
13abda4
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (G…
serhiy-storchaka Oct 8, 2019
8252c52
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
serhiy-storchaka Oct 8, 2019
03ab6b4
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
vstinner Oct 8, 2019
10cd00a
bpo-38395: Fix ownership in weakref.proxy methods (GH-16632)
pablogsal Oct 8, 2019
e53c580
test_dictviews: Add testcase for dictviews_sub (GH-16660)
corona10 Oct 8, 2019
0ec618a
bpo-37531: regrtest ignores output on timeout (GH-16659)
vstinner Oct 8, 2019
e8bedbd
bpo-38368: Added fix for ctypes crash when handling arrays in structs…
vsajip Oct 8, 2019
594e2ed
closes bpo-36161: Use thread-safe ttyname_r instead of ttyname. (GH-1…
chibby0ne Oct 9, 2019
01171eb
Typo fix: "empy" should be "empty". (GH-16666)
hansrajdas Oct 9, 2019
ecbf35f
bpo-38379: don't claim objects are collected when they aren't (#16658)
tim-one Oct 9, 2019
09895c2
bpo-38409: Fix grammar in str.strip() docstring (GH-16682)
zware Oct 9, 2019
a544773
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-1…
vstinner Oct 10, 2019
7bb1431
bpo-38109: Add missing constants to Lib/stat.py (GH-16665)
rlamy Oct 10, 2019
a05fcd3
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
corona10 Oct 10, 2019
d47f0dd
bpo-32996: Documentation fix-up. (GH-16646)
eirrgang Oct 10, 2019
b6e0fc7
bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)
vstinner Oct 10, 2019
1dbe537
Re-enable the OverflowError test for test_truediv on test_complex (GH…
corona10 Oct 10, 2019
d565fb9
bpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)
vstinner Oct 10, 2019
72bbd2a
Remove AppVeyor badge now that we don't use it in the CI anymore (GH-…
pablogsal Oct 10, 2019
320dd50
bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)
pablogsal Oct 10, 2019
f900064
docs: Add asyncio source code links (GH-16640)
aeros Oct 10, 2019
a8e0d31
Typo fix: "throuhgh" should be "through". (GH-16704)
hansrajdas Oct 11, 2019
c39d1dd
Fix strict-aliasing rules errors on gcc 4.8.5. (GH-16714)
corona10 Oct 11, 2019
cbb5481
bpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715)
serhiy-storchaka Oct 11, 2019
2b7dc40
bpo-38347: find pathfix for Python scripts whose name contain a '-' (…
rpluem Oct 11, 2019
19a3d87
bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow op…
maxking Oct 12, 2019
822922a
bpo-35800: Deprecate smtpd.MailmanProxy (GH-11675)
samuelcolvin Oct 12, 2019
e634da2
Announce the change in the CancelledError inheritance (GH-16730)
pgjones Oct 12, 2019
547c60c
Fix minor typos in Whatsnew
hugovk Oct 12, 2019
8177404
bpo-37731: Reorder includes in xmltok.c to avoid redefinition of _POS…
pablogsal Oct 12, 2019
f3751ef
bpo-38417: Add umask support to subprocess (GH-16726)
gpshead Oct 12, 2019
67b93f8
bpo-38456: Use /bin/true in test_subprocess (GH-16736)
gpshead Oct 12, 2019
27b33fb
bpo-38282: Correctly manage the Bluetooth L2CAP socket structure in F…
pablogsal Oct 13, 2019
46113e0
bpo-38456: Handle the case when there is no 'true' command (GH-16739)
pablogsal Oct 13, 2019
140a7d1
bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
serhiy-storchaka Oct 13, 2019
793cb85
bpo-38431: Fix __repr__ method of InitVar to work with typing objects…
samuelcolvin Oct 13, 2019
b16e382
bpo-38202: Fix a crash in dict_view & non-itearble. (GH-16241)
ZackerySpytz Oct 13, 2019
e3babbd
Correct signature of __build_class__ (GH-16735)
pablogsal Oct 13, 2019
466326d
bpo-38379: Don't block collection of unreachable objects when some ob…
pablogsal Oct 13, 2019
bb78f6c
Rebased version of what's new PR (#16745)
akuchling Oct 13, 2019
8144095
bpo-28556: Remove another mention of metaclass of Generic in typing d…
ilevkivskyi Oct 13, 2019
fdfe283
bpo-38467: Fix argument name of typing functions (GH-16753)
srittau Oct 13, 2019
95bfc8a
Misc gc code & comment cleanups. (GH-16752)
tim-one Oct 13, 2019
8a6cbf8
bpo-38464: Document parameter for NormalDist.quantiles() (GH-16757)
rhettinger Oct 14, 2019
fd5c414
bpo-38469: Handle named expression scope with global/nonlocal keyword…
pablogsal Oct 14, 2019
61a6db5
bpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761)
rhettinger Oct 14, 2019
a329153
bpo-37759: Add examples for the new typing features (GH-16763)
rhettinger Oct 14, 2019
9cb51f4
Update macOS installer display files for 3.9.0a1 (GH-16765)
ned-deily Oct 14, 2019
aad2ee0
bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)
stein-k Oct 14, 2019
19d6842
Update build docs for macOS (GH-16771)
ned-deily Oct 14, 2019
298439c
bpo-37759: Polish What's New in Python 3.8. (#16769)
serhiy-storchaka Oct 14, 2019
d83fc27
bpo-38453: Resolve test directories before chdir to them (GH-16723)
zooba Oct 14, 2019
274bd01
Remove draft status. Add asyncio REPL example (GH-16785)
rhettinger Oct 14, 2019
4504b45
Doc: 3.8 is now stable. (GH-16790)
JulienPalard Oct 14, 2019
4d20228
bpo-38133: Update docs to reflect fixes to py.exe launcher (GH-16791)
zooba Oct 14, 2019
0b60f64
bpo-11410: Standardize and use symbol visibility attributes across PO…
vsajip Oct 15, 2019
0d44e8c
bpo-16575: Add checks for unions passed by value to functions.
vsajip Sep 26, 2019
ed270bf
Updated the logic for propagation of flags.
vsajip Sep 26, 2019
b798ff6
Corrected typos in test.
vsajip Sep 26, 2019
2f21671
Improved tests.
vsajip Sep 26, 2019
e3afbbe
Rebased with master and resolved conflicts.
vsajip Oct 15, 2019
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
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ Objects/dict* @methane
/Modules/_blake2/** @python/crypto-team @tiran
/Modules/_sha3/** @python/crypto-team @tiran

# logging
**/*logging* @vsajip

# venv
**/*venv* @vsajip

# Launcher
/PC/launcher.c @vsajip

# HTML
/Lib/html/ @ezio-melotti
Expand Down
8 changes: 8 additions & 0 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,14 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
:c:func:`PyThreadState_Clear`.


.. c:function:: void PyThreadState_DeleteCurrent()

Destroy the current thread state and release the global interpreter lock.
Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not
be held. The thread state must have been reset with a previous call
to :c:func:`PyThreadState_Clear`.


.. c:function:: PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *interp)

Return the interpreter's unique ID. If there was any error in doing
Expand Down
46 changes: 19 additions & 27 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,13 @@ the preinitialization.

Example using the preinitialization to enable the UTF-8 Mode::

PyStatus status;
PyPreConfig preconfig;
PyPreConfig_InitPythonConfig(&preconfig);

preconfig.utf8_mode = 1;

PyStatus status = Py_PreInitialize(&preconfig);
status = Py_PreInitialize(&preconfig);
if (PyStatus_Exception(status)) {
Py_ExitStatusException(status);
}
Expand All @@ -342,12 +343,12 @@ PyConfig

Structure methods:

.. c:function:: PyStatus PyConfig_InitPythonConfig(PyConfig *config)
.. c:function:: void PyConfig_InitPythonConfig(PyConfig *config)

Initialize configuration with :ref:`Python Configuration
<init-python-config>`.

.. c:function:: PyStatus PyConfig_InitIsolatedConfig(PyConfig *config)
.. c:function:: void PyConfig_InitIsolatedConfig(PyConfig *config)

Initialize configuration with :ref:`Isolated Configuration
<init-isolated-conf>`.
Expand Down Expand Up @@ -674,7 +675,13 @@ PyConfig

.. c:member:: PyWideStringList warnoptions

Options of the :mod:`warnings` module to build warnings filters.
:data:`sys.warnoptions`: options of the :mod:`warnings` module to build
warnings filters: lowest to highest priority.

The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
order: the last :c:member:`PyConfig.warnoptions` item becomes the first
item of :data:`warnings.filters` which is checked first (highest
priority).

.. c:member:: int write_bytecode

Expand Down Expand Up @@ -717,12 +724,9 @@ Example setting the program name::
void init_python(void)
{
PyStatus status;
PyConfig config;

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
goto fail;
}
PyConfig config;
PyConfig_InitPythonConfig(&config);

/* Set the program name. Implicitly preinitialize Python. */
status = PyConfig_SetString(&config, &config.program_name,
Expand All @@ -749,12 +753,9 @@ configuration, and then override some parameters::
PyStatus init_python(const char *program_name)
{
PyStatus status;
PyConfig config;

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
goto done;
}
PyConfig config;
PyConfig_InitPythonConfig(&config);

/* Set the program name before reading the configuraton
(decode byte string from the locale encoding).
Expand Down Expand Up @@ -835,14 +836,10 @@ Example of customized Python always running in isolated mode::

int main(int argc, char **argv)
{
PyConfig config;
PyStatus status;

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
goto fail;
}

PyConfig config;
PyConfig_InitPythonConfig(&config);
config.isolated = 1;

/* Decode command line arguments.
Expand Down Expand Up @@ -1027,14 +1024,9 @@ phases::
void init_python(void)
{
PyStatus status;
PyConfig config;

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
PyConfig_Clear(&config);
Py_ExitStatusException(status);
}

PyConfig config;
PyConfig_InitPythonConfig(&config);
config._init_main = 0;

/* ... customize 'config' configuration ... */
Expand Down
3 changes: 2 additions & 1 deletion Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ The following functions and structs are used to create

.. c:function:: PyObject* PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)

Creates and returns a heap type object from the *spec*.
Creates and returns a heap type object from the *spec*
(:const:`Py_TPFLAGS_HEAPTYPE`).

If *bases* is a tuple, the created heap type contains all types contained
in it as base types.
Expand Down
24 changes: 20 additions & 4 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -654,16 +654,31 @@ and :c:type:`PyType_Type` effectively act as defaults.)
the instance is still in existence, but there are no references to it. The
destructor function should free all references which the instance owns, free all
memory buffers owned by the instance (using the freeing function corresponding
to the allocation function used to allocate the buffer), and finally (as its
last action) call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is not
subtypable (doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), it is
to the allocation function used to allocate the buffer), and call the type's
:c:member:`~PyTypeObject.tp_free` function. If the type is not subtypable
(doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), it is
permissible to call the object deallocator directly instead of via
:c:member:`~PyTypeObject.tp_free`. The object deallocator should be the one used to allocate the
instance; this is normally :c:func:`PyObject_Del` if the instance was allocated
using :c:func:`PyObject_New` or :c:func:`PyObject_VarNew`, or
:c:func:`PyObject_GC_Del` if the instance was allocated using
:c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`.

Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the
deallocator should decrement the reference count for its type object after
calling the type deallocator. In order to avoid dangling pointers, the
recommended way to achieve this is:

.. code-block:: c

static void foo_dealloc(foo_object *self) {
PyTypeObject *tp = Py_TYPE(self);
// free references and buffers here
tp->tp_free(self);
Py_DECREF(tp);
}


**Inheritance:**

This field is inherited by subtypes.
Expand Down Expand Up @@ -1021,7 +1036,8 @@ and :c:type:`PyType_Type` effectively act as defaults.)

.. data:: Py_TPFLAGS_HEAPTYPE

This bit is set when the type object itself is allocated on the heap. In this
This bit is set when the type object itself is allocated on the heap, for
example, types created dynamically using :c:func:`PyType_FromSpec`. In this
case, the :attr:`ob_type` field of its instances is considered a reference to
the type, and the type object is INCREF'ed when a new instance is created, and
DECREF'ed when an instance is destroyed (this does not apply to instances of
Expand Down
2 changes: 1 addition & 1 deletion Doc/extending/newtypes_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ set to *NULL*. ::
Py_INCREF(&CustomType);
if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) {
Py_DECREF(&CustomType);
PY_DECREF(m);
Py_DECREF(m);
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Glossary
Fortran contiguous arrays, the first index varies the fastest.

coroutine
Coroutines is a more generalized form of subroutines. Subroutines are
Coroutines are a more generalized form of subroutines. Subroutines are
entered at one point and exited at another point. Coroutines can be
entered, exited, and resumed at many different points. They can be
implemented with the :keyword:`async def` statement. See also
Expand Down
5 changes: 4 additions & 1 deletion Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ Sub-commands
stored; by default ``None`` and no value is stored

* required_ - Whether or not a subcommand must be provided, by default
``False``.
``False`` (added in 3.7)

* help_ - help for sub-parser group in help output, by default ``None``

Expand Down Expand Up @@ -1792,6 +1792,9 @@ Sub-commands
>>> parser.parse_args(['2', 'frobble'])
Namespace(subparser_name='2', y='frobble')

.. versionchanged:: 3.7
New *required* keyword argument.


FileType objects
^^^^^^^^^^^^^^^^
Expand Down
36 changes: 6 additions & 30 deletions Doc/library/asyncio-api-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,47 +132,23 @@ High-level APIs to work with network IO.
:widths: 50 50
:class: full-width-table

* - ``await`` :func:`connect`
- Establish a TCP connection to send and receive data.

* - ``await`` :func:`open_connection`
- Establish a TCP connection. (Deprecated in favor of :func:`connect`)

* - ``await`` :func:`connect_unix`
- Establish a Unix socket connection to send and receive data.
- Establish a TCP connection.

* - ``await`` :func:`open_unix_connection`
- Establish a Unix socket connection. (Deprecated in favor of :func:`connect_unix`)

* - :class:`StreamServer`
- Start a TCP server.
- Establish a Unix socket connection.

* - ``await`` :func:`start_server`
- Start a TCP server. (Deprecated in favor of :class:`StreamServer`)

* - :class:`UnixStreamServer`
- Start a Unix socket server.
- Start a TCP server.

* - ``await`` :func:`start_unix_server`
- Start a Unix socket server. (Deprecated in favor of :class:`UnixStreamServer`)

* - :func:`connect_read_pipe`
- Establish a connection to :term:`file-like object <file object>` *pipe*
to receive data.

* - :func:`connect_write_pipe`
- Establish a connection to :term:`file-like object <file object>` *pipe*
to send data.

* - :class:`Stream`
- Stream is a single object combining APIs of :class:`StreamReader` and
:class:`StreamWriter`.
- Start a Unix socket server.

* - :class:`StreamReader`
- High-level async/await object to receive network data. (Deprecated in favor of :class:`Stream`)
- High-level async/await object to receive network data.

* - :class:`StreamWriter`
- High-level async/await object to send network data. (Deprecated in favor of :class:`Stream`)
- High-level async/await object to send network data.


.. rubric:: Examples
Expand Down
7 changes: 6 additions & 1 deletion Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
Event Loop
==========

**Source code:** :source:`Lib/asyncio/events.py`,
:source:`Lib/asyncio/base_events.py`

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

.. rubric:: Preface

Expand Down Expand Up @@ -1637,7 +1641,8 @@ Wait until a file descriptor received some data using the
:meth:`loop.create_connection` method.

* Another similar :ref:`example <asyncio_example_create_connection-streams>`
using the high-level :func:`asyncio.connect` function and streams.
using the high-level :func:`asyncio.open_connection` function
and streams.


.. _asyncio_example_unix_signals:
Expand Down
3 changes: 3 additions & 0 deletions Doc/library/asyncio-exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
Exceptions
==========

**Source code:** :source:`Lib/asyncio/exceptions.py`

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

.. exception:: TimeoutError

Expand Down
5 changes: 5 additions & 0 deletions Doc/library/asyncio-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
Futures
=======

**Source code:** :source:`Lib/asyncio/futures.py`,
:source:`Lib/asyncio/base_futures.py`

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

*Future* objects are used to bridge **low-level callback-based code**
with high-level async/await code.

Expand Down
6 changes: 6 additions & 0 deletions Doc/library/asyncio-platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ All Platforms
Windows
=======

**Source code:** :source:`Lib/asyncio/proactor_events.py`,
:source:`Lib/asyncio/windows_events.py`,
:source:`Lib/asyncio/windows_utils.py`

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

.. versionchanged:: 3.8

On Windows, :class:`ProactorEventLoop` is now the default event loop.
Expand Down
12 changes: 10 additions & 2 deletions Doc/library/asyncio-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ This documentation page contains the following sections:
Transports
==========

**Source code:** :source:`Lib/asyncio/transports.py`

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

Transports are classes provided by :mod:`asyncio` in order to abstract
various kinds of communication channels.

Expand Down Expand Up @@ -431,6 +435,10 @@ Subprocess Transports
Protocols
=========

**Source code:** :source:`Lib/asyncio/protocols.py`

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

asyncio provides a set of abstract base classes that should be used
to implement network protocols. Those classes are meant to be used
together with :ref:`transports <asyncio-transport>`.
Expand Down Expand Up @@ -809,7 +817,7 @@ data, and waits until the connection is closed::
.. seealso::

The :ref:`TCP echo client using streams <asyncio-tcp-echo-client-streams>`
example uses the high-level :func:`asyncio.connect` function.
example uses the high-level :func:`asyncio.open_connection` function.


.. _asyncio-udp-echo-server-protocol:
Expand Down Expand Up @@ -978,7 +986,7 @@ Wait until a socket receives data using the

The :ref:`register an open socket to wait for data using streams
<asyncio_example_create_connection-streams>` example uses high-level streams
created by the :func:`asyncio.connect` function in a coroutine.
created by the :func:`open_connection` function in a coroutine.

.. _asyncio_example_subprocess_proto:

Expand Down
4 changes: 4 additions & 0 deletions Doc/library/asyncio-queue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
Queues
======

**Source code:** :source:`Lib/asyncio/queues.py`

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

asyncio queues are designed to be similar to classes of the
:mod:`queue` module. Although asyncio queues are not thread-safe,
they are designed to be used specifically in async/await code.
Expand Down
Loading