Commit Graph

23714 Commits

Author SHA1 Message Date
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