Commit Graph

24823 Commits

Author SHA1 Message Date
Pablo Galindo 9fe0de28bc
Merge remote-tracking branch 'upstream/main' 2021-12-08 23:41:16 +00:00
David CARLIER 267539bff7
bpo-46016: fcntl module add FreeBSD's F_DUP2FD_CLOEXEC flag support (GH-29993) 2021-12-08 23:28:51 +01:00
Pablo Galindo 3ea574f35b
Fix some false positives of documentation syntax problems 2021-12-08 22:22:55 +00:00
Mark Shannon 69806b9516
bpo-46009: Do not exhaust generator when send() method raises (GH-29986) 2021-12-08 12:09:26 +00:00
Rafael Fontenelle 3e0f13b9e4
doc: Add link issue 44010 (GH-29454) 2021-12-08 12:55:39 +02:00
Irit Katriel 7989e9dff6
bpo-40222: update doc entry with respect to the change in WITH_EXCEPT_START (GH-29975) 2021-12-08 09:41:28 +00:00
Raymond Hettinger 4ccccb1cfc
bpo-20751: Match variable name to the example. (GH-29980) 2021-12-07 21:38:21 -06:00
Ken Jin c7e7a4b969
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963) 2021-12-07 23:25:13 +08:00
Victor Stinner cf7eaa4617
Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" (GH-29951)
This reverts commit 9bf2cbc4c4.
2021-12-07 12:31:04 +01:00
Vinay Sajip 2bf551757e
bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 2021-12-07 11:15:44 +00:00
James Gerity 8db06528ca
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) 2021-12-07 11:58:40 +02:00
Taras Sereda 8518ee348c
removal of duplicated text paragraph (#29666) 2021-12-07 01:12:29 +02:00
Alex Waygood c0521fe49f
bpo-45840: Improve cross-references in the data model documentation (GH-29633) 2021-12-05 22:49:36 +02:00
Serhiy Storchaka 60c320c38e
bpo-37295: Optimize math.comb() and math.perm() (GH-29090)
For very large numbers use divide-and-conquer algorithm for getting
benefit of Karatsuba multiplication of large numbers.

Do calculations completely in C unsigned long long instead of Python
integers if possible.
2021-12-05 22:26:10 +02:00
Christian Heimes 64be8d369b
bpo-45847: Update whatsnew and add place holder entries for missing extensions (GH-29914) 2021-12-04 15:14:48 +01:00
Raymond Hettinger 135ecc3492
bpo-20751: Replace method example with attribute example, matching the descriptor howto (GH-29909) 2021-12-03 20:37:08 -06:00
Irit Katriel 5bb7ef2768
bpo-45607: Make it possible to enrich exception displays via setting their __note__ field (GH-29880) 2021-12-03 22:01:15 +00:00
Steve Dower 99fcf15052
bpo-45582: Port getpath[p].c to Python (GH-29041)
The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code.

This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
2021-12-03 00:08:42 +00:00
Zachary Ware 9f2f7e4226
bpo-45916: Use HTTPS link for The Perils of Floating Point (GH-29896) 2021-12-02 14:24:25 -06:00
Christian Heimes a31173c5ce
bpo-40280: Update what's new (GH-29893) 2021-12-02 18:42:56 +01:00
Alex Waygood b2afdc95cc
bpo-45535: Improve output of Enum ``dir()`` (GH-29316)
Modify the ``EnumType.__dir__()`` and ``Enum.__dir__()`` to ensure
that user-defined methods and methods inherited from mixin classes always
show up in the output of `help()`. This change also makes it easier for
IDEs to provide auto-completion.
2021-12-02 08:49:52 -08:00
Victor Stinner a6c3b0faa1
bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)
Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and
invert the value.

Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in
PyConfig.code_debug_ranges documentation.
2021-12-02 11:43:37 +01:00
Christian Clauss 226d22ff2d
docs: Improve example for urlparse() (GH-29816) 2021-12-02 10:52:32 +02:00
Weipeng Hong c2bb29ce9a
bpo-30533: Add docs for `inspect.getmembers_static` (#29874)
* Add docs for `inspect.getmembers_static`

* update
2021-12-01 11:23:46 -08:00
Rob f27bef3043
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) 2021-12-01 14:24:46 +02:00
Irit Katriel 8a45ca542a
bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (GH-29780) 2021-11-30 22:37:04 +00:00
Vishal Pandey f97ec09baf
bpo-33381: [doc] strftime's %f option may pad zeros on the left or the right (GH-29801) 2021-11-30 11:01:44 +00:00
Gideon 6266e4af87
bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-11-29 18:55:43 +00:00
andrei kulakov c1f93f0d37
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
Expanded ``astuple()`` docs, warning about deepcopy being applied 
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
2021-11-29 10:10:32 -08:00
Christian Heimes 992565f7f7
bpo-45881: configure --with-freeze-module --with-build-python (GH-29835)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ethan Smith <ethan@ethanhs.me>
2021-11-29 17:23:29 +01:00
Erlend Egeberg Aasland c4a69a4ad0
bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591) 2021-11-29 15:22:32 +00:00
Christian Heimes 6ac3c8a314
bpo-40280: Emscripten systems use .wasm suffix by default (GH-29842) 2021-11-29 16:01:55 +01:00
Vinay Sajip 39b60ceae8
[Doc] Add info to logging cookbook about running logging socket listeners i… (GH-29838) 2021-11-29 13:06:52 +00:00
Guido van Rossum 94daf39b2f
Fix markup buglet in Doc/howto/annotations.rst (#29802) 2021-11-26 14:10:01 -08:00
Arthur Milchior cd876c8493
bpo-45619: documentation of execution model: clarify and update binding summary (#29232)
This does two changes that are quite related.

0. it add that variable binding can occur in pattern matching, an update of 3.10
which seems to have been omitted from the list of bindings
1. Given how long the sentence already was, with even subcases in the middle of
the sentence, the commit breaks the sentence into an actual list.
2021-11-25 21:19:06 -08:00
Sergey Kolesnikov e0f8a3e9b9
Add missing 'await writer.drain()' call to example (GH-29162)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 09:15:24 -08:00
Zbigniew Siciarz 4dd82194f4
bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 04:30:48 -08:00
Jim Crist-Harif d71c7bc733
bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760)
Document the `port` parameter to `loop.create_server` in `asyncio`. In
particular, note that if `host` resolves to multiple network interfaces,
passing in `port=0` will result in a different random unused port being
used for each interface.

Automerge-Triggered-By: GH:ericvsmith
2021-11-24 11:43:57 -08:00
Jason R. Coombs d5cd2effa6
bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)
* bpo-45514: Apply changes from importlib_resources@a3ef4128c6

* Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs.

* Apply changes from importlib_resources@329ae9d5f2c.

* Indicate importlib.resources as a module.

Co-authored-by: Filipe Laíns <lains@riseup.net>
2021-11-24 02:51:37 -05:00
Miro Hrončok ae1965ccb4
bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… (GH-29384)
Consider the following directory structure:

    .
    └── PATH1
        └── namespace
            └── sub1
                └── __init__.py

And both PATH1 and PATH2 in sys path:

    $ PYTHONPATH=PATH1:PATH2 python3.11
    >>> import namespace
    >>> import namespace.sub1
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> ...

While this interpreter still runs, PATH2/namespace/sub2 is created:

    .
    ├── PATH1
    │   └── namespace
    │       └── sub1
    │           └── __init__.py
    └── PATH2
        └── namespace
            └── sub2
                └── __init__.py

The newly created module cannot be imported:

    >>> ...
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'namespace.sub2'

Calling importlib.invalidate_caches() now newly allows to import it:

    >>> import importlib
    >>> importlib.invalidate_caches()
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace'])

This was not previously possible.
2021-11-23 07:38:02 -08:00
Petr Viktorin 2c047f604e
Clarify that discutils.(plat)include is for CPython's headers (GH-29578)
Change the docs to note that "include" and "platinclude" are
for CPython's headers, and not necessarily for headers of
third-party libraries.

See discussion in: https://discuss.python.org/t/clarification-on-a-wheels-header-data/9305/19
2021-11-23 11:28:14 +01:00
Mark Shannon 135cabd328
bpo-44525: Copy free variables in bytecode to allow calls to inner functions to be specialized (GH-29595)
* Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead.

* Add reference to function to frame, borrow references to builtins and globals.

* Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
2021-11-23 09:53:24 +00:00
Julien Palard 024209401e
bpo-42238: [doc] Announce the future removal of make suspicous. (GH-29652)
* bpo-42238: [doc] Announce the future removal of make suspicous.

* Add a news entry.
2021-11-22 15:17:54 -08:00
Raymond Hettinger d2b55b07d2
bpo-45766: Add direct proportion option to linear_regression(). (#29490)
* bpo-45766: Add direct proportion option to linear_regression().

* Update 2021-11-09-09-18-06.bpo-45766.dvbcMf.rst

* Use ellipsis to avoid round-off issues.

* Update Misc/NEWS.d/next/Library/2021-11-09-09-18-06.bpo-45766.dvbcMf.rst

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

* Update signature in main docs

* Fix missing comma

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-21 08:39:26 -06:00
Logan Jones fdc0e09c33
bpo-44733: Add max_tasks_per_child to ProcessPoolExecutor (GH-27373)
Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-11-20 21:19:41 +01:00
Terry Jan Reedy 123a3527dd
bpo-45845: Change link for pyserial (GH-29675) 2021-11-20 14:56:42 -05:00
Terry Jan Reedy 9852339145
bpo-44844: Remove unresponsive web link (GH-29651)
Threading notes by Aahz from OSCON 2001.
2021-11-20 13:21:14 -05:00
Jouke Witteveen ee49484c0f
[doc] Clarify MRO precedence in descriptor super binding section (GH-29539)
A similar sentence is present in the 'Invocation from super' section of
the descriptor HOWTO, where it is already correct.
2021-11-20 17:55:35 +01:00
JMcB bc2bc0dbdb
bpo-45846: Fix capitalisation of Van Rossum at the start of sentence (GH-29641) 2021-11-20 11:35:39 +02:00
Brett Cannon be36e06340
bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170)
It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
2021-11-19 16:40:34 -08:00
Raymond Hettinger e34809e1c2
bpo-19072: Classmethod can wrap other classmethod like descriptors (GH-29634)
staticmethod() also became callable in Python 3.10.

See: b83861f02.
2021-11-19 19:43:49 +01:00
Julien Palard d32316a2aa
bpo-42238: [doc]: Hide false positive in make suspicious. (GH-29636) 2021-11-19 19:11:24 +01:00
Terry Jan Reedy 4575c01b75
bpo-45788: Link sys.prefix doc to 'Installation paths' (#29606)
... To the Installation paths section of the sysconfig doc.
2021-11-18 15:08:24 -05:00
Arthur Milchior 32959108f9
bpo-45640: [docs] Tokens are now clickable (GH-29260)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 17:06:38 +01:00
Alex Waygood 31b3a70edb
[doc] bpo-45680: Disambiguate ``__getitem__`` and ``__class_getitem__`` in the data model (GH-29389)
The documentation explaining Python's data model does not adequately explain
the differences between ``__getitem__`` and ``__class_getitem__``, nor does it
explain when each is called. There is an attempt at explaining
``__class_getitem__`` in the documentation for ``GenericAlias`` objects, but
this does not give sufficient clarity into how the method works. Moreover, it
is the wrong place for that information to be found; the explanation of
``__class_getitem__`` should be in the documentation explaining the data model.

This PR has been split off from GH-29335.
2021-11-18 16:54:25 +01:00
Hugo van Kemenade c94664c262
bpo-45837: Properly deprecate turtle.RawTurtle.settiltangle (GH-29618) 2021-11-18 16:02:48 +01:00
Dong-hee Na fc4474e45e
bpo-45429: Merge whatsnew about time.sleep (GH-29589)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 01:26:59 +01:00
ch33zer abc0d754c3
[docs] Add missing word "any" in unittest -k cmdline option description (GH-29571) 2021-11-18 00:25:53 +01:00
Emmanuel Arias 15409c720b
bpo-28806: Continue work: improve the netrc library (GH-26330)
Continue with the improvement of the library netrc

Original work and report Xiang Zhang <angwerzx@126.com>

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-11-17 11:07:54 +02:00
Géry Ogam d7e210070f
bpo-37800: Clean up importlib documentation for some module attributes (GH-10016)
Automerge-Triggered-By: GH:brettcannon
2021-11-16 11:59:45 -08:00
Dong-hee Na 55868f1a33
bpo-45429: Support CREATE_WAITABLE_TIMER_HIGH_RESOLUTION if possible (GH-29203) 2021-11-16 22:41:20 +09:00
Victor Stinner 9bf2cbc4c4
bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)
Remove the asyncore and asynchat modules, deprecated in Python
3.6: use the asyncio module instead.

Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd
module can be used instead, it is based on asyncio.

* Remove asyncore, asynchat and smtpd documentation
* Remove test_asyncore, test_asynchat and test_smtpd
* Rename Lib/asynchat.py to Lib/test/support/_asynchat.py
* Rename Lib/asyncore.py to Lib/test/support/_asyncore.py
* Rename Lib/smtpd.py to Lib/test/support/_smtpd.py
* Remove DeprecationWarning from private _asyncore, _asynchat and
  _smtpd modules
* _smtpd: remove deprecated properties
2021-11-16 00:29:17 +01:00
Emmanuel Arias 3352834f59
bpo-43225: [DOC] Add missing value returned by methods on cookiejar (GH-24522)
* Add missing value returned by methods on cookiejar

Documentation say that return something but don't specific with what
value is return, and that can be confuse. This patch add that information.

* Update Doc/library/http.cookiejar.rst

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

* Update Doc/library/http.cookiejar.rst

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-11-15 14:44:32 -08:00
Terry Jan Reedy ad43dc0b54
bpo-25381: Update explanation of exceptions in C. (GH-26838)
* bpo-25381: Update explanation of exception globals

This paragraph in extending/extending.rst was unchanged (except for
NULL markup) since committed in 2007 Aug 15 for 2.6 alpha.

* Respond to reviews and remove duplication.

* Update Doc/extending/extending.rst

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-15 14:38:53 -08:00
Joannah Nanjekye c750adbe69
Save a reference for ensure_future and create_task (GH-29163)
Co-authored-by: Joannah Nanjekye <jnanjekye@python.org>
2021-11-15 14:30:28 -08:00
Erlend Egeberg Aasland 6c5a312fb6
bpo-45677: Reword first section of `sqlite3` docs (#29326)
* bpo-45677: Avoid addressing the reader as 'you' in sqlite3 docs

* Adjust wording

* Adjust wording again

* Typo

* Update Doc/library/sqlite3.rst

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>

* Address review: adjust wording

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Apply Alex' suggestion, and apply 80 char limit to PR

* Minor adjustment

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-15 14:22:42 -08:00
M. Mostafa Farzan b7360ae395
bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) 2021-11-14 11:34:37 +02:00
Jack DeVries f8da00ef04
bpo-45799: [Doc] improve confusing sentence in __main__.rst (GH-29546)
I was reading this bit last night and thought it was a typo. In the light of day, I realized it wasn't *technically* a typo, but definitely confusing wording. This PR fixes the confusing sentence.

Automerge-Triggered-By: GH:ericvsmith
2021-11-13 12:16:05 -08:00
Hong Xu 4c792f39e6
bpo-45772: socket.socket should be a class instead of a function (GH-23960)
* bpo-45772: socket.socket should be a class instead of a function

Currently `socket.socket` is documented as a function, but it is really
a class (and thus has function-like usage to construct an object). This
correction would ensure that Python projects that are interlinking
Python's documentation can properly locate `socket.socket` as a type.
2021-11-13 08:02:04 +02:00
Brandt Bucher 8f1b71de73
bpo-45711: Re-bump the magic number and update doc (GH-29528) 2021-11-12 13:21:45 +00:00
Hynek Schlawack e501d70b34
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533)
Since `.. module:: contextvars` sets the module using `.. class:: contextvars.Token`, intersphinx records it as `contextvars.contextvars.Token`.
2021-11-12 11:47:55 +02:00
Brandt Bucher 9178f533ff
bpo-45636: Merge all numeric operators (GH-29482) 2021-11-10 22:56:22 -08:00
Guido van Rossum 1cbaa505d0
bpo-45696: Deep-freeze selected modules (GH-29118)
This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems.

The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new.

Windows version TBD.
2021-11-10 18:01:53 -08:00
Christian Heimes fc9b622819
bpo-45723: Add --with-pkg-config to configure (GH-29517)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-10 23:02:19 +01:00
Christian Heimes 0a9f69539b
bpo-45747: Detect gdbm/dbm dependencies in configure (GH-29467)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-10 20:26:55 +01:00
Raymond Hettinger 912a4ccc3a
bpo-45701: Improve documentation for *typed* parameter (GH-29498) 2021-11-09 17:01:29 -06:00
Christian Heimes 5b7c7cb104
bpo-45763: Detect compression build deps in configure (GH-29483) 2021-11-09 16:42:53 +01:00
180909 7484a5c82a
Closes bpo-45712: Add missing word in control flow tutorial (GH-29460) 2021-11-08 10:51:01 -06:00
Victor Stinner 99c7e9853f
bpo-40170: Update What's New in Python 3.9 (GH-29470)
The PyType_HasFeature() change has been reverted: the static inline
function access directly the PyTypeObject.tp_flags member.
2021-11-08 17:41:56 +01:00
Rafael Fontenelle 19b107e9b5
bpo-45741: docs: fix plural (GH-29461)
"entry points provides" -> "entry points provide"

Automerge-Triggered-By: GH:ericvsmith
2021-11-07 22:03:44 -08:00
Andre Delfino 57457a1e5c
bpo-39452: [doc] Change "must" to "can" on relative import style in `__main__` (GH-29379) 2021-11-06 19:09:23 +01:00
Alex Waygood 77a2c77c84
[doc] bpo-45680: Improve glossary entry for generic types (GH-29388)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-06 19:00:45 +01:00
Ethan Furman 6ecead106a
[doc] minor fixes to expressions.rst (GH-29444) 2021-11-06 10:26:43 -07:00
Ethan Furman cb755dba7a
bpo-45740: [Enum] add versionadded markers to docs (GH-29443)
[Enum] add versionadded markers to docs
2021-11-06 10:16:43 -07:00
Alex Waygood 71e8a3e76a
bpo-45762: Improve docs for ``@singledispatch``/``@singledispatchmethod`` (GH-29426) 2021-11-05 17:25:08 +01:00
Alex Waygood 87032cfa3d
Remove reference to ``Tuple`` at top of ``typing`` docs (GH-29401)
``typing.Tuple`` has been deprecated since Python 3.9, so it makes no sense to mention it so prominently in the documentation for the ``typing`` module.
2021-11-04 19:48:40 +08:00
Alex Waygood e03e50377d
bpo-45680: ``typing`` docs: improve links to docs on ``GenericAlias``/``__class_getitem__`` (GH-29387) 2021-11-04 12:06:34 +08:00
Erlend Egeberg Aasland c273986711
bpo-45613: Set `sqlite3.threadsafety` dynamically (GH-29227)
Use the compile-time selected default SQLite threaded mode to set the
DB-API 2.0 attribute 'threadsafety'

Mappings:
  - SQLITE_THREADSAFE=0 => threadsafety=0
  - SQLITE_THREADSAFE=1 => threadsafety=3
  - SQLITE_THREADSAFE=2 => threadsafety=1
2021-11-03 21:01:37 +00:00
Erlend Egeberg Aasland 456e27ac0a
bpo-24139: Add support for SQLite extended result codes (GH-28076) 2021-11-02 23:49:38 +00:00
Andre Delfino 48824fa1e2
[doc] Link to section File input (GH-28941) 2021-11-02 22:34:00 +01:00
LincolnPuzey 3551bf16ee
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. (GH-28947)
Specify that SSLContext.set_default_verify_paths is called on ALL systems.

The code of SSLContext.load_default_certs was changed in bpo-22449 to do this,
this fix corrects the documentation to match that change.
2021-11-02 22:27:44 +01:00
Dmitry Smirnov 454cdb99ab
bpo-45633: Fix newtypes doc typo (GH-29318) 2021-11-02 22:47:06 +08:00
Erlend Egeberg Aasland b6b38a8226
bpo-45243: Add support for setting/getting `sqlite3` connection limits (GH-28463) 2021-11-01 22:50:53 +00:00
m-aciek 14a4fce457
bpo-45618: Update Sphinx version used to build the documentation to 4.2.0 (GH-29256)
Updating version of Sphinx to most recent one, 4.2.0. Documentation builds without warnings.

Sphinx 4.2.0 release notes: https://www.sphinx-doc.org/en/master/changes.html#release-4-2-0-released-sep-12-2021.

cc @JulienPalard

Automerge-Triggered-By: GH:JulienPalard
2021-10-31 13:51:33 -07:00
Olaf van der Spek ee464322eb
Move field width to the right field (GH-29344)
Automerge-Triggered-By: GH:vsajip
2021-10-31 10:44:23 -07:00
Filipe Laíns bc8fd7c9c2
bpo-45516: fix Traversable.name documentation (GH-29194)
Here we go again... Sorrry!

Signed-off-by: Filipe Laíns <lains@riseup.net>

Automerge-Triggered-By: GH:jaraco
2021-10-31 07:57:21 -07:00
Philipp A aae18a1740
Fix docs source link for importlib.metadata (GH-29025)
The link broke for Python 3.10 since importlib.metadata was made from a module into a package

I think this is trivial enough to not need a bpo issue.

Automerge-Triggered-By: GH:jaraco
2021-10-30 08:12:47 -07:00
andrei kulakov b17cfd150f
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-29 22:18:45 +02:00
Ian Fisher 3877fc02f7
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200) 2021-10-29 22:17:22 +02:00
Christian Heimes f0150ac94a
bpo-45548: Some test modules must be built as shared libs (GH-29268)
Some test cases don't work when test modules are static extensions.

Add dependency on Modules/config.c to trigger a rebuild whenever a
module build type is changed.

``makesetup`` puts shared extensions into ``Modules/`` directory. Create
symlinks from pybuilddir so the extensions can be imported.

Note: It is not possible to use the content of pybuilddir.txt as a build
target. Makefile evaluates target variables in the first pass. The
pybuilddir.txt file does not exist at that point.
2021-10-29 17:49:57 +02:00
Alex Waygood d9575218d7
bpo-45655: Add ref to union type expressions at top of typing docs (GH-29309) 2021-10-29 21:56:21 +08:00
Eric Snow 074fa57506
bpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)
Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module.

This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored.

https://bugs.python.org/issue45395
2021-10-28 15:04:33 -06:00
Alex Waygood 03db1bbfd2
bpo-45655: Add "relevant PEPs" section to ``typing`` documentation (GH-29280)
The list of PEPs at the top of the documentation for the ``typing`` module has
become too long to be readable. This PR proposes presenting this
information in a more structured and readable way by adding a new "relevant
PEPs" section to the ``typing`` docs.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-28 21:55:50 +02:00
Arthur Milchior d9c1868c25
bpo-45583: Correct datamodel documentation of int() (GH-29182)
It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.
2021-10-28 21:48:37 +02:00
Nikita Sobolev 1fb968c07a
bpo-45604: add `level` argument to `multiprocessing.log_to_stderr` func (GH-29226)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-10-28 21:38:14 +02:00
Erlend Egeberg Aasland 88d8a1a340
bpo-45608: Document missing `sqlite3` DB-API attributes and methods (GH-29219) 2021-10-28 21:35:51 +02:00
Justinas Petuchovas 0a68b3603f
Fix typo in Counter documentation (GH-29223)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-10-28 18:43:09 +08:00
Sam Gross 35e1ff38ee
bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246)
Objects that support garbage collection ("container" objects) should
call PyObject_GC_UnTrack() from their destructors before clearing any
fields which may point to other "container" objects.
2021-10-27 21:15:13 +02:00
m-aciek bcee6aa315
bpo-45618: Fix documentation build by pinning Docutils version to 0.17.1 (GH-29230)
Co-authored-by: Maciej Olko <maciej.olko@yougov.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-10-27 10:21:29 -04:00
Brandt Bucher 82a662e521
bpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)
* Refactor mapping patterns and speed up class patterns.

* Simplify MATCH_KEYS and MATCH_CLASS.

* Add COPY opcode.
2021-10-27 10:45:35 +01:00
Tim Golden aea5ecc458
bpo-40915: Fix mmap resize bugs on Windows (GH-29213)
(original patch by eryksun)

Correctly hand various failure modes when resizing an mmap on Windows:

* Resizing a pagefile-backed mmap now creates a new mmap and copies data
* Attempting to resize when another mapping is held on the same file raises an OSError
* Attempting to resize a nametagged mmap raises an OSError if another mapping is held with the same nametag
2021-10-26 22:56:43 +01:00
Tim Peters 51ed2c56a1
bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)
Keep track of whether unsafe_tuple_compare() calls are resolved by the very
first tuple elements, and adjust strategy accordingly. This can significantly
cut the number of calls made to the full-blown PyObject_RichCompareBool(),
and especially when duplicates are rare.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-24 22:27:24 -05:00
William Andrea 9e05da6224
Expand about soft keywords in the docs for keyword.py (GH-29139)
Add link at the top and fix the existing links to point to the "[soft keywords](https://docs.python.org/3.10/reference/lexical_analysis.html#soft-keywords)" section created in the Python 3.10 docs.

Changes should be backported to 3.10 as well.
2021-10-23 09:24:02 -07:00
Filipe Laíns 8ce20bbdd6
bpo-45516: add protocol description to the TraversableResources documentation (#29173)
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-10-23 11:47:55 -04:00
Irit Katriel f30ad65dbf
bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes (GH-28569) 2021-10-23 00:13:46 +01:00
Mark Dickinson d1b24775b4
bpo-44547: Make Fractions objects instances of typing.SupportsInt (GH-27851)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-22 00:09:47 +02:00
andrei kulakov 51375388be
bpo-41983: add availability info to socket docs (GH-27519)
* add availability info to AF_PACKET section

* add availability for AF_QIPCRTR as well
2021-10-21 23:13:37 +02:00
Mark Dickinson 887a55705b
bpo-44344: Document that pow can return a complex number for non-complex inputs. (GH-27853)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-21 22:57:49 +02:00
Christian Heimes 9942f42a93
bpo-45522: Allow to disable freelists on build time (GH-29056)
Freelists for object structs can now be disabled. A new ``configure``
option ``--without-freelists`` can be used to disable all freelists
except empty tuple singleton. Internal Py*_MAXFREELIST macros can now
be defined as 0 without causing compiler warnings and segfaults.

Signed-off-by: Christian Heimes <christian@python.org>
2021-10-21 06:12:20 -07:00
Thomas 5a14f71fe8
bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) 2021-10-21 12:19:20 +02:00
Ken Jin 2cbf50e812
bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331) 2021-10-21 10:46:48 +02:00
Ethan Furman 7c4d96103c
bpo-44174: [Enum] add reference to name mangling (GH-29116) 2021-10-20 20:32:11 -07:00
Barry Warsaw 876fc7fcec
bpo-35673: Add a public alias for namespace package __loader__ attribute (#29049)
Rename namespace package __loader__ class to be public.

Make the old name, i.e. _NamespaceLoader, an alias for the public name, for backward compatibility.
2021-10-20 14:05:29 -07:00
Hugo van Kemenade d89fb9a5a6
bpo-45320: Remove long-deprecated inspect methods (GH-28618) 2021-10-20 20:48:55 +02:00
Łukasz Langa dff0b71343
bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (GH-29094)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-10-20 18:54:31 +02:00
Alex Waygood d9e1dae35a
Add PEPs 593 & 647 to list of PEPs at top of typing docs (GH-29097) 2021-10-20 23:15:59 +08:00
Thomas Grainger a774285e7d
bpo-25625: [doc] fix async/aync typo (GH-29091) 2021-10-20 15:51:07 +02:00
Petr Viktorin 98fa3b53e2
bpo-45474: Exclude all of marshal.h if Py_LIMITED_API is defined (GH-29061)
Also, reword the What's New messages: this doesn't change the limited API, it only brings the Py_LIMITED_API macro closer to the ideal of only allowing the limited API.

Automerge-Triggered-By: GH:encukou
2021-10-20 02:32:14 -07:00
Filipe Laíns 3592980f91
bpo-25625: add contextlib.chdir (GH-28271)
Added non parallel-safe :func:`~contextlib.chdir` context manager to change
the current working directory and then restore it on exit. Simple wrapper
around :func:`~os.chdir`.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-20 00:19:27 +02:00
Julien Palard bda69abe84
[doc]: Fix missing space in c-api/init.rst and add rstlint rule (GH-28988) 2021-10-19 21:13:24 +02:00
Filipe Laíns 236e301b8a
bpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size (GH-29046)
I considered only falling back when both were 0, but that still seems
wrong, and the highly popular rich[1] library does it this way, so I
thought we should probably inherit that behavior.

[1] https://github.com/willmcgugan/rich

Signed-off-by: Filipe Laíns <lains@riseup.net>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-19 20:42:13 +02:00
Gregory P. Smith fdbdf3f735
bpo-40360: Make the 2to3 deprecation more obvious. (GH-29064) 2021-10-19 20:28:27 +02:00
Filipe Laíns 7bafa0cf58
bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047)
Signed-off-by: Filipe Laíns <lains@riseup.net>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-19 20:18:50 +02:00
Paul Ganssle 8e40ca127f
Add zoneinfo to the datetime documentation (GH-29038)
We should have done this way back when 3.9 was released, but it fell off
the radar.

Co-authored-by: Paul Ganssle <git@m.ganssle.io>
2021-10-19 20:09:41 +02:00
Victor Stinner 52af0756b2
bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API (GH-29027)
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h,
string.h and errno.h.

* Exclude Py_MEMCPY() from Python 3.11 limited C API.
* xxlimited C extension is now built with Python 3.11 limited C API.
2021-10-19 12:10:22 +02:00
Filipe Laíns c029567530
bpo-45516: use documentation links in TraversableResources' description (GH-29045)
I think this makes the documentation much more digestible :)

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-10-18 20:52:28 -04:00
Victor Stinner aad88d33d9
bpo-35134: Split warnings.h and weakrefobject.h (GH-29042)
Split header files to move the non-limited API to Include/cpython/:

* Include/warnings.h => Include/cpython/warnings.h
* Include/weakrefobject.h => Include/cpython/weakrefobject.h

Exclude PyWeakref_GET_OBJECT() from the limited C API. It never
worked since the PyWeakReference structure is opaque in the limited C
API.

Move _PyWarnings_Init() and _PyErr_WarnUnawaitedCoroutine() to the
internal C API.
2021-10-19 01:31:57 +02:00
Filipe Laíns 4d03de3329
bpo-45516: add protocol description to the Traversable documentation (#29039)
* bpo-45516: add protocol description to the Traversable documentation

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Update Doc/library/importlib.rst

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Update Lib/importlib/abc.py

* Update Doc/library/importlib.rst

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-10-18 18:58:13 -04:00
Raymond Hettinger 54a4e1b53a
Improve multiserver queue recipe (GH-29012) 2021-10-17 18:20:34 -05:00
Benjamin Szőke a27f53bdd5
Fix contributor person name in rst files (GH-29005) 2021-10-17 20:59:22 +09:00
Eric Snow b9cdd0fb9c
bpo-45020: Default to using frozen modules unless running from source tree. (gh-28940)
The default was "off".  Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything.  There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used.

https://bugs.python.org/issue45020
2021-10-16 13:16:08 -06:00
Raymond Hettinger 5afa0a4112
bpo-42222: Remove deprecated support for non-integer values (GH-28983) 2021-10-16 10:16:53 -05:00
Luca Chiodini 4ecd119b00
bpo-45463: Clarify that global statements allows multiple names (GH-28851)
The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.html#the-global-statement).

The "Execution model" chapter described the global statement as if it
only allowed one single name. Pluralize "name" in the appropriate places.
2021-10-16 08:55:12 -04:00
srinivasan 11b2ae7f5b
bpo-45442: Add deactivate step to venv tutorial. (GH-28981)
@vsajip Sorry for the trouble—made a [fairly significant] git error in the previous PR.

Have edited the patch as you had said in #28959.

Automerge-Triggered-By: GH:vsajip
2021-10-15 14:24:25 -07:00
Victor Stinner 00ffc4513d
bpo-45440: Remove pymath.c fallbacks (GH-28977)
Remove fallbacks for missing round(), copysign() and hypot() in
Python/pymath.c. Python now requires these functions to build.

These fallbacks were needed on Visual Studio 2012 and older. They are
no longer needed since Visual Stuido 2013. Python is now built with
Visual Studio 2017 or newer since Python 3.6.
2021-10-15 19:45:34 +02:00
Victor Stinner 547d26aa08
bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)
Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing()
functions to the limited C API to suspend and resume tracing and
profiling.

Add an unit test on the PyThreadState C API to _testcapi.

Add also internal _PyThreadState_DisableTracing() and
_PyThreadState_ResetTracing().
2021-10-15 16:06:30 +02:00
Victor Stinner a7f8dfd25a
bpo-44113: Move the What's New entry to Deprecate section (GH-28974) 2021-10-15 13:43:44 +02:00
Victor Stinner 105582e74c
bpo-45434: Remove Include/eval.h header file (GH-28973)
Move Include/eval.h content into Include/ceval.h and
Include/cpython/ceval.h, and remove Include/eval.h.
2021-10-15 13:06:05 +02:00
Victor Stinner 8e5de40f90
bpo-35134: Move classobject.h to Include/cpython/ (GH-28968)
Move classobject.h, context.h, genobject.h and longintrepr.h header
files from Include/ to Include/cpython/.

Remove redundant "#ifndef Py_LIMITED_API" in context.h.

Remove explicit #include "longintrepr.h" in C files. It's not needed,
Python.h already includes it.
2021-10-15 09:46:29 +02:00
Victor Stinner 77b24ba505
bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964) 2021-10-15 02:39:58 +02:00