Commit Graph

23905 Commits

Author SHA1 Message Date
Zackery Spytz 4dfb190a33
bpo-41217: Fix incorrect note in the asyncio.create_subprocess_shell() docs (GH-21360)
On Windows, the default asyncio event loop is ProactorEventLoop (as of 3.8).
2020-10-19 23:08:34 +01:00
Michel Samia 33242a9328
bpo-41292: Fixes dead link to cx_freeze from Windows FAQ (GH-21463) 2020-10-19 23:02:43 +01:00
abdo 5d9e657517
Link to the msvcrt module from the Windows FAQ (#22268) 2020-10-19 22:46:21 +01:00
Irit Katriel fa8748271a
bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) 2020-10-19 22:27:16 +01:00
Saiyang Gou ebc8c38287
bpo-41192: Fix some broken anchors for audit event entries (#21310) 2020-10-19 10:52:42 -04:00
Batuhan Taskaya 155938907c
bpo-40484: Document compiler flags under AST module (GH-19885)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-10-19 02:14:11 +01:00
Shantanu 67f04878de
3.9 whatsnew: fix bpo issue for AST change (GH-22742) 2020-10-18 18:39:26 +03:00
Andre Delfino 975d10a4f8
[doc] Add mentions of PEP 613 (TypeAlias) to docs (GH-22733) 2020-10-16 19:34:01 -07:00
Zackery Spytz a22a19f354
bpo-40341: Remove some "discouraged solutions" in Doc/faq/programming.rst (GH-22726) 2020-10-16 11:44:17 -07:00
Saiyang Gou cf693e537d
Document that `test.support.bytecode_helper` is new in 3.9 (GH-22618) 2020-10-15 16:06:23 -03:00
Raymond Hettinger b67cbbda3a
Minor clarification (GH-22708) 2020-10-14 23:41:55 -07:00
Raymond Hettinger 302b6166fb
Update timings for the final release (GH-22697) 2020-10-14 10:04:04 -07:00
Hai Shi c5b049b91c
bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters (GH-22219) 2020-10-14 17:43:31 +02:00
Raymond Hettinger f2bd04f689
Improve recipe readability (GH-22685) 2020-10-13 16:41:26 -07:00
Raymond Hettinger 8b2ff4c03d
Add recipe for a version of random() with a larger population (GH-22664) 2020-10-13 11:54:21 -07:00
Vladimir Matveev cfb0f57ff8
bpo-41756: Export PyGen_Send and wrap it in if-defs (#22677) 2020-10-13 10:26:51 -07:00
Saiyang Gou ba06a70c82
Fix typo in "Context manager types" section in typing.rst (GH-22676)
Fix typo in the "Context manager types" section in `typing.rst`.

Automerge-Triggered-By: @gvanrossum
2020-10-12 16:34:33 -07:00
Vladimir Matveev 24a54c0bd4
Delete PyGen_Send (#22663) 2020-10-12 12:10:42 -07:00
Andre Delfino 8adf8d1ec4
[doc] Remove mention of async and await as soft keywords (GH-22144) 2020-10-12 14:52:30 +01:00
Anthony Sottile d5752aa5c9
Fix .. code-block :: directives in decimal.rst (GH-22571) 2020-10-11 19:26:50 +01:00
Gaurav Kamath 8197a93208
Fix typo (GH-22582)
/af/of/s

Automerge-Triggered-By: @Mariatta
2020-10-11 11:13:43 -07:00
abdo 0ff8a3b374
Fix typo in typing.rst (GH-22625) 2020-10-11 11:40:21 +05:30
Xie Yanbo a42759351b
Fix incorrect parameter name (GH-22613)
Automerge-Triggered-By: @Mariatta
2020-10-09 19:38:43 -07:00
Vladimir Matveev 037245c5ac
bpo-41756: Add PyIter_Send function (#22443) 2020-10-09 17:15:15 -07:00
Serhiy Storchaka e2ec0b27c0
bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)
Remove complex special methods __int__, __float__, __floordiv__,
__mod__, __divmod__, __rfloordiv__, __rmod__ and __rdivmod__
which always raised a TypeError.
2020-10-09 14:14:37 +03:00
Phil Elson 35f041dd01
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
`site.getusersitepackages()` returns the location of the user-specific site-packages directory
even when the user-specific site-packages is disabled.

```
$ python -s -m site
sys.path = [
    '/home/user/conda/lib/python37.zip',
    '/home/user/conda/lib/python3.7',
    '/home/user/conda/lib/python3.7/lib-dynload',
    '/home/user/conda/lib/python3.7/site-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
```

It was not practical to prevent the function from returning None if user-specific site-packages are disabled, since there are other uses of the function which are relying on this behaviour (e.g. `python -m site`).
2020-10-08 15:37:46 +09:00
Raymond Hettinger 4e0ce82058
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)
This reverts commit 58a7da9e12.
2020-10-07 16:43:44 -07:00
Mikhail Golubev 4f3c25043d
bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
2020-10-07 14:44:31 -07:00
Batuhan Taskaya 044a1048ca
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.

For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
2020-10-06 13:03:02 -07:00
Ben Avrahami bef7d299eb
bpo-41905: Add abc.update_abstractmethods() (GH-22485)
This function recomputes `cls.__abstractmethods__`.
Also update `@dataclass` to use it.
2020-10-06 10:40:50 -07:00
Brett Cannon d02d824e05
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505) 2020-10-05 09:42:21 -07:00
Terry Jan Reedy 060937da98
bpo-41774: Tweak new programming FAQ entry (GH-22562)
Remove mention of space in "remove multiple items from list".
2020-10-05 10:31:44 -04:00
Serhiy Storchaka dcc54215ac
bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552) 2020-10-05 12:32:00 +03:00
Fidget-Spinner 8e1dd55e63
bpo-41428: Documentation for PEP 604 (gh-22517) 2020-10-04 21:40:52 -07:00
scoder 40db798692
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) 2020-10-04 19:13:46 -04:00
Irit Katriel 1ed5443526
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) 2020-10-04 14:16:04 +01:00
Batuhan Taskaya e799aa8b92
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Also document that eval() does this (the same way).
2020-10-03 17:46:44 -07:00
Andre Delfino 7f54e563dc
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
This changes a few occurrences left behind by #22340.

Automerge-Triggered-By: @gvanrossum
2020-10-03 15:10:59 -07:00
Andre Delfino 3fe6148937
[doc] Fix link to abc.collections.Iterable (GH-22520)
Missed this occurrence before, sorry. Also changed "the PEP" to "PEP".

Automerge-Triggered-By: @gvanrossum
2020-10-03 08:51:13 -07:00
Ram Rachum f97e42ef4d
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) 2020-10-03 12:52:13 +03:00
Andre Delfino d4b9edd505
[doc] Fix link to abc.collections.Iterable (GH-22502)
Automerge-Triggered-By: @gvanrossum
2020-10-02 16:15:28 -07:00
Andre Delfino bd71a43340
Fix is_typeddict markup (#22501) 2020-10-02 15:36:26 -07:00
Campbell Barton 20ce62f009
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) 2020-10-02 19:18:01 +03:00
Victor Stinner 583ee5a5b1
bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)
The PyUnicode_InternImmortal() function is now deprecated and will be
removed in Python 3.12: use PyUnicode_InternInPlace() instead.
2020-10-02 14:49:00 +02:00
Andre Delfino c8bb24166e
[doc] Update references to NumPy (GH-22458)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
2020-10-01 16:22:14 -07:00
Robert Smallshire 58a7da9e12
bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)
* bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer().

The int.is_integer() method always returns True.

* bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True.

* bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int.

This default implementation is intended to reduce the workload for subclass
implementers. It is not robust in the presence of infinities or NaNs and
may have suboptimal performance for other types.

* bpo-26680: Adds Rational.is_integer which returns True if the denominator is one.

This implementation assumes the Rational is represented in it's
lowest form, as required by the class docstring.

* bpo-26680: Adds Integral.is_integer which always returns True.

* bpo-26680: Adds tests for Fraction.is_integer called as an instance method.

The tests for the Rational abstract base class use an unbound
method to sidestep the inability to directly instantiate Rational.
These tests check that everything works correct as an instance method.

* bpo-26680: Updates documentation for Real.is_integer and built-ins int and float.

The call x.is_integer() is now listed in the table of operations
which apply to all numeric types except complex, with a reference
to the full documentation for Real.is_integer().  Mention of
is_integer() has been removed from the section 'Additional Methods
on Float'.

The documentation for Real.is_integer() describes its purpose, and
mentions that it should be overridden for performance reasons, or
to handle special values like NaN.

* bpo-26680: Adds Decimal.is_integer to the Python and C implementations.

The C implementation of Decimal already implements and uses
mpd_isinteger internally, we just expose the existing function to
Python.

The Python implementation uses internal conversion to integer
using to_integral_value().

In both cases, the corresponding context methods are also
implemented.

Tests and documentation are included.

* bpo-26680: Updates the ACKS file.

* bpo-26680: NEWS entries for int, the numeric ABCs and Decimal.

Co-authored-by: Robert Smallshire <rob@sixty-north.com>
2020-10-01 17:30:08 +01:00
Max Smolens 63298930fb
Fix grammar in secrets module documentation (GH-22467)
From `In particularly,` to `In particular,`
2020-09-30 15:05:51 -07:00
Terry Jan Reedy 5b0181d1f6
bpo-41774: Add programming FAQ entry (GH-22402)
In the "Sequences (Tuples/Lists)" section, add
"How do you remove multiple items from a list".
2020-09-29 01:02:44 -04:00
Ram Rachum b0dfc75816
bpo-41773: Raise exception for non-finite weights in random.choices(). (GH-22441) 2020-09-28 18:32:10 -07:00
Hai Shi d332e7b816
bpo-41842: Add codecs.unregister() function (GH-22360)
Add codecs.unregister() and PyCodec_Unregister() functions
to unregister a codec search function.
2020-09-28 23:41:11 +02:00
Andre Delfino d9ab95ff1f
[doc] Leverage the fact that the actual types can now be indexed for typing (GH-22340)
This shows users that they can use the actual types. Using deprecated types is confusing.

This also prefers colections.abc.Sized instead of the alias typing.Sized. I guess the aliases were created to make it convenient to import all collections related types from the same place.

This should be backported to 3.9.

Automerge-Triggered-By: @gvanrossum
2020-09-27 12:07:04 -07:00
Emmanuel Arias 00eb063b66
bpo-41858: Clarify line in optparse doc (GH-22407)
The existing line is easily read as being incomplete.
2020-09-26 23:43:18 -04:00
Andre Delfino e8a2076e14
Revert "Fix all Python Cookbook links (#22205)" (GH-22424)
This commit reverts commit ac0333e1e1 as the original links are working again and they provide extended features such as comments and alternative versions.
2020-09-27 01:47:25 +01:00
Victor Stinner 98c16c991d
bpo-41833: threading.Thread now uses the target name (GH-22357) 2020-09-23 23:21:19 +02:00
Zackery Spytz 2e4dd336e5
bpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)
Add PyDateTime_DATE_GET_TZINFO() and PyDateTime_TIME_GET_TZINFO()
macros.
2020-09-23 14:43:45 -04:00
Terry Jan Reedy 9c4eac7f02
bpo-33822: Update IDLE section of What's New 3.8 (GH-22383) 2020-09-23 11:19:05 -04:00
Terry Jan Reedy 22b7616f26
bpo-41844: Add IDLE section to What's New 3.9 (GN-22382) 2020-09-23 11:17:26 -04:00
sblondon 48b0b1b121
bpo-37779 : Add information about the overriding behavior of ConfigParser.read (GH-15177)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
2020-09-23 14:28:58 +02:00
Victor Stinner 19c3ac92bf
bpo-41834: Remove _Py_CheckRecursionLimit variable (GH-22359)
Remove the global _Py_CheckRecursionLimit variable: it has been
replaced by ceval.recursion_limit of the PyInterpreterState
structure.

There is no need to keep the variable for the stable ABI, since
Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() were not usable
in Python 3.8 and older: these macros accessed PyThreadState members,
whereas the PyThreadState structure is opaque in the limited C API.
2020-09-23 14:04:57 +02:00
Ethan Furman d986d1657e
bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362)
use `str.__str__` for `StrEnum` so that `str(StrEnum.member)` is the same as directly accessing the string value of the `StrEnum` member
2020-09-22 13:00:07 -07:00
Terry Jan Reedy 947adcaa13
bpo-35764: Rewrite the IDLE Calltips doc section (GH-22363) 2020-09-22 13:21:58 -04:00
Bas van Beek 0d0e9fe2ff
bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` (GH-22336)
closes issue 41810
2020-09-22 08:55:34 -07:00
Ethan Furman 62e40d8450
Enum: add extended AutoNumber example (GH-22349) 2020-09-22 00:05:27 -07:00
Ethan Furman 0063ff4e58
bpo-41816: add `StrEnum` (GH-22337)
`StrEnum` ensures that its members were already strings, or intended to
be strings.
2020-09-21 17:23:13 -07:00
Andre Delfino 778ad926cb
[doc] Teach 0-args form of super in Programming FAQ (GH-22176) 2020-09-20 10:09:50 -07:00
Mark Dickinson c8c70e7876
Add missing whatsnew entry for TestCase.assertNoLogs (GH-22317) 2020-09-19 21:38:11 +01:00
Vladimir Matveev 2b05361bf7
bpo-41756: Introduce PyGen_Send C API (GH-22196)
The new API allows to efficiently send values into native generators
and coroutines avoiding use of StopIteration exceptions to signal 
returns.

ceval loop now uses this method instead of the old "private"
_PyGen_Send C API. This translates to 1.6x increased performance
of 'await' calls in micro-benchmarks.

Aside from CPython core improvements, this new API will also allow 
Cython to generate more efficient code, benefiting high-performance
IO libraries like uvloop.
2020-09-18 18:38:38 -07:00
Victor Stinner 8394500cca
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307)
Doc/requirements.txt becomes the reference for packages and package
versions needed to build the Python documentation.

* Doc/Makefile now uses Doc/requirements.txt
* .travis.yml now uses "make env" of Doc/Makefile
2020-09-18 16:23:18 +02:00
Dong-hee Na 6595cb0af4
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
* bpo-35293: Remove RemovedInSphinx40Warning

* Update Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

* bpo-35293: Apply Victor's review

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-18 18:22:36 +09:00
Victor Stinner 8af239eacf
bpo-41762: Fix usage of productionlist markup in the doc (GH-22281)
Use an unique identifier for the different grammars documented using
the Sphinx productionlist markup.

productionlist markups of the same grammar, like "expressions" or
"compound statements", use the same identifier "python-grammar".
2020-09-18 09:10:15 +02:00
Serhiy Storchaka 27201cddf3
Remove duplicated words words (GH-22298) 2020-09-18 09:54:42 +03:00
Terry Jan Reedy 5a8364780b
bpo-41808: Add What's New 3.9 entry missing from master (#22294)
Entry was added by bpo-40939, #21012 and #21039.
2020-09-17 21:56:58 -04:00
Serhiy Storchaka a33f2c2bae
bpo-27032, bpo-37328: Document removing HTMLParser.unescape(). (GH-22288) 2020-09-17 11:49:01 +03:00
Ethan Furman 7219e27087
Enum: make `Flag` and `IntFlag` members iterable (GH-22221) 2020-09-16 13:01:00 -07:00
Pablo Galindo a5634c4067
bpo-41746: Add type information to asdl_seq objects (GH-22223)
* Add new capability to the PEG parser to type variable assignments. For instance:
```
       | a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a }
```

* Add new sequence types from the asdl definition (automatically generated)
* Make `asdl_seq` type a generic aliasing pointer type.
* Create a new `asdl_generic_seq` for the generic case using `void*`.
* The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed.
* New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences.
* Changes all possible `asdl_seq` types to use specific versions everywhere.
2020-09-16 19:42:00 +01:00
Andre Delfino 83f6dcd207
[doc] Minor improvements to is_typeddict (GH-22280)
1. The check is on the type
2. Add link to TypeDict
2020-09-16 08:06:23 -07:00
Patrick Reader 0705ec8a14
bpo-41792: Add is_typeddict function to typing.py (GH-22254)
Closes issue41792.

Also closes https://github.com/python/typing/issues/751.
2020-09-15 21:58:32 -07:00
Tim Burke 47f6ec4c09
Doc: Fix broken manpage link (GH-21937)
sigprocmask is in section 2, not 3.
2020-09-15 20:26:06 -03:00
Andre Delfino ac0333e1e1
Fix all Python Cookbook links (#22205) 2020-09-15 21:13:26 +01:00
Mandeep 5531269f69
Improve the description of difflib in the documentation (GH-22253)
From "can produce difference information in various formats ..."
to " can produce information about file differences in various formats ..."

Automerge-Triggered-By: @Mariatta
2020-09-15 12:20:49 -07:00
Neeraj Samtani 7bcc6456ad
bpo-41776: Revise example of "continue" in the tutorial documentation (GH-22234)
Revise example of "continue" in the tutorial documentation
2020-09-15 09:39:29 -04:00
Ethan Furman 542e1df2b0
bpo-40721: add note about enum member name case (GH-22231)
* UPPER_CASE preferred as enum members are constants
2020-09-14 13:32:44 -07:00
Zackery Spytz 8f2b991eef
bpo-41646: Mention path-like objects support in the docs for shutil.copy() (GH-22208) 2020-09-14 20:28:46 +01:00
abdo efcbe786cf
Fix a typo in locale Docs (#22233) 2020-09-14 20:36:34 +03:00
Raymond Hettinger 457d4e97de
bpo-41513: Add docs and tests for hypot() (GH-22238) 2020-09-13 23:33:41 -07:00
Emmanuel Arias 94bfdee25d
bpo-41778: Change a punctuation on documentation. (GH-22229)
On this paragrapah the clarification about IIS7 seems there's not
connection beacuase is in other sentence. Move the punctuation
to connect both the last sentence with the information in the
parenthesis.

I think the NEWS is not necessary here.

Automerge-Triggered-By: @ericvsmith
2020-09-13 14:05:44 -07:00
Sergey Fedoseev b48389d950
bpo-33239: Fix default value of 'buffering' parameter in docs of tempfile.* functions (GH-21763)
`None` doesn't work:

```python
>>> import tempfile
>>> tempfile.TemporaryFile(buffering=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sergey/tmp/cpython-dev/Lib/tempfile.py", line 607, in TemporaryFile
    return _io.open(fd, mode, buffering=buffering,
TypeError: 'NoneType' object cannot be interpreted as an integer
```

Automerge-Triggered-By: @vsajip
2020-09-13 10:59:01 -07:00
Norbert Cyran c75330605d
bpo-41672: Fix type mismatches in imaplib docs (GH-22207) 2020-09-12 16:58:56 +09:00
Stargirl Flowers fb27187203
[doc] struct: update note about network byte order form to be more helpful (GH-22201)
Update the sentence to provide some context on why network byte order is defined as big endian.
2020-09-11 08:20:12 -07:00
Benjamin Peterson 3304cbd990
Doc: Fix alphabetical ordering of removeprefix/suffix. (GH-22194) 2020-09-11 08:59:02 +09:00
Mark Roseman 06d0b8b67e
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188)
The new link responds much faster and begins with a short explanation of the status of the doc.
2020-09-10 16:04:20 -04:00
Bar Harel 1e874d5bec
Update logging documentation to tidy up formatting (GH-22173) 2020-09-10 11:50:23 +01:00
Andre Delfino 788b79fa7b
[doc] Remove superfluous comment about equal in f-strings (GH-22006)
Automerge-Triggered-By: @kushaldas
2020-09-09 23:33:13 -07:00
Andre Delfino 7a797a3967
Add missing colon to IDLE doc markup (GH-22007) 2020-09-09 18:17:14 -04:00
Vinay Sajip 76553e5d2e
Add minor clarification in logging documentation. (GH-22167) 2020-09-09 11:21:22 +01:00
Hai Shi 1e2f051a61
bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec in refcounts.dat (GH-22112)
Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat
2020-09-09 11:48:44 +02:00
Andre Delfino 594f0ce73b
[doc] Fix padding in timeit (GH-22152)
Compare -p and -u options help in rendered output to see the difference.
2020-09-08 16:39:19 -07:00
Erlend Egeberg Aasland 207c321f13
bpo-40744: Drop support for SQLite pre 3.7.3 (GH-20909)
Remove code required to support SQLite pre 3.7.3.

Co-written-by: Berker Peksag <berker.peksag@gmail.com>
Co-written-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2020-09-07 22:26:54 +01:00
Andre Delfino 5bfd60fc2b
[doc] Add link to Generic in typing (GH-22125) 2020-09-06 22:29:38 -07:00
Zackery Spytz 5371a464ce
closes bpo-41723: Fix an error in the py_compile documentation. (GH-22110) 2020-09-05 22:39:23 -05:00
Andre Delfino 2623868ede
[doc] Fix padding in some typing definitions (GH-22114)
Automerge-Triggered-By: @gvanrossum
2020-09-05 16:40:25 -07:00
johnthagen 1264d0465a
Fix documented Python version for venv --upgrade-deps (GH-22113)
Fixes incorrect Python version added for `venv` `--upgrade-deps` in #13100. This feature was added in Python 3.9 not 3.8.

Relates to:

- 
- 1cba1c9aba

Automerge-Triggered-By: @vsajip
2020-09-05 13:53:47 -07:00
Zackery Spytz 51b84f8e96
bpo-38585: Remove references to defusedexpat (GH-22095)
defusedexpat is not maintained.
2020-09-04 13:57:48 -07:00
Serhiy Storchaka 306cfb3a37
bpo-40486: Specify what happens if directory content change diring iteration (GH-22025) 2020-09-04 21:19:30 +03:00
Vinay Sajip cdbff3527c
[doc] Update documentation on logging optimization. (GH-22075) 2020-09-03 19:44:12 +01:00
Mario Šaško 8516060076
[doc] Fix a typo in the graphlib docs (#22030) 2020-09-03 11:00:10 +01:00
Todd e223d06a8b
bpo-39883: Use BSD0 license for code in docs (GH-17635)
The PSF board approved this use.
2020-09-02 22:22:36 -07:00
Pablo Galindo 5a4a963a6c
Fix invalid escape sequences in the peg_highlight Sphinx extension (GH-22047) 2020-09-02 15:29:38 +01:00
Victor Stinner 51fece1bb8
bpo-41685: Don't pin setuptools version anymore in Doc/Makefile (GH-22062)
setuptools 50.0.2 is now compatible with Python 3.10:
https://github.com/pypa/setuptools/pull/2361
2020-09-02 13:11:21 +02:00
Victor Stinner c0d5c131d9
bpo-40204: Update Sphinx to version 3.2.1 in Doc/Makefile (GH-22043) 2020-09-02 12:29:31 +02:00
Andre Delfino 1d25f5bf7b
Remove reference to Boa Constructor. (GH-22012) 2020-09-01 22:22:55 -05:00
Andre Delfino dea82b6731
[doc] Remove references to PyChecker. (GH-22011) 2020-09-01 22:21:12 -05:00
Benjamin Peterson 700fa1b836
Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22031)
Follow up to f7c4e23642.
2020-09-01 20:36:42 -05:00
Andre Delfino f5a16b4dbf
[doc] Add link to FileHandler in logging (GH-21940)
Co-authored-by: Andrés Delfino <adelfino@onapsis.com>
2020-09-01 13:59:46 +01:00
Ned Deily a4c4e17f95
bpo-41685: Temporarily pin setuptools to 49.2.1 in Docs venv. (GH-22038)
See https://github.com/pypa/setuptools/pull/2361
2020-09-01 05:40:27 -04:00
Andre Delfino 3584d4b64a
[doc] Document VIRTUAL_ENV environment variable (GH-21970) 2020-09-01 07:07:29 +01:00
Andre Delfino c3a651ad25
[doc] Fix markup in logging (GH-22008) 2020-08-30 21:36:58 +01:00
Roger Iyengar c68c5af2dc
Improve asyncio-dev 'Concurrency and Multithreading' docs (GH-20882)
I added some information to the `Concurrency and Multithreading` section of the `Developing with asyncio` guide. 

This is all information that would have helped me when I started using asyncio. I incorrectly assumed that `loop.call_soon_threadsafe()` and `run_coroutine_threadsafe()` could be called from a thread in a process separate from the one that the event loop is running in. Explicitly stating that this will not work will probably help some people starting out with asyncio in the future.

I also added references to some other functions that can be used for inter-process communication without blocking the event loop. The section already mentions running blocking code in a ThreadPoolExecutor, but I think listing these other options in this section will also be helpful.
2020-08-29 16:47:38 -07:00
SarahPythonista 8784d3300e
Fix error in argparse documentation example (GH-17399)
Automerge-Triggered-By: @rhettinger
2020-08-28 11:47:58 -07:00
Petr Viktorin d9a966ae08
bpo-38787: Clarify docs for PyType_GetModule and warn against common mistake (GH-20215) 2020-08-27 15:36:48 +02:00
Zackery Spytz 398575c210
bpo-41634: Fix a typo in the curses documentation (GH-21958) 2020-08-27 16:58:16 +05:30
Mason b260635b3d
Add missing word (GH-21936)
"data to lost" -> "data to be lost"
2020-08-27 02:49:14 +02:00
MingZhe Hu 8c58d2a216
bpo-41624: fix documentation of typing.Coroutine (GH-21952) 2020-08-27 02:42:37 +02:00
Andre Delfino 802726acf6
Document vars behavior when __dict__ is missing (#21466) 2020-08-21 19:29:34 -03:00
wyz23x2 7173fc84e6
bpo-41573: Update release versions in General FAQ (GH-21915) 2020-08-21 18:28:54 -04:00
Mathieu Dupuy 12695f4c6d
Doc: add a missing period (GH-21819) 2020-08-20 22:08:37 +02:00
Sydney Pemberton 2ce39631f6
bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880)
Use a less surprising document structure.

Automerge-Triggered-By: @csabella
2020-08-20 03:30:21 -07:00
Denis Ovsienko 0be7c216e1
Fix grammar in Doc/tutorial/controlflow.rst (GH-21885)
Automerge-Triggered-By: @csabella
2020-08-19 04:29:47 -07:00
Victor Stinner 1abeda80f7
bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)
Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:

Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions
2020-08-17 08:41:42 +02:00
Victor Stinner fbf43f051e
bpo-41521: Rename blacklist parameter to not_exported (GH-21824)
Rename "blacklist" parameter of test.support.check__all__() to
"not_exported".
2020-08-17 07:20:40 +02:00
Irit Katriel fa5d725198
Fix typo in typing doc (GH-21879)
Automerge-Triggered-By: @gvanrossum
2020-08-14 16:01:36 -07:00
Victor Stinner bb0b08540c
bpo-40204: Fix reference to terms in the doc (GH-21865)
Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.
2020-08-14 12:20:05 +02:00
Rishav Kundu e55de68be3
bpo-41410: Fix outdated info in mkstemp docs (GH-21701)
Automerge-Triggered-By: @ericvsmith
2020-08-13 18:33:14 -07:00
Facundo Batista a3eae43aee
Fixed comment about pathlib.link_to: it was added in 3.8, not changed. (#21851) 2020-08-13 17:33:56 -03:00
Victor Stinner 474652fe93
bpo-40204, doc: Fix syntax of C variables (GH-21846)
For example, fix the following Sphinx 3 errors:

Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name. [error at 5]
  void \*obj
  -----^

Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*'
Invalid C declaration: Expected end of definition. [error at 8]
  PyObject*
  --------^

The modified documentation is compatible with Sphinx 2 and Sphinx 3.
2020-08-13 22:11:50 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 0eb9deb4a6
bpo-41066: Update the comparison section for os vs pathlib (GH-21261) 2020-08-13 21:52:04 +02:00
Victor Stinner d3ded08048
bpo-40204: Add :noindex: in the documentation (GH-21859)
Add :noindex: to duplicated documentation to fix "duplicate object
description" errors.

For example, fix this Sphinx 3 issue:

Doc/library/configparser.rst:1146: WARNING: duplicate object
description of configparser.ConfigParser.optionxform, other instance
in library/configparser, use :noindex: for one of them
2020-08-13 21:41:54 +02:00
Victor Stinner 20ae565bd2
bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-21826)
The http.cookiejar module has is_blocked() and blocked_domains()
methods, so "blocklist" term sounds better than "denylist" in this
module.

Replace also denylisted with denied in test___all__.
2020-08-13 19:20:28 +02:00
Victor Stinner 46d10b1237
bpo-40204: Fix duplicates in the documentation (GH-21857)
Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.
2020-08-13 19:16:02 +02:00
Victor Stinner 43577c01a2
bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)
Use generic '.. object::' to declare markers, rather than abusing
'..  c:function::' which fails on Sphinx 3.
2020-08-13 19:15:38 +02:00
Victor Stinner 423e77d6de
bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)
Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.
2020-08-12 21:49:22 +02:00
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