Commit Graph

23714 Commits

Author SHA1 Message Date
Christopher Yeh 0dfee33dfe
Fix typo (GH-21820) 2020-08-11 19:27:08 -03:00
Ram Rachum 76643c10ed
bpo-41475: Fix note in "What's new in 3.7" (#21733) 2020-08-11 18:33:25 +02:00
Petr Viktorin af3a6a8cae
Add PEP 573 additions to What's New (GH-21374) 2020-08-11 18:15:57 +02:00
Edward K. Ream e3c971ccfa
Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773) 2020-08-11 07:07:49 -07:00
Victor Stinner fabd7bb8e0
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
Automerge-Triggered-By: @tiran
2020-08-11 06:26:59 -07:00
Filipe Laíns 4ce6faa6c9
bpo-16995: add support for base32 extended hex (base32hex) (GH-20441)
cc @pganssle

Automerge-Triggered-By: @pganssle
2020-08-10 07:48:20 -07:00
Stefan Krah 39042e00ab
bpo-41324 Add a minimal decimal capsule API (#21519) 2020-08-10 16:32:21 +02:00
Zackery Spytz e28b8c9387
bpo-35018: Sax parser should provide user access to lexical handlers (GH-20958)
Co-Authored-By: Jonathan Gossage <jgossage@gmail.com>
2020-08-09 12:50:53 +02:00
Jiajie Zhong 67acf74c4e
Doc: Add output to example code in programming FAQ (GH-21346)
Add output hint to document, part faq/programming, section [How do I write a function with output parameters (call by reference)?](https://docs.python.org/3/faq/programming.html#how-do-i-write-a-function-with-output-parameters-call-by-reference).

This patch make the output hint just like prefix code block.
2020-08-08 12:29:03 -07:00
Yaroslav Pankovych 82ca8fada1
bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-08-08 19:48:21 +01:00
Benjamin Kane 705f145565
Doc: Add a link to tutorial page from `open()` doc (GH-21737)
Adds a link to the "Reading and Writing Files" page so users can
more easily discover how file handles are handled with the `with`
context manager vs without it.
2020-08-08 11:57:03 +09:00
Inada Naoki 46e19b61d3
bpo-41098: Doc: Add missing deprecated directives (GH-21162)
PyUnicodeEncodeError_Create has been deprecated with
`Py_DEPRECATED` macro. But it was not documented.
2020-08-07 16:31:53 +09:00
pxinwr 3405e05428
bpo-41440: add os.cpu_count() support for VxWorks RTOS (GH-21685) 2020-08-07 14:21:52 +09:00
Inada Naoki 270b4ad4df
bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479)
See PEP 623 for detail.
2020-08-05 10:48:51 +09:00
Hans Petter Jansson da4e09fff6
bpo-36982: Add support for extended color functions in ncurses 6.1 (GH-17536)
Co-authored-by: Jeffrey Kintscher <websurfer@surf2c.net>
2020-08-03 23:51:33 -04:00
Ankit Chandawala c36dbac588
bpo-41425: Make tkinter doc example runnable (GH-21706)
Co-authored-by: Ankit Chandawala <achandaw@amazon.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-08-03 00:03:48 -04:00
Nathan M ecaf949cc4
bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707) 2020-08-02 22:13:03 -04:00
Luciano Ramalho ab72fdeb82
bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering (#21574)
Also added PEP 585 deprecation notes.
2020-08-02 15:32:36 -07:00
Sebastien Williams-Wynn ba18c0b13b
bpo-41426 Fix grammar in curses.getmouse() documentation (GH-21677)
Automerge-Triggered-By: @brettcannon
2020-07-29 11:36:46 -07:00
Yonatan Goldschmidt f6a16e8a82
Remove incorrect mention of method.__class__ in descriptor docs (GH-21665) 2020-07-28 16:56:26 -07:00
Xiang Zhang 34cd3e9f6a
Fix `List_Append` description, list is extracted at TOS1[-i] (GH-21465) 2020-07-29 00:51:33 +08:00
Dmytro Litvinov 5e3826785d
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (GH-21653) 2020-07-28 07:48:32 -07:00
amaajemyfren 13efaec2e0
bpo-41045: Document debug feature of f-strings ('=') (GH-21509)
Co-Authored-By: Rishi <rishi93dev@gmail.com>

Automerge-Triggered-By: @gvanrossum
2020-07-27 15:31:02 -07:00
Pablo Galindo 72cabb2aa6
bpo-40939: Use the new grammar for the grammar specification documentation (GH-19969)
(We censor the heck out of actions and some other stuff using a custom "highlighter".)

Co-authored-by: Guido van Rossum <guido@python.org>
2020-07-27 11:20:36 -07:00
Guido van Rossum 508ed2d912
Delete remaining references to Grammar/Grammar from docs (#21624)
(Ironically, the file itself remains, see https://github.com/we-like-parsers/cpython/issues/135.)
2020-07-26 08:27:52 -07:00
Shankar Jha f117cef25b
bpo-39868: Add documentation for Assignment Expressions (walrus, PEP 572) (#18851) 2020-07-25 16:33:48 -07:00
YoSTEALTH 0028c14073
bpo-41314: fixed annotations __future__ version (GH-21616)
PEP 563 was updated to change the release where `from __future__ import annotations` becomes the default (and only) behavior from 4.0 to 3.10. Update `__future__.py` and its docs to reflect this.
2020-07-25 14:42:49 -07:00
Gregory Schevchenko daff39070e
bpo-38731: Add --quiet option to py_compile CLI (GH-17134) 2020-07-25 22:58:45 +03:00
Andre Delfino b9f6ac9d46
Stick with the phrase "default parameter value" (GH-21590) 2020-07-22 20:58:19 -03:00
Ammar Askar 5241e189e7
bpo-41283: Fix mismatched argument name for imghdr.what (GH-21501) 2020-07-20 21:22:01 -03:00
Serhiy Storchaka 12f433411b
bpo-41334: Convert constructors of str, bytes and bytearray to Argument Clinic (GH-21535) 2020-07-20 15:53:55 +03:00
Volker-Weissmann f9bf015799
Simple Documentation fix: Missing link to return type class. (GH-21291)
Just a simple documentation fix: apply_async and map_async return a "multiprocessing.pool.AsyncResult Object", not a "result object".
2020-07-20 04:26:32 -07:00
Vinay Sharma d42528a3a2
bpo-37703: improve asyncio.gather documentation regarding cancellation (GH-15312)
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()

Automerge-Triggered-By: @asvetlov
2020-07-20 01:42:57 -07:00
Julien Palard 7f03445d01
Doc: fix import of asdl.py when called from outside Doc/. (GH-21529) 2020-07-20 09:48:40 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 10e466448f
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2020-07-19 13:03:43 +02:00
Jordan Speicher 9b01c598ca
bpo-41325: Add version note for args and kwargs property in call object (GH-21525) 2020-07-18 18:35:44 +05:30
matthewhughes934 8e836bb21c
bpo-41195: Add getter for Openssl security level (GH-21282)
Add an accessor under SSLContext.security_level as a wrapper around
SSL_CTX_get_security_level, see:
https://www.openssl.org/docs/manmaster/man3/SSL_CTX_get_security_level.html


------
This is my first time contributing, so please pull me up on all the things I missed or did incorrectly.

Automerge-Triggered-By: @tiran
2020-07-17 01:59:15 -07:00
Christopher Yeh 5e5c0f9866
Remove unnecessary spaces in code blocks in urllib.parse.rst (GH-21500)
This should also fix the syntax highlighting for these code blocks

Automerge-Triggered-By: @csabella
2020-07-16 04:22:32 -07:00
Berker Peksag d4d127f1c6
bpo-31844: Move whatsnew note to 3.10.rst (GH-21504) 2020-07-16 09:38:58 +03:00
Berker Peksag e34bbfd61f
bpo-31844: Remove _markupbase.ParserBase.error() (GH-8562) 2020-07-16 09:13:05 +03:00
JustAnotherArchivist 2a5181829a
bpo-32528: Document the change in inheritance of asyncio.CancelledError (GH-21474)
#msg373510

[bpo-32528]()/#13528 changed `asyncio.CancelledError` such that it no longer inherits from `concurrent.futures.CancelledError`. As this affects existing code, specifically when catching the latter instead of the former in exception handling, it should be documented in the "What's new in 3.8?" document.

Automerge-Triggered-By: @1st1
2020-07-14 10:22:43 -07:00
Paul McMillan 4f28f75dee
Fix repeated words in Classes tutorial (GH-21455)
The phrase "At any time during execution," was repeated twice.

Automerge-Triggered-By: @Mariatta
2020-07-13 18:26:23 -07:00
Joannah Nanjekye 8dd32fe645
bpo-32192: A basic lazy importer example (GH-21330)
* Add example on lazy imports

* Use four spaces for indentation

* change to console
2020-07-13 18:31:02 -03:00
Nima Dini 344dce312a
bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) 2020-07-10 21:54:53 -04:00
marload 6fc732a211
Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) 2020-07-10 21:13:31 +05:30
Joannah Nanjekye 3cbade7d30
bpo-23802: patch: __deepcopy__ memo dict argument usage (GH-21326)
* Clarify __deepcopy__ memo dict argument usage

* Add full stop
2020-07-09 21:36:35 -03:00
Terry Jan Reedy bce2eb4646
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-07-09 18:08:33 -04:00
E-Paine 1ee5dc1586
Remove trailing >>> in enum docs (GH-21358)
The >>> as the last line serve no purpose and are not colored correctly by Sphinx.
2020-07-09 12:18:34 -07:00
marload 61bb24a270
bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413)
Automerge-Triggered-By: @ericvsmith
2020-07-09 05:13:47 -07:00
Julien Palard a908bc4dd8
Doc: Builtins functions: faster jump table (GH-21376) 2020-07-09 11:38:41 +02:00
Joannah Nanjekye a95ac779e6
bpo-41224: Document is_annotated() in symtable module and update doc strings (GH-21369)
* Document is_annotate() and update doc strings

* Move quotes to the next line.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-07-07 20:09:56 -03:00
Julien Palard a103e73ce8
bpo-40742: Doc: fix parallel build. (GH-21237) 2020-07-06 22:28:15 +02:00
Dong-hee Na b4a9263708
bpo-37207: Update whatsnews for 3.9 (GH-21337) 2020-07-06 13:22:04 +02:00
Joannah Nanjekye d12af71047
bpo-28681: Clarify multiple function names in the tutorial (GH-21340)
* improve control flow docs

* Add also

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-05 22:47:15 -03:00
Joannah Nanjekye 9ed3cd8ba0
bpo-26205: Specify the number of nested scopes (GH-21324)
* Clarify number of scopes

* Indicate 3 or 4

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-05 22:42:24 -03:00
Inada Naoki 9c84417122
bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325)
It doesn't use PyUnicode_EncodeDecimal. It uses a private API instead.
2020-07-05 13:01:48 +09:00
Zackery Spytz b40e434386
bpo-33864: Clarify the docs for typing.ByteString (GH-21311) 2020-07-03 20:58:21 -07:00
Pablo Galindo 67673b08ea
Remove extraneous file from the Docs folder (GH-21286) 2020-07-02 23:08:36 +01:00
Rémi Lapeyre 004e64e805
bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all_tasks() (GH-20874) 2020-07-01 20:41:21 -07:00
Kit Choi 6b34d7b51e
bpo-39385: Add an assertNoLogs context manager to unittest.TestCase (GH-18067)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2020-07-01 22:08:38 +01:00
tomerv 741008a57b
Doc: Minor fix to init config C API documentation (GH-21198)
Co-authored-by: Tomer Vromen <tomer.vromen@intel.com>
2020-07-01 11:32:54 +02:00
E-Paine 3fa4799c3f
Update FAQ release schedule and estimated users (GH-21180)
Update FAQ to include:
* The new yearly release schedule from PEP 602
* Estimated users from "tens of thousands" to "millions"
2020-06-30 05:42:43 -04:00
Inada Naoki 038dd0f79d
bpo-36346: Raise DeprecationWarning when creating legacy Unicode (GH-20933) 2020-06-30 15:26:56 +09:00
Inada Naoki b3332660ad
bpo-41123: Remove PyUnicode_AsUnicodeCopy (GH-21209) 2020-06-30 12:23:07 +09:00
Victor Stinner dd8a93e23b
bpo-23427: Add sys.orig_argv attribute (GH-20729)
Add sys.orig_argv attribute: the list of the original command line
arguments passed to the Python executable.

Rename also PyConfig._orig_argv to PyConfig.orig_argv and
document it.
2020-06-30 00:49:03 +02:00
Stefan Krah a3ad95dd21
Update libmpdec license dates (GH-21216) 2020-06-29 14:03:01 +02:00
Inada Naoki e4f1fe6edb
bpo-41123: Remove PyLong_FromUnicode() (GH-21204) 2020-06-29 13:00:43 +09:00
Inada Naoki d9f2a13106
bpo-41123: Remove PyUnicode_GetMax() (GH-21192) 2020-06-29 10:46:51 +09:00
Batuhan Taskaya 8df1016e2e
bpo-38870: Extend subject of ast.unparse warnings (GH-21053)
- Mention that some compiler optimizations might not roundtrip
exactly (such as constant tuples and frozensets).

- Add a warning about it might raise RecursionError on very
complex expressions due to recursive unparsing aspect of ast.unparse
2020-06-28 02:11:43 +01:00
Pablo Galindo 89e82c4a62
Add soft keywords to the documentation (GH-21185) 2020-06-27 20:00:29 +01:00
Inada Naoki 20a7902175
bpo-41123: Remove Py_UNICODE_str* functions (GH-21164)
They are undocumented and deprecated since Python 3.3.
2020-06-27 18:22:09 +09:00
Inada Naoki 6f8a6ee59c
bpo-41103: Remove old buffer protocol support (#21117)
They are deprecated since Python 3.0.
2020-06-26 08:07:22 +09:00
Ram Rachum 77ed29b2c2
Fix typo in functions.rst (GH-21131) 2020-06-25 14:50:37 -07:00
Ned Deily 589e8fe079
bpo-40204: Pin Sphinx version to 2.3.1 in ``Doc/Makefile``. (GH-21141) 2020-06-25 07:22:10 -04:00
Arisaka97 cf18c9e9d4
bpo-40773: Fix rendering for 'retval' on the pdb page (GH-21081)
Automerge-Triggered-By: @merwok
2020-06-24 14:50:49 -07:00
Gareth Rees bf2e515fa4
bpo-40707: Document that Popen.communicate sets the returncode attribute (GH-20283) 2020-06-23 23:12:10 -04:00
Roger Iyengar a16d697049
Improve asyncio.loop.call_soon() documentation (GH-20883)
* Add a glossary entry for the term "callback"
* Link to it in loop.call_soon() and in the "Concurrency and Multithreading" section

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-06-22 22:16:00 -04:00
Brian Rutledge af157fad28
Add link to .pypirc specification (GH-20680)
Related to https://github.com/pypa/twine/issues/638 and https://github.com/pypa/packaging.python.org/issues/730, I wrote a spec based on the one that was removed in https://github.com/python/cpython/pull/13087. However, a Google search for "pypirc" turned up at least one [blog post](https://truveris.github.io/articles/configuring-pypirc/) that links to https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file, which now just links to this document. So, I thought a link to the spec would be handy.

Automerge-Triggered-By: @jaraco
2020-06-20 10:10:25 -07:00
Vincent Férotin 344c2a75c1
bpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for '… (GH-20964)
…choices' argument of 'argparse.ArgumentParser.add_argument'.

Here's a short first proposal of doc. enhancement addressing [bpo-41024]().

Automerge-Triggered-By: @csabella
2020-06-20 05:55:05 -07:00
Ram Rachum 59cf853332
bpo-40636: Documentation for zip-strict (#20961) 2020-06-19 13:39:22 -07:00
Victor Stinner 37bb289556
bpo-40943: PY_SSIZE_T_CLEAN required for '#' formats (GH-20784)
The PY_SSIZE_T_CLEAN macro must now be defined to use
PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#",
"s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353.

Update _testcapi.test_buildvalue_issue38913().
2020-06-19 11:45:31 +02:00
Serhiy Storchaka 8a64ceaf98
bpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075) 2020-06-18 22:08:27 +03:00
Bar Harel 8f192d12af
bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)
Docs and tests are underway.

Automerge-Triggered-By: @vsajip
2020-06-18 07:18:58 -07:00
Victor Stinner ddbeb2f3e0
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)
On Linux, skip tests using multiprocessing if the current user cannot
create a file in /dev/shm/ directory. Add the
skip_if_broken_multiprocessing_synchronize() function to the
test.support module.
2020-06-18 14:53:19 +02:00
Victor Stinner 2c2a4f3d85
bpo-41006: What's New: less => fewer modules (GH-20955)
Typo spotted by Eric V. Smith ;-)
2020-06-18 01:20:51 +02:00
Victor Stinner 4c18fc8f1d
bpo-41006: Document the runpy optimization (GH-20953) 2020-06-17 23:58:58 +02:00
Inada Naoki 2c4928d37e
bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-17 20:09:44 +09:00
Victor Stinner 7ab92d54b5
bpo-36020: Require vsnprintf() to build Python (GH-20899)
The C99 functions snprintf() and vsnprintf() are now required
to build Python.

PyOS_snprintf() and PyOS_vsnprintf() no longer call Py_FatalError().
Previously, they called Py_FatalError() on a buffer overflow on platforms
which don't provide vsnprintf().
2020-06-16 00:54:44 +02:00
kevin seelbach 714217f956
Fixes dead links to Django's logging config docs (GH-20823)
Fixes two outdated URLs to point at the current "stable" version of Django's logging documentation.

Automerge-Triggered-By: @vsajip
2020-06-14 10:23:47 -07:00
Zackery Spytz dea3223740
bpo-37674: Tweak imp module deprecation note in the docs (GH-20480) 2020-06-13 10:35:08 -07:00
Antoine a6ac239162
Minor change on threading.Thread.native_id documentation. (GH-18129)
Remove duplication in `threading.Thread.native_id` documentation, so resulting documentation is more consistent with the `threading.Thread.ident`.

Issue initially raised [here](https://github.com/python/python-docs-fr/pull/1122#discussion_r369236634) (in French). 

No issue associated to this PR.

Automerge-Triggered-By: @csabella
2020-06-12 15:50:18 -07:00
Dennis Sweeney 3ee0e48b03
bpo-40890: Add `mapping` property to dict views (GH-20749) 2020-06-12 10:19:25 -07:00
Géry Ogam e2fb8a2c42
Update lexical_analysis.rst (GH-17508)
Use Sphinx role markup for `str.format`.

Automerge-Triggered-By: @csabella
2020-06-12 05:54:29 -07:00
native-api 2145c8c972
bpo-33944: site: Add site-packages tracing in verbose mode (GH-12110) 2020-06-12 15:20:11 +09:00
Pablo Galindo 1ed83adb0e
bpo-40939: Remove the old parser (GH-20768)
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
2020-06-11 17:30:46 +01:00
Victor Stinner 311110abcd
bpo-40275: Move TransientResource to test_urllib2net (GH-20812)
Move TransientResource, time_out, socket_peer_reset and
ioerror_peer_reset from test.support to test_urllib2net.

Remove "import errno" from test.support.
2020-06-11 18:26:23 +02:00
Hai Shi 10e6506aa8
bpo-40275: Add warnings_helper submodule in test.support (GH-20797) 2020-06-11 17:36:06 +02:00
Hai Shi 7f888c7ef9
bpo-40275: Add import_helper submodule in test.support (GH-20794) 2020-06-11 01:51:18 +02:00
Daniel Fortunov 1642c0ef75
bpo-40895: Update weakref documentation to remove old warnings (GH-20687)
The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the `WeakKeyDictionary` and `WeakValueDictionary` are susceptible to the problem of dictionary mutation during iteration.

These notes present the user with a problem that has no easy solution.

I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an `_IterationGuard` context manager to the implementation, which delays mutation while an iteration is in progress.

I asked for confirmation and @pitrou agreed that these notes could be removed:
c1baa601e2 (commitcomment-39514438)
2020-06-10 13:26:49 -07:00
Serhiy Storchaka ec88e1bca8
bpo-36543: Revert "bpo-36543: Remove the xml.etree.cElementTree module." (GH-20117)
* Revert "bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)"

This reverts commit b33e52511a.
2020-06-10 17:39:12 +02:00
Hai Shi 0d00b2a5d7
bpo-40275: Add os_helper submodule in test.support (GH-20765) 2020-06-10 14:29:02 +02:00
Éric Araujo 7aed0524d4
bpo-34003: Re-add versionchanged entry in csv docs (GH-20657)
Follow-up to GH-8014
2020-06-09 18:02:11 -07:00
Stefan Krah 323188360d
Remove reference to 3.7 and 3.8 backports. (GH-20754) 2020-06-09 10:27:45 +02:00
Brett Cannon 3ab3475c42
bpo-24914: mention Python supports multiple paradigms in the FAQ (#20658) 2020-06-08 11:07:29 -07:00
Victor Stinner 5edb83241f
bpo-40854: PYTHONPLATLIBDIR env var added to 3.9 (GH-20735) 2020-06-08 20:04:47 +02:00
Victor Stinner e81f6e687d
bpo-40910: Export Py_GetArgcArgv() function (GH-20721)
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().
2020-06-08 18:12:59 +02:00
Sandro Mani 8f023a2f66
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605) 2020-06-08 17:28:11 +02:00
Shantanu 301f0d4ff9
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in
this change going undocumented.
2020-06-08 16:11:44 +02:00
Lysandros Nikolaou 7633371dac
bpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)
Also added an example in shutil in order to make more clear how they are to be used.

Initially reported by Weinan Li on bpo.
2020-06-07 22:01:21 -07:00
Jason R. Coombs 161541ab45
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)
* Refresh importlib.metadata from importlib_metadata 1.6.1.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-06-05 16:34:16 -04:00
Victor Stinner dc24b8a2ac
bpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro (GH-20610)
In What's New in Python 3.10, propose Py_SET_SIZE(), Py_SET_REFCNT()
and Py_SET_TYPE() macros for backward compatibility with Python 3.9
and older.
2020-06-04 22:10:43 +02:00
Harsha Laxman 7a280197f4
Fix spacing in docs for tarfile (GH-20629)
Before
```
content.txt is 42 bytes in size and isa regular file.
folder is 420 bytes in size and isa directory.
magic is 4200 bytes in size and issomething else.
```

After:
```
content.txt is 42 bytes in size and is a regular file.
folder is 420 bytes in size and is a directory.
magic is 4200 bytes in size and is something else.
```

Automerge-Triggered-By: @orsenthil
2020-06-04 12:58:10 -07:00
Victor Stinner 59d3dce69b
bpo-40839: PyDict_GetItem() requires the GIL (GH-20580)
Calling PyDict_GetItem() without GIL held had been allowed for
historical reason. It is no longer allowed.
2020-06-02 14:03:25 +02:00
Victor Stinner 337d3103a2
bpo-40241: What's New in Python 3.9: opaque PyGC_Head (GH-20586) 2020-06-02 12:02:58 +02:00
Steve Dower fe5dd78182
Ensure correct version of Sphinx is used for Windows builds (GH-20582) 2020-06-01 22:17:23 +01:00
Huon Wilson 39de8e4b6f
bpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546) 2020-06-01 19:26:33 +02:00
Zackery Spytz c8966667bb
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570) 2020-06-01 16:43:56 +01:00
Pablo Galindo 2f172d8f15
bpo-17005: Move topological sort functionality to its own module (GH-20558)
The topological sort functionality that was introduced initially in the
functools module has been moved to a new graphlib module to
better accommodate the new tools and keep the original scope of the
functools module.
2020-06-01 00:41:14 +01:00
Lysandros Nikolaou 491a3d3a75
Fix typo in "What's new in Python 3.9" (GH-20559)
Automerge-Triggered-By: @pablogsal
2020-05-31 16:28:46 -07:00
Batuhan Taskaya cf88871d6a
bpo-40759: Deprecate the symbol module (GH-20364)
Automerge-Triggered-By: @pablogsal
2020-05-31 15:01:50 -07:00
Raymond Hettinger b7d79b4f36
bpo-40755: Add rich comparisons to Counter (GH-20548) 2020-05-31 14:57:42 -07:00
Kyle Stanley 2b201369b4
Fix asyncio.to_thread() documented return type (GH-20547)
When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.
2020-05-31 00:07:04 -07:00
Batuhan Taskaya 007bb06a2d
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541) 2020-05-30 15:15:06 -07:00
Florian Dahlitz 735d902b36
bpo-40798: Generate a different message for already removed elements (GH-20483) 2020-05-30 09:47:32 +02:00
Samuel Gaist 4649202ea7
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Reference to PySide has been removed has it is for Qt 4, which has reached end of life.
2020-05-29 20:57:03 -05:00
Niklas Fiekas 8bd216dfed
bpo-29882: Add an efficient popcount method for integers (#771)
* bpo-29882: Add an efficient popcount method for integers

* Update 'sign bit' and versionadded in docs

* Add entry to whatsnew document

* Doc: use positive example, mention population count

* Minor cleanups of the core code

* Move popcount_digit closer to where it's used

* Use z instead of self after conversion

* Add 'absolute value' and 'population count' to docstring

* Fix clinic error about missing summary line

* Ensure popcount_digit is portable with 64-bit ints

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2020-05-29 17:28:02 +01:00
Windson yang 2831642212
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509) 2020-05-29 07:35:34 -04:00
Ruaridh Williamson 5e0ed8abc9
Note the output ordering of combinatoric functions (GH-19732) 2020-05-28 12:56:43 -07:00
Ramil Nugmanov cfc6ce4d40
bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492) 2020-05-28 09:46:22 -07:00
Michał Górny 242d95659b
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Try to make the meaning of platlibdir clear.  The previous wording could
be misinterpreted to suggest that it will be used to find all shared
libraries on the system, and not just Python extensions.  Furthermore,
it was unclear whether it affects third-party (site-packages) extensions
or not.  The new wording tries to make its dual purpose clear,
and provide the additional example of extensions in site-packages.
2020-05-28 18:33:04 +02:00
Victor Stinner fda7f6d61b
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
Update What's New in Python 3.9.

PyThreadState_DeleteCurrent was not removed, but excluded from the limited C API.
2020-05-28 18:26:01 +02:00
Raymond Hettinger 60398512c8
bpo-40755: Add missing multiset operations to Counter() (GH-20339) 2020-05-28 08:35:46 -07:00
Hai Shi 24bddc1b3b
bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
Replace test.support.TESTFN_ENCODING with sys.getfilesystemencoding().
2020-05-28 16:24:39 +02:00
Serhiy Storchaka 5f4b229df7
bpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH-20443)
Previously, the result could have been an instance of a subclass of int.

Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.

Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().
2020-05-28 10:33:45 +03:00
Adorilson Bezerra eaca2aa117
Improve IO tutorial's "Old string formatting" section (GH-16251)
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.


Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-05-27 21:34:01 -04:00
Elazar Gershuni 56853d8ec6
bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473) 2020-05-28 02:41:24 +02:00
Hai Shi e80697d687
bpo-40275: Adding threading_helper submodule in test.support (GH-20263) 2020-05-28 00:10:27 +02:00
YoSTEALTH 76ef255bde
bpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336) 2020-05-27 23:32:22 +02:00
Christian Heimes db5aed931f
bpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)
hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.

Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c.
2020-05-27 21:50:06 +02:00
Victor Stinner fe2978b3b9
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
Convert Py_REFCNT() and Py_SIZE() macros to static inline functions.
They cannot be used as l-value anymore: use Py_SET_REFCNT() and
Py_SET_SIZE() to set an object reference count and size.

Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size
in arraymodule.c.

This change is backward incompatible on purpose, to prepare the C API
for an opaque PyObject structure.
2020-05-27 14:55:10 +02:00
Mark Dickinson 20941de0dd
bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
* Fix outdated __int__ and nb_int references in comments

* Also update C-API documentation

* Add back missing 'method' word

* Remove .. deprecated notices
2020-05-27 13:43:17 +01:00
Pablo Galindo 1cf15af9a6 bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.

This reverts commit 0169d3003b.

Automerge-Triggered-By: @encukou
2020-05-27 02:03:38 -07:00
Ethan Steinberg 21fda91f8d
bpo-40611: Adds MAP_POPULATE to the mmap module (GH-20061)
MAP_POPULATE constant has now been added to the list of exported
mmap module flags.
2020-05-26 23:42:18 +02:00
Serhiy Storchaka 578c3955e0
bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
Only __index__ should be used to make integer conversions lossless.
2020-05-26 18:43:38 +03:00
Zackery Spytz af7553ac95
bpo-39301: State that floor division is used for right shift operations (GH-20347)
* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"
2020-05-26 09:16:34 +01:00
Serhiy Storchaka 1c5d1d7304
Remove duplicated words words (GH-20413) 2020-05-26 01:04:14 -07:00
ziheng 2b0e654f91
bpo-40745: Fix typos in NewType docs (GH-20379) 2020-05-25 21:45:35 -07:00
sth 4a0ac42c52
closes bpo-40774: Fix docs indentation for asyncio.create_subprocess_shell() (GH-20403) 2020-05-25 23:08:40 -05:00
Rotuna 448325369f
bpo-23082: Better error message for PurePath.relative_to() from pathlib (GH-19611)
Co-authored-by: Sadhana Srinivasan <rotuna@Sadhanas-MBP.fritz.box>
2020-05-25 20:42:28 +01:00
Dong-hee Na ad3252bad9
bpo-39573: Convert Py_TYPE() to a static inline function (GH-20290) 2020-05-26 01:52:54 +09:00
Miro Hrončok e50883ccc4
bpo-39245: Fix docs links to the stable ABI (GH-20388)
Automerge-Triggered-By: @vstinner
2020-05-25 08:42:48 -07:00
Miro Hrončok ef16958d17
bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383) 2020-05-25 16:54:14 +02:00
Jakub Stasiak 372ee27d49
bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832) 2020-05-25 10:03:48 +03:00
Albert 59f5022b5d
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661)
Closes [Issue 17050]() by removing argparse.REMAINDER from the documentation, as discussed on the issue.

Automerge-Triggered-By: @rhettinger
2020-05-24 11:57:40 -07:00
Bar Harel 13206b52d1
bpo-40405: Fix asyncio.as_completed docs (GH-19753)
* Fix as_completed docs to correctly state the function return value.
* Also, improves the general wording of the as_completed documentation.

Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
2020-05-23 19:14:31 -04:00
Shantanu 1cba1c9aba
bpo-34556: Document addition of upgrade_deps to venv.create (GH-20135) 2020-05-23 02:58:50 -07:00
Matteo Bertucci af23f0d3cf
bpo-40439: Update broken link in lexical analysis docs (GH-20184)
Automerge-Triggered-By: @csabella
2020-05-22 18:12:09 -07:00
Sardorbek Imomaliev 8022eb4e97
[doc] Add missing space in urllib.request.rst (GH-19860)
This is just a typo fix, should I still provide news file?
2020-05-22 18:05:05 -07:00
Ville Skyttä da51ba442c
Cosmetic smtplib changes (GH-8718)
Some cosmetic smtplib changes here. Let me know if you'd like a bpo/news entry or splitting this PR into two.

Automerge-Triggered-By: @maxking
2020-05-22 17:50:58 -07:00
Antoine 6fad3e6b49
bpo-40552 Add 'users' variable in code sample (tutorial 4.2). (GH-19992)
* Add 'users' variable in code sample.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-05-22 21:29:34 -03:00
Florian Dahlitz 30d5a7364d
bpo-40730: Remove redundant 'to' (GH-20316)
@ericvsmith I guess it is correct to merge it into master and not 3.9 directly?

Automerge-Triggered-By: @ericvsmith
2020-05-22 08:19:18 -07:00
Huon Wilson 8b62644831
bpo-40630: Add tracemalloc.reset_peak (GH-20102)
The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent `tracemalloc.start()` or
tracemalloc.clear_traces()` call).
2020-05-22 16:18:51 +02:00
Raymond Hettinger bfaf5275ad
Restore missing column of digits (GH-20313) 2020-05-22 06:54:42 -07:00
Andre Delfino 7864f11cdf
[doc] Remove references to obsolete BuildApplet on macOS. (GH-20023) 2020-05-21 18:45:23 -04:00
Mathieu Dupuy 2e76820a50
Reword aware/naive introduction sentence (GH-20175)
This is more informative and avoids the question of whether the period should go inside or outside the quotation marks.

See also GH-20007.
2020-05-21 16:26:27 -04:00
Raymond Hettinger e16d2f7c37
Improve output summary in the examples and recipes section (GH-20285) 2020-05-21 01:37:38 -07:00
Kyle Stanley 0f56263e62
bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)
Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143#discussion_r427808225) in GH-20143 for context.

Automerge-Triggered-By: @aeros
2020-05-20 22:20:43 -07:00
Rémi Lapeyre 7efb826c3e
Use f-strings in argparse HOWTO (GH-20070) 2020-05-20 21:22:59 -07:00
Raymond Hettinger df2e0ff0d6
Update whatsnew benchmark results for 3.9 (GH-20276) 2020-05-20 18:43:51 -07:00
Christian Heimes e572c7f6db
bpo-40698: Improve distutils upload hash digests (GH-20260)
- Fix upload test on systems that blocks MD5
- Add SHA2-256 and Blake2b-256 digests based on new Warehous and twine
  specs.

Signed-off-by: Christian Heimes <christian@python.org>
2020-05-20 07:37:25 -07:00
karl ding 550f30c8f3
bpo-40291: Mention socket.CAN_J1939 in What's New (GH-20248)
This mentions the new CAN_J1939 implementation in the What's New
documentation for Python 3.9

Automerge-Triggered-By: @gvanrossum
2020-05-19 19:31:49 -07:00
Joe DeCapo a355a06fcc
Fix typo in multiprocessing documentation (GH-20016) 2020-05-19 20:07:09 +05:30
Julien Palard 19e3e00264
Doc: Python 3.10 in sidebar and version switcher. (GH-20209) 2020-05-19 14:26:43 +02:00
Ned Deily 29251b787b
3.10 whatsnew needs to use blurb-produced changelog (GH-20213) 2020-05-19 07:39:29 -04:00
Kyle Stanley cc2bbc2227
bpo-32309: Implement asyncio.to_thread() (GH-20143)
Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410#issuecomment-628930973) in GH-18410 for context.

Automerge-Triggered-By: @aeros
2020-05-18 20:03:28 -07:00
Pablo Galindo d4fe098d1e
Python 3.10.0a0 (GH-20198) 2020-05-19 03:33:01 +01:00
Anthony Sottile 9095f76613
Fix code-block in zoneinfo (GH-20201)
```
Warning, treated as error:
/tmp/code/Doc/library/zoneinfo.rst:303:Error in "code-block" directive:
1 argument(s) required, 0 supplied.

.. code-block::

    >>> a = ZoneInfo("Europe/Berlin")
    >>> b = pickle.loads(europe_berlin_pkl)
    >>> a is b
    True
```
2020-05-18 19:02:54 -07:00
Serhiy Storchaka 08b47c367a
bpo-40257: Revert changes to inspect.getdoc() (GH-20073) 2020-05-18 20:25:07 +03:00
Ned Deily 951ab58024
Revert "bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)" (GH-20182)
This reverts commit 0da5466650.

The commit is causing make failures on a FreeBSD buildbot.
Due to the imminent 3.9.0b1 cutoff, revert this commit for
now pending further investigation.
2020-05-18 11:31:21 -04:00
Lumír 'Frenzy' Balhar adc72bb2f9
bpo-38112: Document that compileall.compile_[dir,file] also accept multiple opt levels (GH-20174) 2020-05-18 15:23:37 +02:00
Ned Deily 0da5466650
bpo-26317: Support OBJC and OBJCXX configure command line variables (GH-20176)
Add support to the configure script for OBJC and OBJCXX command line options so that the macOS builds can use the clang compiler for the macOS-specific Objective C source files. This allows third-party compilers, like GNU gcc, to be used to build the rest of the project since some of the Objective C system header files are not compilable by GNU gcc.

Co-authored-by: Jeffrey Kintscher <websurfer@surf2c.net>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-18 09:17:22 -04:00
Shantanu d17f3d8315
bpo-13601: Mention stderr's line buffering in What's New (GH-20168) 2020-05-17 22:07:57 -07:00
qudongfang bb8635cc3b
bpo-40651: Improve LRU recipe in the OrderedDict documentation (GH-#20139) 2020-05-17 20:50:51 -07:00
Paul Ganssle e527ec8abe
bpo-40536: Add zoneinfo.available_timezones (GH-20158)
This was not specified in the PEP, but it will likely be a frequently requested feature if it's not included.

This includes only the "canonical" zones, not a simple listing of every valid value of `key` that can be passed to `Zoneinfo`, because it seems likely that that's what people will want.
2020-05-17 21:55:11 -04:00
Rahul Kumaresan eefd4e0333
bpo-39705 : sorted() tutorial example under looping techniques improved (GH-18999) 2020-05-17 18:32:34 -07:00
Mathieu Dupuy 65460565df
Doc: change 'Posix' for 'POSIX' (GH-20001) 2020-05-17 23:29:51 +02:00
Mathieu Dupuy 4eba67783e
Doc: move a dot outside double quotes (GH-20007) 2020-05-17 23:24:59 +02:00
Zackery Spytz 46545000c2
bpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145)
Patch by Zackery Spytz.
2020-05-17 03:52:47 -07:00
Christian Heimes 837f9e42e3
bpo-40645: Deprecated internal details of hmac.HMAC (GH-20132) 2020-05-17 01:05:40 +02:00
Batuhan Taskaya cae2275949
bpo-40211: Clarify os.preadv and os.pwritev are supported on AIX 7.1+ (GH-19401) 2020-05-16 23:36:40 +01:00
Christian Heimes d5b3f6b7f9
bpo-37630: Use SHA3 and SHAKE XOF from OpenSSL (GH-16049)
OpenSSL 1.1.1 comes with SHA3 and SHAKE builtin.

Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-05-16 13:27:06 -07:00
Paul Ganssle b17e49e0de
bpo-40503: Add documentation and what's new entry for zoneinfo (GH-20006)
This adds the documentation for the `zoneinfo` module added in PEP 615: https://www.python.org/dev/peps/pep-0615/

The implementation itself was GH-19909: https://github.com/python/cpython/pull/19909

bpo-40503: https://bugs.python.org/issue40503

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-16 12:14:58 -04:00
Paul Ganssle 1b97b9b0ad
bpo-24416: Return named tuple from date.isocalendar() (GH-20113)
{date, datetime}.isocalendar() now return a private custom named tuple object
IsoCalendarDate rather than a simple tuple.

In order to leave IsocalendarDate as a private class and to improve what
backwards compatibility is offered for pickling the result of a
datetime.isocalendar() call, add a __reduce__ method to the named tuples that
reduces them to plain tuples. (This is the part of this PR most likely to cause
problems — if it causes major issues, switching to a strucseq or equivalent
would be prudent).

The pure python implementation of IsoCalendarDate uses positional-only
arguments, since it is private and only constructed by position anyway; the
equivalent change in the argument clinic on the C side would require us to move
the forward declaration of the type above the clinic import for whatever
reason, so it seems preferable to hold off on that for now.

bpo-24416: https://bugs.python.org/issue24416

Original PR by Dong-hee Na with only minor alterations by Paul Ganssle.

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-05-16 10:02:59 -04:00
Batuhan Taskaya 4541086232
bpo-40192: Use thread_cputime for time.thread_time to improve resolution (GH-19381)
On AIX, time.thread_time() is now implemented with thread_cputime()
which has nanosecond resolution, rather than
clock_gettime(CLOCK_THREAD_CPUTIME_ID) which has a resolution of 10 ms.
2020-05-16 11:39:09 +02:00
Zackery Spytz 6b6092f533
bpo-39075: types.SimpleNamespace no longer sorts attributes in its repr (GH-19430) 2020-05-15 18:27:54 -07:00
Chris Jerdonek 1ce5841eca
bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979) 2020-05-15 16:55:50 -07:00
Christian Heimes 9b60e55db2
bpo-40637: Add option to disable builtin hashes (GH-20121)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-05-15 14:54:53 -07:00
Shantanu a2b3cdd661
bpo-40445: Update compileall.compile_dir docs (GH-19806) 2020-05-15 14:28:23 -07:00
romasku 382a5635bd
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
Currently, if asyncio.wait_for() timeout expires, it cancels
inner future and then always raises TimeoutError. In case
those future is task, it can handle cancelation mannually,
and those process can lead to some other exception. Current
implementation silently loses thoses exception.

To resolve this, wait_for will check was the cancelation
successfull or not. In case there was exception, wait_for
will reraise it.

Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
2020-05-15 13:12:05 -07:00
Joannah Nanjekye 7ba1f75f3f
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047)
* Document exec symbol for codeop.compile_command

* Remove extra statements

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
2020-05-14 21:59:46 -03:00
Lumír 'Frenzy' Balhar e77d428856
bpo-40495: compileall option to hardlink duplicate pyc files (GH-19901)
compileall is now able to use hardlinks to prevent duplicates in a
case when .pyc files for different optimization levels have the same content.

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-14 16:17:22 +02:00
Victor Stinner d6fb53fe42
bpo-39465: Remove _PyUnicode_ClearStaticStrings() from C API (GH-20078)
Remove the _PyUnicode_ClearStaticStrings() function from the C API.
Make the function fully private (declare it with "static").
2020-05-14 01:11:54 +02:00
jack1142 de92769d47
bpo-34790: add version of removal of explicit passing of coros to `asyncio.wait`'s documentation (#20008) 2020-05-13 11:55:12 -07:00
Allen Guo 3d54211e6e
Fix Wikipedia link (GH-20031) 2020-05-12 19:54:18 -03:00
Raymond Hettinger 21cdb711e3
bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019) 2020-05-11 17:00:53 -07:00
Hai Shi 86d69444e7
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset (GH-20026) 2020-05-11 23:38:55 +02:00
Inada Naoki d5d9a71866
bpo-36346: array: Don't use deprecated APIs (GH-19653)
* Py_UNICODE -> wchar_t
* Py_UNICODE -> unicode in Argument Clinic
* PyUnicode_AsUnicode -> PyUnicode_AsWideCharString
* Don't use "u#" format.

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-11 15:37:25 +09:00
Andre Delfino 85bdec1def
Add link to Enum class (GH-19884) 2020-05-10 10:45:54 +05:30
Jason R. Coombs 7f7e706d78
bpo-39791: Add files() to importlib.resources (GH-19722)
* bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5).

* 📜🤖 Added by blurb_it.

* Add some documentation about the new objects added.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-05-08 19:20:26 -04:00
Raymond Hettinger 81a5fc38e8
bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970) 2020-05-08 07:53:15 -07:00
Ned Batchelder 2effef7453
Make the first dataclass example more useful (GH-19994) 2020-05-08 04:39:57 -07:00
Zackery Spytz 02fa0ea9c1
bpo-40273: Reversible mappingproxy (FH-19513) 2020-05-07 22:25:50 -07:00
Batuhan Taskaya b7a78ca74a
bpo-40517: Implement syntax highlighting support for ASDL (GH-19967) 2020-05-07 13:57:26 -07:00
Hai Shi c068b53a0c
bpo-38787: Update structures.rst docs (PEP 573) (GH-19980) 2020-05-07 19:16:01 +02:00
Petr Viktorin e1becf46b4
bpo-38787: C API for module state access from extension methods (PEP 573) (GH-19936)
Module C state is now accessible from C-defined heap type methods (PEP 573).
Patch by Marcel Plch and Petr Viktorin.

Co-authored-by: Marcel Plch <mplch@redhat.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-07 15:39:59 +02:00
Naglis 441416c9a0
Fix typo in sqlite3 documentation (GH-19965)
*first* is repeated twice.
2020-05-06 16:51:43 -03:00
Raymond Hettinger eff870b618
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#19928)" (#19950)
This reverts commit d60040ba22.
2020-05-05 22:33:55 -07:00
Batuhan Taskaya d60040ba22
bpo-40517: Implement syntax highlighting support for ASDL (#19928) 2020-05-05 22:24:39 -07:00
Javier Buzzi 627f701235
bpo-32117: Updated Simpsons names in docs (GH-19737)
`sally` is not a Simpsons character

Automerge-Triggered-By: @gvanrossum
2020-05-05 07:49:57 -07:00
Raymond Hettinger f01d1be97d
bpo-40286: Put methods in correct sections. Add security notice to use secrets for session tokens. (GH-19870) 2020-05-04 22:52:13 -07:00
Joel Rosdahl 9d74658f0a
bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)
A similar formulation was added in bpo-21596
(db74d982d4) but was lost in bpo-33649
(3faaa8857a).
2020-05-04 14:56:00 -07:00
Joannah Nanjekye f25fb6ebfe
bpo-39470: Indicate that ``os.makedirs`` is equivalent to ``Path.mkdir`` (GH-18216)
* Indicate os.makedirs is equivalent to Path.mkdir

* 📜🤖 Added by blurb_it.

* ignore news feed

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-05-04 16:47:03 -03:00
Miro Hrončok 18f1c60a16
bpo-40360: Add a What's New entry for lib2to3 pending deprecation (GH-19898) 2020-05-04 12:02:00 -07:00
Raymond Hettinger ad9eaeab74
Remove outdated and confusing advice about setting maxsize (GH-19889) 2020-05-03 16:45:13 -07:00
Mathieu Dupuy 8aab84312e
Fix missing space in docs(GH-19866) 2020-05-02 16:50:47 -07:00
Raymond Hettinger 190fac99c5
bpo-40465: Deprecate the optional argument to random.shuffle(). (#19867) 2020-05-02 16:45:32 -07:00
Sander 766352320f
bpo-40419: timeit CLI docs now mention 1,2,5,10,... trials instead of powers of 10 (GH-19752) 2020-05-02 19:12:05 +03:00
Serhiy Storchaka 531d1e5412
bpo-39435: Make the first argument of pickle.loads() positional-only. (GH-19846)
It was positional-only de facto: documentation and two implementations
used three different name.
2020-05-02 09:38:01 +03:00
Shantanu 289842ae82
bpo-39435: Fix docs for pickle.loads (GH-18160) 2020-05-01 12:46:01 -07:00
Shantanu 831d58d786
bpo-39691: Clarify io.open_code behavior (GH-19824) 2020-05-01 18:52:10 +01:00
Victor Stinner 252346acd9
bpo-40453: Add PyConfig._isolated_subinterpreter (GH-19820)
An isolated subinterpreter cannot spawn threads, spawn a child
process or call os.fork().

* Add private _Py_NewInterpreter(isolated_subinterpreter) function.
* Add isolated=True keyword-only parameter to
  _xxsubinterpreters.create().
* Allow again os.fork() in "non-isolated" subinterpreters.
2020-05-01 11:33:44 +02:00
Noah Doersing 8bcfd31cc0
Change 'exception happened' to 'exception occurred' in two places (#19767) 2020-04-30 21:30:10 -07:00
lrjball 3209cbd99b
bpo-40394 - difflib.SequenceMatched.find_longest_match default args (GH-19742)
* bpo-40394 - difflib.SequenceMatched.find_longest_match default args

Added default args to find_longest_match, as well as related tests.
2020-04-29 22:42:45 -05:00
karl ding 360371f79c
bpo-40291: Add support for CAN_J1939 sockets (GH-19538)
Add support for CAN_J1939 sockets that wrap SAE J1939 protocol
functionality provided by Linux 5.4+ kernels.
2020-04-29 15:31:19 -07:00
Alex Povel fd33cdbd05
Fix plural typo in documentation (GH-19799)
Co-authored-by: Alex Povel <python@alexpovel.de>
2020-04-29 19:17:12 -03:00
Victor Stinner e5963ee320
What's New in Python 3.9: Reorganize C API Changes (GH-19794)
Move Build Changes and C API Changes to the end of the document.
Most Python users don't build Python themselves and don't use the C
API. Other changes:

* Add Build Changes section
* Add sub-sections to the C API Changes
* Sort modules in Improved Modules section: move nntplib after
  multiprocessing
2020-04-29 17:57:25 +02:00
Victor Stinner 9a8c1315c3
bpo-40428: Cleanup free list part of C API Changes doc (GH-19793) 2020-04-29 16:56:30 +02:00
Serhiy Storchaka bfb1cf4465
bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711) 2020-04-29 10:36:20 +03:00
Zackery Spytz bb4a585d90
bpo-40428: Remove references to Py*_ClearFreeList in the docs (GH-19783)
They were removed from the C API in commit
ae00a5a885.
2020-04-29 04:41:56 +02:00
Victor Stinner 7036477323
bpo-40421: Add PyFrame_GetBack() function (GH-19765)
New PyFrame_GetBack() function: get the frame next outer frame.

Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.
2020-04-29 03:28:46 +02:00
Victor Stinner 4386b9045e
bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781)
The PyThreadState_GetFrame() function now returns a strong reference
to the frame.
2020-04-29 03:01:43 +02:00
Victor Stinner ae00a5a885
bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769)
Remove the following function from the C API:

* PyAsyncGen_ClearFreeLists()
* PyContext_ClearFreeList()
* PyDict_ClearFreeList()
* PyFloat_ClearFreeList()
* PyFrame_ClearFreeList()
* PyList_ClearFreeList()
* PySet_ClearFreeList()
* PyTuple_ClearFreeList()

Make these functions private, move them to the internal C API and
change their return type to void.

Call explicitly PyGC_Collect() to free all free lists.

Note: PySet_ClearFreeList() did nothing.
2020-04-29 02:29:20 +02:00
Victor Stinner 8852ad4208
bpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773) 2020-04-29 01:28:13 +02:00
Victor Stinner 6d86a2331e
bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772)
Add frame_nslots() to factorize duplicate code.
2020-04-29 00:56:58 +02:00
Ethan Onstott d9a43e20fa
bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098)
require `_generate_next_value_` to be defined before members
2020-04-28 10:20:55 -07:00
Victor Stinner a42ca74fa3
bpo-40421: Add PyFrame_GetCode() function (GH-19757)
PyFrame_GetCode(frame): return a borrowed reference to the frame
code.

Replace frame->f_code with PyFrame_GetCode(frame) in most code,
except in frameobject.c, genobject.c and ceval.c.

Also add PyFrame_GetLineNumber() to the limited C API.
2020-04-28 19:01:31 +02:00
Victor Stinner 7c59d7c986
bpo-40421: Add pyframe.h header file (GH-19755)
Add a new separated pyframe.h header file of the PyFrame public C
API: it is included by Python.h.

Add PyFrame_GetLineNumber() to the limited C API.

Replace "struct _frame" with "PyFrameObject" in header files.
PyFrameObject is now defined as struct _frame by pyframe.h which is
included early enough in Python.h.
2020-04-28 16:32:48 +02:00
Victor Stinner 9adccc1384
bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)
Add a new close() method to multiprocessing.SimpleQueue to explicitly
close the queue.

Automerge-Triggered-By: @pitrou
2020-04-27 09:11:10 -07:00
Dong-hee Na c5c42815ec
bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712) 2020-04-27 23:52:55 +09:00
Zackery Spytz caf1aadf3d
bpo-40348: Fix typos in the programming FAQ (GH-19729) 2020-04-26 20:23:52 -07:00
Brad Solomon b54e46cb57
bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607)
Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs.

Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvar#c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`.

Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.
2020-04-26 21:31:44 -05:00
Raymond Hettinger 88499f15f5
bpo-40387: Improve queue join() example. (GH-19724) 2020-04-26 18:11:27 -07:00
Heshy Roskes ef33712baa
Fix typo in object.__format__ docs (GH-19504) 2020-04-25 21:57:09 -04:00
Serhiy Storchaka 515fce4fc4
bpo-40275: Avoid importing logging in test.support (GH-19601)
Import logging lazily in assertLogs() in unittest.
Move TestHandler from test.support to logging_helper.
2020-04-25 11:35:18 +03:00
Serhiy Storchaka 16994912c9
bpo-40275: Avoid importing socket in test.support (GH-19603)
* Move socket related functions from test.support to socket_helper.
* Import socket, nntplib and urllib.error lazily in transient_internet().
* Remove importing multiprocess.
2020-04-25 10:06:29 +03:00
Cajetan Rodrigues d4f3923d59
bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) 2020-04-25 07:27:53 +02:00
Guido van Rossum 0e80b561d4
bpo-40334: Add What's New sections for PEP 617 and PEP 585 (GH-19704) 2020-04-24 17:19:56 -07:00
Cajetan Rodrigues 5aafa54879
bpo-40340: Separate examples more clearly in the programming FAQ (GH-19688) 2020-04-24 19:39:04 -04:00
Carl Meyer 503de7149d
bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663)
Deprecate lib2to3 module in light of PEP 617.

We anticipate removal in the 3.12 timeframe.
2020-04-24 11:19:46 -07:00
Victor Stinner e6f8abd500
bpo-38061: subprocess uses closefrom() on FreeBSD (GH-19697)
Optimize the subprocess module on FreeBSD using closefrom().
A single close(fd) syscall is cheap, but when sysconf(_SC_OPEN_MAX)
is high, the loop calling close(fd) on each file descriptor can take
several milliseconds.

The workaround on FreeBSD to improve performance was to load and
mount the fdescfs kernel module, but this is not enabled by default.

Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
(kevans) and Kubilay Kocak (koobs):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
2020-04-24 12:06:58 +02:00
Victor Stinner d663d34685
bpo-39983: Add test.support.print_warning() (GH-19683)
Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().
2020-04-23 19:03:52 +02:00
Victor Stinner 1def7754b7
bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
  in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
  _testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
2020-04-23 03:03:24 +02:00
Pablo Galindo c5fc156852
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-04-22 23:29:27 +01:00
sweeneyde a81849b031
bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)
Added str.removeprefix and str.removesuffix methods and corresponding
bytes, bytearray, and collections.UserString methods to remove affixes
from a string if present. See PEP 616 for a full description.
2020-04-22 23:05:48 +02:00
Batuhan Taşkaya 4454057269
bpo-39562: Prevent collision of future and compiler flags (GH-19230)
The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION.
2020-04-22 18:09:03 +02:00
Raymond Hettinger d3a8d616fa
Small improvements to the recipes and examples. (GH-19635)
* Add underscores to long numbers to improve readability
* Use bigger dataset in the bootstrapping example
* Convert single-server queue example to more useful multi-server queue
2020-04-21 16:11:00 -07:00
Kyle Stanley 9c82ea7868
bpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634)
Co-Authored-By: Victor Stinner <vstinner@python.org>
2020-04-21 16:50:51 -04:00
Tim Hoffmann 8aea4b3605
bpo-40148: Add PurePath.with_stem() (GH-19295)
Add PurePath.with_stem()
2020-04-19 17:29:49 +02:00
Kyle Stanley 1ac6e37929
bpo-39207: Spawn workers on demand in ProcessPoolExecutor (GH-19453)
Roughly based on 904e34d4e6, but with a few substantial differences.

/cc @pitrou @brianquinlan
2020-04-19 07:00:59 -07:00
Tim Lo c12375aa0b
bpo-39285: Clarify example for PurePath.match (GH-19458)
Fixes Issue39285

The example incorrectly returned True for match.

Furthermore the example is ambiguous in its usage of PureWindowsPath.
Windows is case-insensitve, however the underlying match functionality
utilizes fnmatch.fnmatchcase.

Automerge-Triggered-By: @pitrou
2020-04-19 02:43:11 -07:00
Raymond Hettinger 4fe002045f
bpo-40325: Deprecate set object support in random.sample() (GH-19591) 2020-04-19 00:36:42 -07:00
Furkan Önder 482259d0dc
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
Automerge-Triggered-By: @pitrou
2020-04-18 11:09:09 -07:00
Serhiy Storchaka 2b5603140c
bpo-40178: Convert the remaining os functions to Argument Clinic. (GH-19360)
Convert os.getgrouplist(), os.initgroups(), os.sendfile() and
os.get_terminal_size().
2020-04-18 19:14:10 +03:00
Serhiy Storchaka 7e64414f57
bpo-40257: Improve help for the typing module (GH-19546)
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
2020-04-18 17:13:21 +03:00
Antoine Pitrou 75a3378810
bpo-40282: Allow random.getrandbits(0) (GH-19539) 2020-04-17 19:32:14 +02:00
Victor Stinner 1a1bd2e238
bpo-40302: Replace PY_INT64_T with int64_t (GH-19573)
* Replace PY_INT64_T with int64_t
* Replace PY_UINT32_T with uint32_t
* Replace PY_UINT64_T with uint64_t

sha3module.c no longer checks if PY_UINT64_T is defined since it's
always defined and uint64_t is always available on platforms
supported by Python.
2020-04-17 19:13:06 +02:00
Victor Stinner 9f5fe7910f
bpo-40286: Add randbytes() method to random.Random (GH-19527)
Add random.randbytes() function and random.Random.randbytes()
method to generate random bytes.

Modify secrets.token_bytes() to use SystemRandom.randbytes()
rather than calling directly os.urandom().

Rename also genrand_int32() to genrand_uint32(), since it returns an
unsigned 32-bit integer, not a signed integer.

The _random module is now built with Py_BUILD_CORE_MODULE defined.
2020-04-17 19:05:35 +02:00
Mariusz Felisiak 06a35542aa
bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551) 2020-04-17 17:02:47 +01:00
Raymond Hettinger bf1a81258c
Minor modernization and readability improvement to the tokenizer example (GH-19558) 2020-04-16 19:54:13 -07:00
Christoph Zwerschke a388bbd3f1
Fix parameter names in assertIn() docs (GH-18829)
The names "member" and "container" for the arguments are also used in the module and shown with the help() function, and are immediately understandable in this context, contrary to "first" and "second".
2020-04-16 18:54:53 -07:00
Raymond Hettinger 70f027dd22
bpo-40290: Add zscore() to statistics.NormalDist. (GH-19547) 2020-04-16 10:25:14 -07:00
Serhiy Storchaka fbf2786c4c
bpo-40257: Output object's own docstring in pydoc (GH-19479) 2020-04-15 23:00:20 +03:00
Hai Shi 675d9a3d7a
bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464) 2020-04-14 20:11:20 +02:00
Batuhan Taşkaya 990ea4200f
bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396) 2020-04-14 08:51:32 +09:00
Sebastian Pedersen a1a0eb4a39
bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048)
Add the encoding in ftplib.FTP and ftplib.FTP_TLS to the
constructor as keyword-only and change the default from "latin-1" to "utf-8"
to follow RFC 2640.
2020-04-14 01:07:56 +02:00
laike9m 85dd6bb1f6
Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) 2020-04-13 10:55:45 +08:00
Victor Stinner 14d5331eb5
bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)" (GH-19456)
This reverts commit 066e5b1a91.
2020-04-12 23:45:09 +02:00
mefistotelis 5fd8123dfd
bpo-39011: Preserve line endings within ElementTree attributes (GH-18468)
* bpo-39011: Preserve line endings within attributes

Line endings within attributes were previously normalized to "\n" in Py3.7/3.8.
This patch removes that normalization, as line endings which were
replaced by entity numbers should be preserved in original form.
2020-04-12 14:51:58 +02:00
Pablo Galindo 7ec43a7309
bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) 2020-04-11 03:05:37 +01:00
Pablo Galindo f13072b8a8
bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461)
Add the functions PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively.
2020-04-11 01:21:54 +01:00
Zackery Spytz 97e0de04b8
bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)
Co-Authored-By: Stefan Tatschner <stefan@rumpelsepp.org>
2020-04-09 13:03:49 +01:00
Rémi Lapeyre 74e1b6b100
Document missing methods of ssl.SSLObject (#19400)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-04-07 09:38:59 +02:00
amaajemyfren 8ea10a9446
closes bpo-40166: Change Unicode Howto so that it does not have a specific number of assigned code points. (GH-19328)
Change the number of code points from a specific number to a link to the latest standard that has a description of how many code points there are.
2020-04-06 23:16:02 -05:00
Raymond Hettinger c63629e7c0
bpo-40197: Better describe the benchmark results table (GH-19386) 2020-04-05 18:53:06 -07:00
Mark Dickinson 810f68f128
Fix misinformation about NaN != NaN comparison (GH-19357) 2020-04-05 10:25:24 +01:00
Serhiy Storchaka 6fed3c8540
bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368) 2020-04-05 00:43:20 +03:00
Zackery Spytz bd6a4c3d72
bpo-40131: Fix source and target order in zipapp example (GH-19290) 2020-04-03 22:06:29 +05:30
laike9m b74468e233
bpo-40122: Updated documentation for dis.findlabels() (GH-19274) 2020-04-03 11:00:28 +03:00
Derek Keeler 45217af29c
bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131) 2020-04-02 12:00:21 -07:00
Victor Stinner 65a796e527
bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)
Add os.waitstatus_to_exitcode() function to convert a wait status to an
exitcode.

Suggest waitstatus_to_exitcode() usage in the documentation when
appropriate.

Use waitstatus_to_exitcode() in:

* multiprocessing, os, subprocess and _bootsubprocess modules;
* test.support.wait_process();
* setup.py: run_command();
* and many tests.
2020-04-01 18:49:29 +02:00
Zackery Spytz 975ac326ff
bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)
* bpo-33262: Deprecate passing None for `s` to shlex.split()

This reads the string to split from standard input.

* Update What's New.

* Fix shlex.rst
2020-04-01 09:58:55 -04:00
Victor Stinner 7c72383f95
bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) 2020-04-01 15:48:05 +02:00
Victor Stinner 278c1e159c
bpo-40094: Add test.support.wait_process() (GH-19254)
Moreover, the following tests now check the child process exit code:

* test_os.PtyTests
* test_mailbox.test_lock_conflict()
* test_tempfile.test_process_awareness()
* test_uuid.testIssue8621()
* multiprocessing resource tracker tests
2020-03-31 20:08:12 +02:00
Victor Stinner 400e1dbcad
Document most common signals (GH-19245)
Document individual signals (only the most common signals):
description, default action, availability.
2020-03-31 19:13:10 +02:00
Mathieu Dupuy c49016e67c
fix comma location in various places (GH-19233) 2020-03-30 14:28:25 -07:00
Zackery Spytz 676b105111
bpo-8901: Windows registry path is now ignored with the -E option (GH-18169) 2020-03-30 17:04:45 +01:00
Miro Hrončok 6467134307
bpo-36543: What's new: Document how to replace xml.etree.cElementTree (GH-19188) 2020-03-27 21:59:02 +02:00
Kyle Stanley b61b818d91
bpo-39812: Remove daemon threads in concurrent.futures (GH-19149)
Remove daemon threads from :mod:`concurrent.futures` by adding
an internal `threading._register_atexit()`, which calls registered functions
prior to joining all non-daemon threads. This allows for compatibility
with subinterpreters, which don't support daemon threads.
2020-03-27 20:31:22 +01:00
Javad Mokhtari 5f9c131c09
bpo-40045: Make "dunder" method documentation easier to locate (#19153)
* issue 40045

* Update lexical_analysis.rst

Make "dunder" method documentation easier(GH-19153)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-03-27 16:02:51 -03:00
Ammar Askar 5a58c5280b
bpo-38237: Use divmod for positional arguments whatsnew example (GH-19171) 2020-03-27 16:37:43 +00:00
Victor Stinner 71a3522ef8
bpo-38644: Make tstate more explicit inside pystate.c (GH-19182)
Fix PyInterpreterState_New(): Don't call PyErr_SetString() when there
is no current Python thread state (if tstate is NULL).
2020-03-26 22:46:14 +01:00
Lahfa Samy 59c644eaa7
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Co-authored-by: furkanonder <furkantahaonder@gmail.com>
2020-03-26 09:54:04 -05:00
Victor Stinner 5c3cda0d1a
bpo-39947: Add PyThreadState_GetID() function (GH-19163)
Add PyThreadState_GetID() function: get the unique identifier of a
Python thread state.
2020-03-25 21:23:53 +01:00
Brett Cannon 302e5a8f79
bpo-19698: Document when importlib.machinery.FrozenImporter gained spec-related methods (GH-19158) 2020-03-25 11:57:47 -07:00
Curtis Bucher 8f1ed21ecf
bpo-36144: Add union operators to WeakValueDictionary584 (#19127) 2020-03-24 18:51:29 -07:00
Juhana Jauhiainen 4b3252cb76
bpo-40013: Clarify documentation of restval in csv.DictReader (GH-19099) 2020-03-24 22:41:42 +05:30
Gregory P. Smith 9b8e74ca77
Clarify a guarantee of the logging module. (GH-19132)
When no additional arguments are passed to logging.debug() and related
methods, no % operation is performed on the passed in message.
2020-03-24 09:48:32 -07:00
Russell Owen 6000087fe9
closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-03-23 22:41:40 -05:00
laike9m 70d9d74411
Updated documentation for FOR_ITER (GH-19113)
Added a comma to make the sentence less confusing.
2020-03-24 09:03:06 +08:00
Curtis Bucher 25e580a73c
bpo-36144: Add union operators to WeakKeyDictionary (#19106) 2020-03-23 13:49:46 -07:00
Curtis Bucher f393b2c588
bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)
* Update ChainMap to include | and |=

Created __ior__, __or__ and __ror__ methods in ChainMap class.

* Update ACKS

* Update docs

* Update test_collections.py to include test_issue584().

Added testing for | and |= operators for ChainMap objects.

* Update test_union_operators

Renamed test_union operators, fixed errors and style problems raised by brandtbucher.

* Update test_union_operators in TestChainMap

Added testing for union operator between ChainMap and iterable of key-value pairs.

* Update test_union operators in test_collections.py

Gave more descriptive variable names and eliminated unnecessary tmp variable.

* Update test_union_operators in test_collections.py

Added cm3

* Check .maps rather than Chainmap equality.

* Add news entry

* Update Lib/test/test_collections.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>

* Removed whitespace

* Added Guido's changes

* Fixed Docs

* Removed whitespace

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2020-03-23 12:02:05 -07:00
Serhiy Storchaka bace59d8b8
bpo-39999: Improve compatibility of the ast module. (GH-19056)
* Re-add removed classes Suite, slice, Param, AugLoad and AugStore.
* Add docstrings for dummy classes.
* Add docstrings for attribute aliases.
* Set __module__ to "ast" instead of "_ast".
2020-03-22 20:33:34 +02:00
Dong-hee Na 05e4a296ec
bpo-40024: Add PyModule_AddType() helper function (GH-19088) 2020-03-22 17:17:34 +01:00
Serhiy Storchaka b146568dfc
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942) 2020-03-21 15:53:28 +02:00
Victor Stinner 6723e933c4
bpo-39946: Remove _PyThreadState_GetFrame (GH-19094)
Remove _PyRuntime.getframe hook and remove _PyThreadState_GetFrame
macro which was an alias to _PyRuntime.getframe. They were only
exposed by the internal C API. Remove also PyThreadFrameGetter type.
2020-03-20 17:46:56 +01:00
Victor Stinner fd1e1a18fa
bpo-39947: Add PyThreadState_GetFrame() function (GH-19092)
Add PyThreadState_GetFrame() function: get the current frame
of a Python thread state.
2020-03-20 15:51:45 +01:00
Victor Stinner d2a8e5b42c
bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter (GH-19087)
COMPUTE_EVAL_BREAKER() now also checks if the Python thread state
belongs to the main interpreter. Don't break the evaluation loop if
there are pending signals but the Python thread state it belongs to a
subinterpeter.

* Add _Py_IsMainThread() function.
* Add _Py_ThreadCanHandleSignals() function.
2020-03-20 13:38:58 +01:00
amaajemyfren 2de7ac9798
bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929)
Automerge-Triggered-By: @ned-deily
2020-03-20 01:03:18 -07:00
Mark Dickinson c691f20952
Fix "versionchanged" for pow named arguments (GH-19042)
The ability to use named arguments in "pow" was introduced in Python 3.8, not Python 3.9. See https://bugs.python.org/issue38237
2020-03-19 18:12:59 +00:00
Victor Stinner 5a3a71dddb
bpo-40010: Optimize signal handling in multithreaded applications (GH-19067)
If a thread different than the main thread gets a signal, the
bytecode evaluation loop is no longer interrupted at each bytecode
instruction to check for pending signals which cannot be handled.
Only the main thread of the main interpreter can handle signals.

Previously, the bytecode evaluation loop was interrupted at each
instruction until the main thread handles signals.

Changes:

* COMPUTE_EVAL_BREAKER() and SIGNAL_PENDING_SIGNALS() no longer set
  eval_breaker to 1 if the current thread cannot handle signals.
* take_gil() now always recomputes eval_breaker.
2020-03-19 17:40:12 +01:00
Victor Stinner 50e6e99178
bpo-39984: Move pending calls to PyInterpreterState (GH-19066)
If Py_AddPendingCall() is called in a subinterpreter, the function is
now scheduled to be called from the subinterpreter, rather than being
called from the main interpreter.

Each subinterpreter now has its own list of scheduled calls.

* Move pending and eval_breaker fields from _PyRuntimeState.ceval
  to PyInterpreterState.ceval.
* new_interpreter() now calls _PyEval_InitThreads() to create
  pending calls lock.
* Fix Py_AddPendingCall() for subinterpreters. It now calls
  _PyThreadState_GET() which works in a subinterpreter if the
  caller holds the GIL, and only falls back on
  PyGILState_GetThisThreadState() if _PyThreadState_GET()
  returns NULL.
2020-03-19 02:41:21 +01:00
Serhiy Storchaka 6b97598fb6
bpo-39988: Remove ast.AugLoad and ast.AugStore node classes. (GH-19038) 2020-03-17 23:41:08 +02:00
Victor Stinner 5b1ef200d3
bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738)
Extension modules: m_traverse, m_clear and m_free functions of
PyModuleDef are no longer called if the module state was requested
but is not allocated yet. This is the case immediately after the
module is created and before the module is executed (Py_mod_exec
function). More precisely, these functions are not called if m_size is
greater than 0 and the module state (as returned by
PyModule_GetState()) is NULL.

Extension modules without module state (m_size <= 0) are not affected.

Co-Authored-By: Petr Viktorin <encukou@gmail.com>
2020-03-17 18:09:46 +01:00
Zackery Spytz a45b695b9f
bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026)
PyObject_GenericSetDict() takes three arguments, not two.
2020-03-17 10:19:28 +02:00
Batuhan Taşkaya 4ab362cec6
bpo-39638: Keep ASDL signatures in the AST nodes (GH-18515) 2020-03-16 10:12:53 +02:00
Batuhan Taşkaya 8689209e03
bpo-39969: Remove ast.Param node class as is no longer used (GH-19020) 2020-03-15 19:32:17 +00:00
Ross 61ac612e78
bpo-39507: Add HTTP status 418 "I'm a Teapot" (GH-18291) 2020-03-15 14:24:23 +02:00
Борис Верховский 33238ec2af
Link to list of keywords in the laguage reference (GH-18024) 2020-03-14 21:09:15 +02:00
Taine Zhao 6672c16b1d
bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550) 2020-03-14 16:24:06 +02:00
Dong-hee Na da52be4769
bpo-39509: Update HTTP status code to follow IANA (GH-18294)
Add status codes 103 EARLY_HINTS and 425 TOO_EARLY.
2020-03-14 16:12:01 +02:00
Rahul Kumaresan 7a5cbc7298
bpo-39937: Improve suggestions for removal of getchildren and getiterator in changelog (GH-18937)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-03-14 11:20:24 +05:30
Victor Stinner 8fb02b6e19
bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)
Add PyThreadState_GetInterpreter(tstate): get the interpreter of a
Python thread state.
2020-03-13 23:38:08 +01:00
Victor Stinner be79373a78
bpo-39947: Add PyInterpreterState_Get() function (GH-18979)
* Rename _PyInterpreterState_Get() to PyInterpreterState_Get() and
  move it the limited C API.
* Add _PyInterpreterState_Get() alias to PyInterpreterState_Get() for
  backward compatibility with Python 3.8.
2020-03-13 18:15:33 +01:00
Brandt Bucher 6d674a1bf4
bpo-36144: OrderedDict Union (PEP 584) (#18967) 2020-03-13 09:06:04 -07:00
Charles Burkland d648ef10c5
bpo-36144: Update os.environ and os.environb for PEP 584 (#18911) 2020-03-13 09:04:43 -07:00
Victor Stinner 309d7cc5df
bpo-35370: Add _PyEval_SetTrace() function (GH-18975)
* sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() now
  properly report PySys_Audit() error if "sys.setprofile" or
  "sys.settrace" audit event is denied.
* Add _PyEval_SetProfile() and _PyEval_SetTrace() function: similar
  to PyEval_SetProfile() and PyEval_SetTrace() but take a tstate
  parameter and return -1 on error.
* Add _PyObject_FastCallTstate() function.
2020-03-13 16:39:12 +01:00
Victor Stinner 0b72b23fb0
bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340)
PyInterpreterState.eval_frame function now requires a tstate (Python
thread state) parameter.

Add private functions to the C API to get and set the frame
evaluation function:

* Add tstate parameter to _PyFrameEvalFunction function type.
* Add _PyInterpreterState_GetEvalFrameFunc() and
  _PyInterpreterState_SetEvalFrameFunc() functions.
* Add tstate parameter to _PyEval_EvalFrameDefault().
2020-03-12 23:18:39 +01:00
Daniel Hahler fdcd53fe1a
Doc: Fix grammar in PyErr_ResourceWarning (GH-18879) 2020-03-12 22:39:30 +05:30
Raúl Cumplido 3c29675d87
bpo-1294959: Fix typo for new attribute platlibdir. (GH-18960)
Received email on the docs mailing list to fix a typo from `sys.platlitdir` which doesn't exist to the correct new attribute `sys.platlibdir`

Automerge-Triggered-By: @vstinner
2020-03-12 07:38:19 -07:00
Pablo Galindo c00c86b904
Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946) 2020-03-12 00:48:19 +00:00