Commit Graph

25096 Commits

Author SHA1 Message Date
Zackery Spytz 96084f4256
bpo-46747: Add missing key parameters in the bisect docs (GH-31323)
Added *key* parameter to `bisect.bisect()` and `bisect.insort()` in bisect module docs.
2022-02-14 11:16:49 -05:00
John Belmonte 1d6ce67c29
Corrections to format precision description. (GH-31291)
* `precision` field is a decimal integer
  * clarify that stated limitations are on presentation type
    rather than input value type.  Especially misleading is
    "precision is not allowed for integer values", since integer
    value input to a format like `.1f` is fine.
  * regarding max field size, replace "non-number" with "string",
    which is the only non-numeric presentation type

Automerge-Triggered-By: GH:ericvsmith
2022-02-13 16:00:32 -08:00
Terry Jan Reedy 6331c08d1c
bpo-45447: Fix entry in What's New 3.11 (GH-31307) 2022-02-12 21:12:21 -05:00
Terry Jan Reedy cef91ca80c
bpo-45447: Add entry to What's new 3.9 (GH-31305) 2022-02-12 21:11:19 -05:00
Terry Jan Reedy 2d98433549
bpo-45447: Add entry to What's new 3.10 (GH-31304) 2022-02-12 21:10:29 -05:00
Alex Waygood 50cf4991c4
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE (GH-28950)
Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues.
Add util.py to contain objects that are used in multiple idlelib modules
and have no dependencies on any of them.

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-02-12 19:04:48 -05:00
Meer Suri 9d9cfd61ec
bpo-46586: Fix documentation links (GH-31216)
* Fix enum.property documentation link
2022-02-11 20:21:38 -08:00
Erlend Egeberg Aasland ba5725171d
bpo-46355: Amend What's New in Python 3.11 C API wording (GH-31288) 2022-02-12 01:48:26 +01:00
Alex Waygood e0bc8ee945
bpo-46483: [doc] pathlib classes no longer support parameterized generics (GH-31281)
Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
2022-02-11 22:39:37 +02:00
Petr Viktorin 204946986f
bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)
* Make PyType_GetModuleByDef public (remove underscore)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-02-11 17:22:11 +01:00
Géry Ogam 4f9386661d
Fix the signature of multiprocessing.set_executable (GH-31276)
Automerge-Triggered-By: GH:merwok
2022-02-11 06:42:54 -08:00
Julien Palard b878b3af0b
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097) 2022-02-10 08:59:04 +01:00
Henry Schreiner 5a3f97291e
bpo-43532: add version added to KW_ONLY (GH-31235)
Minor missing version note mentioned at the end of  (and affected me independently before reading that note).

Automerge-Triggered-By: GH:ericvsmith
2022-02-09 12:56:10 -08:00
Jelle Zijlstra 243436f377
bpo-46475: Add typing.Never and typing.assert_never (GH-30842) 2022-02-08 10:50:26 -08:00
Victor Stinner 7a0486eaa9
bpo-46659: calendar uses locale.getlocale() (GH-31166)
The calendar.LocaleTextCalendar and calendar.LocaleHTMLCalendar
classes module now use locale.getlocale(), instead of using
locale.getdefaultlocale(), if no locale is specified.
2022-02-08 00:24:09 +01:00
James Hilton-Balfe 7ba1cc8049
bpo-46534: Implement PEP 673 Self in typing.py (GH-30924)
Co-authored-by: Pradeep Kumar Srinivasan <gohanpra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-07 12:47:48 -08:00
Victor Stinner a89772c791
bpo-46166: Fix compiler warnings in What's New in Python 3.11 (GH-31198)
Fix compiler warnings on PyObject_GetAttrString() calls in the What's
New in Python 3.11 doc of PyFrameObject changes.
2022-02-07 17:46:22 +01:00
Hugo van Kemenade 6c4e44ef8a
bpo-23952: Document cgi module's maxlen variable (GH-30338) 2022-02-06 05:59:32 -08:00
Julien Palard fa90e48c53
[doc] Enhance readability by avoiding big blocks for small numbers. (GH-31157)
Initially reported by Gregory Jacob on the docs@ mailing list:

https://mail.python.org/archives/list/docs@python.org/thread/VPSFGLOZOHSPF7TGPOI65AOH25TCPSVR/
2022-02-06 13:44:04 +01:00
Victor Stinner 54842e4311
bpo-46640: Py_NAN now uses the C99 NAN constant (GH-31134)
Building Python now requires a C99 <math.h> header file providing a
NAN constant, or the __builtin_nan() built-in function. If a platform
does not support Not-a-Number (NaN), the Py_NO_NAN macro can be
defined in the pyconfig.h file.
2022-02-06 13:13:04 +01:00
Christophe Nanteuil f1e29cea85
Allows to specify the port on which serve documentation (GH-31145)
[user@localhost]$ make serve      # default configuration, no change
python3 ../Tools/scripts/serve.py build/html
Serving build/html on port 8000, control-C to stop
^CShutting down.

[user@localhost]$ make serve SERVE_PORT=8080 # new option
python3 ../Tools/scripts/serve.py build/html 8080
Serving build/html on port 8080, control-C to stop
2022-02-06 11:22:06 +01:00
andrei kulakov fea7290a0e
bpo-31369: include ``RegexFlag`` in ``re.__all__`` (GH-30279)
* added RegexFlag to re.__all__; added RegexFlag.NOFLAG

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-04 19:54:28 -08:00
Kumar Aditya bf95ff91f2
bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB space (GH-31074)
This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space.
```console 
# du -s ./python before
27892   ./python
# du -s ./python after
27524   ./python
```

Automerge-Triggered-By: GH:ericsnowcurrently
2022-02-04 09:57:03 -08:00
Manish Kumar ⛄ ba650af7d6
Optimize images by IMGbot (GH-21348)
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2022-02-04 15:49:43 +09:00
Nikita Sobolev 734b1f119b
bpo-46569: [Enum] fix typo in `StrEnum` docs (GH-31007) 2022-02-03 07:22:41 -08:00
Miro Hrončok 6baa98e538
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH-31098) 2022-02-03 07:48:13 -06:00
Zackery Spytz b4bd1e1422
bpo-44977: Deprecate delegation of int to __trunc__ (GH-31031)
Calling int(a) when type(a) implements __trunc__ but not __int__
or __index__ now raises a DeprecationWarning.
2022-02-03 11:43:25 +02:00
Nikita Sobolev 7ffe7ba30f
bpo-46483: Remove `__class_getitem__` from `pathlib.PurePath` (GH-30848)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-02-03 11:25:10 +02:00
Hugo van Kemenade e8659b47de
bpo-45173: Keep configparser deprecations until Python 3.12 (GH-30952)
* Revert "bpo-45173 Remove configparser deprecations"

This reverts commit df2284bc41.

* bpo-45173: Note these configparser deprecations will be removed in 3.12
2022-02-02 08:59:39 -08:00
Christian Heimes f66c857572
bpo-45459: Add Py_buffer to limited API (GH-29991)
- [x] ``Py_buffer`` struct
- [x] ``PyBuffer_*()`` API functions
- [x] ``PyBUF_*`` constants
- [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots
- [x] ``PyMemoryView_FromBuffer()`` API
- [x] tests for limited API
- [x] ``make regen-limited-abi``
- [x] documentation update
- [ ] export ``PyPickleBuffer*()`` API ???
2022-02-02 07:03:10 -08:00
Raymond Hettinger 06a491179f
Add recipe for subslices (GH-31028) 2022-02-01 22:18:52 -06:00
Raymond Hettinger f77beacf01
Fix minor details in the Counter docs (GH-31029) 2022-02-01 22:18:11 -06:00
Jelle Zijlstra abcc3d75f6
bpo-46414: Add typing.reveal_type (#30646)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-01 18:48:55 -08:00
Petr Viktorin a4cb31927a
bpo-46355: What's New: Note that PyFrameObject are private (GH-31032)
This adds a slightly more detailed explanation of the change.
The most important point is that the changed/removed fields
were "subject to change" to begin with.
2022-02-01 02:22:34 -08:00
Barney Gale 18cb2ef46c
bpo-29688: document and test `pathlib.Path.absolute()` (GH-26153)
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Brian Helba <brian.helba@kitware.com>
2022-01-28 15:40:55 -08:00
Mark Shannon 89fd7c3452
bpo-46329: Split calls into precall and call instructions. (GH-30855)
* Add PRECALL_FUNCTION opcode.

* Move 'call shape' varaibles into struct.

* Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions.

* Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol.

* Allow kwnames for specialized calls to builtin types.

* Specialize calls to tuple(arg) and str(arg).
2022-01-28 12:42:30 +00:00
Julien Palard 44afdbd5af
bpo-42238: [doc] Avoid hardcoding fast-moving lines in susp-ignored.csv. (GH-30981) 2022-01-28 10:50:58 +01:00
Victor Stinner 18ea973c21
bpo-40170: Remove PyHeapType_GET_MEMBERS() macro (GH-30942)
Remove the PyHeapType_GET_MEMBERS() macro. It was exposed in the
public C API by mistake, it must only be used by Python internally.
Use the PyTypeObject.tp_members member instead.

Rename PyHeapType_GET_MEMBERS() to _PyHeapType_GET_MEMBERS() and move
it to the internal C API.
2022-01-28 00:39:52 +01:00
Gregory P. Smith ace0aa2a27
bpo-42982: update pbkdf2 example & add another link (GH-30966)
Automerge-Triggered-By: GH:gpshead
2022-01-27 12:18:28 -08:00
Kinshuk Dua 08c0ed2d9c
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) 2022-01-27 10:24:48 +00:00
Illia Volochii 897ce90187
bpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276)
Less specific number wording (as there is no one right number - the old 100k is too big for some applications and woefully small for others). We now link to NIST SP 800-132 to tell people what to read in there on how to decide for their application.

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2022-01-27 00:39:09 -08:00
Julien Palard bcafab849e
[doc]: Spotted errors while working on rstlint. (GH-30879)
Also ignored some `make suspicious` false positives while assuring
true positives were properly seen by rstlint.
2022-01-27 08:57:43 +01:00
Gregory P. Smith b50322d203
bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)
Revert "bpo-45162: Remove many old deprecated unittest features (GH-28268)"

This reverts commit b0a6ede3d0.

We're deferring this change until 3.12 while upstream projects that use
the legacy assertion method names are fixed.  See the issue for links
to the discussion. Many upstream projects now have issues and PRs
filed.
2022-01-26 20:39:15 -08:00
Terry Jan Reedy fcde0bc10d
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936)
In the File menu, 'Close' and 'Exit' are now 'Close Window' (the current
one) and 'Exit' is now 'Exit IDLE' (by closing all windows).
In Shell, 'quit()' and 'exit()' mean 'close Shell'.
If there are no other windows, this also exits IDLE.
2022-01-26 22:16:31 -05:00
Mateusz Łoskot f0a648152f
bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925)
Since,

- Py_CompileString no longer allows to distinguish "incomplete input"
  from "invalid input"
- there is no alternative solution available from the Python C API
  due to how the new parser works (rewritten in 3.9)
- the only supported way is to manually import the codeop module from C
  and use its API as IDLE does, and accept its own complications

it is desirable to remove this Q&A from the official FAQ.
2022-01-26 23:49:06 +00:00
Brandt Bucher 8548366864
bpo-46528: Simplify the VM's stack manipulations (GH-30902) 2022-01-26 12:47:45 -08:00
Nikita Sobolev b9d8980d89
bpo-43698: do not use `...` as argument name in docs (GH-30502) 2022-01-26 19:06:10 +09:00
Terry Jan Reedy 7cf285d82e
bpo-41844: Update IDLE part of What's New 3.9 to 20228 (GH-30905) 2022-01-25 23:49:54 -05:00
Terry Jan Reedy 4a49fa6ca6
bpo-48146: Update IDLE part of What's New 3.10 to 2022 (GH-30906) 2022-01-25 23:48:53 -05:00
Raymond Hettinger ee60550e9b
Move doctests to the main docs. Eliminate duplication. Improve coverage. (GH-30869) 2022-01-25 06:56:53 -06:00
Irit Katriel b18fd54f8c
bpo-46431: Add example of subclassing ExceptionGroup. Document the message and exceptions attributes (GH-30852) 2022-01-24 21:50:18 +00:00
Irit Katriel 80e1def9de
bpo-45711: move whatsnew entries which are incorrectly listed under New Features (GH-30849) 2022-01-24 17:44:42 +00:00
Mario Corchero d7c6863979
bpo-41906: Accept built filters in dictConfig (GH-30756)
When configuring the logging stack, accept already built filters (or
just callables) in the filters array of loggers and handlers.
This facilitates passing quick callables as filters.

Automerge-Triggered-By: GH:vsajip
2022-01-24 04:39:50 -08:00
Nikita Sobolev 58f3d98098
bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-01-24 14:09:20 +03:00
Mark Shannon 0367a36fdc
bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)
* Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators.

* Split SEND into SEND; YIELD_VALUE.

* Document new opcodes.
2022-01-24 11:08:53 +00:00
Jelle Zijlstra d75a51bea3
fix typo in typing.rst (#30841) 2022-01-23 15:36:08 -08:00
Raymond Hettinger 270a09184d
Improve grouper() recipe to demonstrate all forms of zip() (GH-30837) 2022-01-23 14:31:10 -06:00
Jelle Zijlstra c8a536624e
bpo-46468: document that "-m http.server" defaults to port 8000 (GH-30776)
Code link:
70c16468de/Lib/http/server.py (L1270)

It's been this way since at least 3.4.

Also improved some wording in the same section.
2022-01-22 14:31:15 +02:00
Nikita Sobolev 5d73524116
bpo-46460: remove duplicated `versionchanged` from `dis.rst` (GH-30752) 2022-01-22 11:15:58 +00:00
Steve Dower 57d1855682
bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file (GH-30768) 2022-01-21 21:51:15 +00:00
Thomas Klausner 40fcd16889
bpo-30512: Add CAN Socket support for NetBSD (GH-30066) 2022-01-21 09:44:05 +02:00
Mark Shannon b04dfbbe4b
bpo-46409: Make generators in bytecode (GH-30633)
* Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes.

* Trim frame and generator by word each.

* Minor refactor of frame.c

* Update test.test_sys to account for smaller frames.

* Treat generator functions as normal functions when evaluating and specializing.
2022-01-20 11:46:39 +00:00
Piotr Fusik d05a66339b
no-issue: Fix documentation typos. (GH-30576) 2022-01-20 17:17:15 +09:00
Florian Bruhin 4b99803b86
doc: Clarify os.urandom return type (#30282)
Other descriptions in the same file also use 'bytestring' to refer to bytes objects
2022-01-19 13:22:15 -08:00
Evan d45cd2d207
Update documentation in datetime module strftime-and-strptime-behavior fix typo in '%W' format code description (GH-30232)
A small change to the documentation of datetime module , in the format codes section of stftime and strptime. Changed the description of format code '%W' from 'as a decimal number' to 'a zero padded   decimal number' so it's in line with the example having leading zeros.  Similar to the format code '%U' above.

Automerge-Triggered-By: GH:pganssle
2022-01-19 09:39:57 -08:00
Ken Jin 1faf7c4eff
bpo-45680: Minor formatting fix in stdtypes.rst (GH-30690)
Makes quotation consistent with rest of docs in commit 0eae9a2a2d.
2022-01-19 23:37:05 +08:00
Alex Waygood 0eae9a2a2d
bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335)
The documentation on ``GenericAlias`` objects implies at multiple points that
only container classes can define ``__class_getitem__``. This is misleading.
This PR proposes a rewrite of the documentation to clarify that non-container
classes can define ``__class_getitem__``, and to clarify what it means when a
non-container class is parameterized.

See also: initial discussion of issues with this piece of documentation in
GH-29308, and previous BPO issue [42280](https://bugs.python.org/issue42280).

Also improved references in glossary and typing docs. Fixed some links.

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-01-19 22:53:41 +08:00
Irit Katriel 3bf6315c4c
bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) 2022-01-19 12:03:51 +00:00
Victor Stinner a847785b40
bpo-43869: Time Epoch is the same on all platforms (GH-30664) 2022-01-19 11:27:11 +01:00
John Marshall 3852269b91
bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)
This addresses [bpo-45554]() by expanding the `exitcode` documentation to also describe what `exitcode` will be in cases of normal termination, `sys.exit()` called, and on uncaught exceptions.

Automerge-Triggered-By: GH:pitrou
2022-01-18 13:31:27 -08:00
Kumar Aditya 65940fa5c1
bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) 2022-01-18 21:53:43 +02:00
Miguel Brito ff7703c4b6
bpo-43869: Improve epoch docs (GH-25777) 2022-01-18 16:55:16 +01:00
Erlend Egeberg Aasland bdf2ab1887
bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)
Provide some examples of URI parameters in sqlite connect().

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2022-01-18 07:37:02 -05:00
bneuburg c47c9e6589
bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889)
The option must be enabled from the command line
2022-01-18 00:18:44 +00:00
Ethan Furman 62a6594e66
bpo-40066: [Enum] fix tests (GH-30643)
- skip doctest that changes depending on target system
- skip doctest that only fails on CI
- substitute in values that change depending on target system
2022-01-17 08:52:42 -08:00
Kumar Aditya 83d544b929
bpo-40066: [Enum] skip failing doc test (GH-30637) 2022-01-17 07:18:13 -08:00
Victor Stinner 42a64c03ec
Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
This reverts commit acf7403f9b.
2022-01-17 13:58:40 +01:00
Ethan Furman acf7403f9b
bpo-40066: [Enum] update str() and format() output (GH-30582)
Undo rejected PEP-663 changes:

- restore `repr()` to its 3.10 status
- restore `str()` to its 3.10 status

New changes:

- `IntEnum` and `IntFlag` now leave `__str__` as the original `int.__str__` so that str() and format() return the same result
- zero-valued flags without a name have a slightly changed repr(), e.g. `repr(Color(0)) == '<Color: 0>'`
- update `dir()` for mixed-in types to return all the methods and attributes of the mixed-in type
- added `_numeric_repr_` to `Flag` to control display of unnamed values
- enums without doc strings have a more comprehensive doc string added
- `ReprEnum` added -- inheriting from this makes it so only `__repr__` is replaced, not `__str__` nor `__format__`; `IntEnum`, `IntFlag`, and `StrEnum` all inherit from `ReprEnum`
2022-01-15 22:41:43 -08:00
Hugo van Kemenade 305588c67c
bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) 2022-01-14 14:49:12 -08:00
Mark Dickinson 025cbe7a9b
bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497) 2022-01-14 18:54:56 +00:00
Hugo van Kemenade 73140de97c
bpo-23183: Document the timeit output (GH-30359)
Co-authored-by: Robert Collins <robertc@robertcollins.net>
2022-01-14 17:25:36 +00:00
Victor Stinner 0885999a8e
bpo-46355: Document PyFrameObject and PyThreadState changes (GH-30558)
Document PyFrameObject and PyThreadState changes in What's New in
Python 3.11 and explain how to port code.
2022-01-13 19:21:50 +01:00
Irit Katriel c590b581bb
bpo-46328: Add sys.exception() (GH-30514) 2022-01-13 12:35:58 +00:00
Christian Heimes 443b308fee
bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455) 2022-01-13 09:46:38 +01:00
Jelle Zijlstra 0bbf30e2b9
bpo-46342: make @typing.final introspectable (GH-30530)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-01-12 11:38:25 -08:00
Ben Kehoe dce642f244
bpo-46307: Add string.Template.get_identifiers() method (GH-30493)
Add `string.Template.get_identifiers()` method that returns the identifiers within the template. By default, raises an error if it encounters an invalid identifier (like `substitute()`). The keyword-only argument `raise_on_invalid` can be set to `False` to ignore invalid identifiers (like `safe_substitute()`).

Automerge-Triggered-By: GH:warsaw
2022-01-11 11:15:42 -08:00
Julien Palard 6f05e1ec19
[doc] Add license_url for python-docs-theme 2022.1. (GH-30527) 2022-01-11 17:32:42 +01:00
Julian Gilbey 43c5c1369c
closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387) 2022-01-11 08:33:06 -06:00
Michael Oliver 73decdf021
Remove unused `Any` from `Concatenate` example in typing docs (GH-30516) 2022-01-11 21:59:26 +08:00
Nikita Sobolev 6223cbf86a
bpo-45331: [Enum] add rule to docs that mixin type must be subclassable (GH-30521) 2022-01-10 15:42:45 -08:00
Raymond Hettinger d24cd49acb
bpo-46270: Describe the `in` and `not in` operators as membership tests. (GH-30504) 2022-01-09 18:02:06 -08:00
Inada Naoki 0b2b9d2513
bpo-23882: unittest: Drop PEP 420 support from discovery. (GH-29745) 2022-01-10 10:38:33 +09:00
Erlend Egeberg Aasland b6aa38f1ca
bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407) 2022-01-08 21:17:09 +02:00
Zsolt Dollenstein ef5376e69e
bpo-46290: Fix parameter names in dataclasses docs (GH-30450) 2022-01-08 12:56:35 +02:00
Hugo van Kemenade 6d07a9fb7c
bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360)
Co-authored-by: Ian Kelling <ian@iankelling.org>
2022-01-07 19:41:23 +00:00
Jacob Walls 273cb8e757
bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) 2022-01-07 18:39:40 +00:00
Irit Katriel 9b7aa6a9d6
bpo-46216: remove spurious link to os.system() from os.time() documentation (GH-30326)
Automerge-Triggered-By: GH:iritkatriel
2022-01-07 10:28:08 -08:00
Vinay Sajip 46c7a6566b
bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411) 2022-01-06 22:35:08 +00:00
Irit Katriel 9925e70e48
bpo-45292: [PEP-654] exception groups and except* documentation (GH-30158) 2022-01-06 19:05:34 +00:00
Mark Shannon e028ae99ec
bpo-45923: Handle call events in bytecode (GH-30364)
* Add a RESUME instruction to handle "call" events.
2022-01-06 13:09:25 +00:00
penguin_wwy 3db762db72
bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019) 2022-01-06 11:38:35 +00:00
Nikita Sobolev e5894ca8fd
bpo-46266: Add calendar day of week constants to __all__ (GH-30412) 2022-01-05 14:21:04 -06:00
Brandt Bucher 31e43cbe5f
bpo-46009: Remove GEN_START (GH-30367) 2022-01-04 11:38:32 -08:00
Philipp Claßen f404e26d74
Fix missing "," in the documentation of Executor Objects (GH-30404) 2022-01-04 10:48:04 -08:00
Kumar Aditya 7d7817cf0f
bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168)
* bpo-20369: concurrent.futures.wait() now deduplicates futures given as arg.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2022-01-04 13:36:13 +00:00
Hugo van Kemenade b949845b36
bpo-33252: Document that ResourceWarning is ignored by default (GH-30358)
`ResourceWarning` is ignored by default.

Document this behaviour, for consistency with others in this table such as `DeprecationWarning`.

Documentation PR can skip NEWS file.

Automerge-Triggered-By: GH:iritkatriel
2022-01-04 03:34:31 -08:00
Pablo Galindo Salgado e09d94a140
bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs (GH-30341) 2022-01-04 10:42:15 +00:00
Irit Katriel a94461d718
bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)
* bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE

* do not assume that an exception group is truthy
2022-01-04 10:37:12 +00:00
Erlend Egeberg Aasland a09062c267
bpo-44092: Move What's New entry to where it belongs (GH-30381) 2022-01-04 09:36:30 +00:00
David Gilbertson bef48837e7
Update old-style strings to f-strings (GH-30384)
Let me know if this sort of change is unwanted...
2022-01-04 01:25:56 -08:00
Hugo van Kemenade 2db5613063
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
Remove the bit about subclassing exceptions.

Documentation PR can skip the NEWS label.

Automerge-Triggered-By: GH:iritkatriel
2022-01-03 14:52:09 -08:00
Raymond Hettinger 770f43d47e
Add doctest and improve readability for move_to_end() example. (#30370) 2022-01-03 14:26:08 -08:00
Irit Katriel 51700bf08b
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) 2022-01-03 20:10:07 +00:00
Erlend Egeberg Aasland 9d6a239a34
bpo-44092: Don't reset statements/cursors before rollback (GH-26026)
In SQLite versions pre 3.7.11, pending statements would block a rollback.  This is no longer the case, so remove the workaround.
2022-01-03 19:02:39 +00:00
David CARLIER c960b191b8
bpo-46222: posixmodule sendfile FreeBSD's constants updates. (GH-30327)
* posixodule sendfile FreeBSD's constants updates.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2022-01-03 15:01:04 +02:00
Irit Katriel 65e7c1f90e
bpo-46219, 46221: simplify except* implementation following exc_info changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289) 2022-01-02 23:22:42 +00:00
Jade Lovelace 8e75c6b49b
argparse docs: prog default is the basename of argv[0] (GH-30298) 2022-01-02 12:16:25 -08:00
Benjamin Peterson ba00f0d93a
Update copyright year to 2022. (GH-30335)
Automerge-Triggered-By: GH:benjaminp
2022-01-02 12:08:48 -08:00
Nikita Sobolev ce4d25f3cd
bpo-46196: document method cmd.Cmd.columnize (#30303)
The method is already written and tested, now it's officially public.
2022-01-02 13:33:20 -05:00
Hugo van Kemenade 7a8796dc67
bpo-45903: Fix typo in What's New: Signature.from_builtin is removed (GH-29813) 2022-01-02 08:51:56 -08:00
Raymond Hettinger a09bc3a404
bpo-46095: Improve SeqIter documentation. (GH-30316) 2022-01-01 10:37:26 -08:00
Raymond Hettinger ac4eea2172
bpo-46079: Replace external link that is down for maintenance. (GH-30315) 2022-01-01 09:49:55 -08:00
Sebastian Pipping e18d81569f
bpo-45321: Add missing error codes to module `xml.parsers.expat.errors` (GH-30188)
The idea is to ensure that module `xml.parsers.expat.errors`
contains all known error codes and messages,
even when CPython is compiled or run with an outdated version of libexpat.

https://bugs.python.org/issue45321
2021-12-31 10:57:00 +01:00
Jason R. Coombs 99945c6b5c
bpo-46109: Separate out files relating to importlib.resources (GH-30160)
* Separate out files relating to importlib.resources

* Update Introduction to direct readers to the submodule documentation.

* Create separate file for abcs relating to resources.

* Move abc docs back to where they were.
2021-12-30 21:17:05 -05:00
Hugo van Kemenade 2cf7d02b99
bpo-46178: Remove/rename redundant Travis CI code (#30309) 2021-12-30 16:16:27 -08:00
Nikita Sobolev fbaf2e604c
bpo-46184: remove `netlify.toml` (#30272)
* bpo-46184: remove `netlify.toml`

* Delete runtime.txt

* Delete requirements.txt

* Revert "Delete requirements.txt"

This reverts commit 9aa4f0631f.
2021-12-30 13:18:37 -08:00
Nikita Sobolev d12bec6993
bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241) 2021-12-30 10:30:13 +09:00
David CARLIER 66c47b63a0
bpo-46176: mmap module adding MAP_STACK constant. (GH-30252) 2021-12-29 22:52:29 +09:00
David Gilbertson f9a4352056
Fix typo in io.rst (GH-30218) 2021-12-26 13:11:08 +02:00
Joe 10bf0a9ac3
doc: fix a typo in unittest.mock.rst (GH-30227) 2021-12-26 13:09:17 +02:00
Rafael Fontenelle c1d7a6bed9
docs: Fix typos and use anchor for internal link (GH-30236) 2021-12-26 12:43:06 +02:00
Nikita Sobolev 1b30660c3b
bpo-46120: State that `|` is preferred over `Union` (GH-30222)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2021-12-24 13:36:09 -08:00
Kumar Aditya cf15419a99
typos (#30239) 2021-12-23 12:25:12 +02:00
Kumar Aditya 71ef0b4c2b
bpo-46157: fix typo in docs (GH-30237) 2021-12-23 11:17:31 +02:00
David Hewitt 31ff96712e
bpo-46140: take more Py_buffer arguments as const * (GH-30217) 2021-12-22 15:07:46 +02:00
Mark Dickinson e9a01e231a
Update potentially confusing note for mean. (GH-30174) 2021-12-21 09:00:53 +00:00
Alex Waygood 7c5c3f7254
bpo-46104: Fix example broken by GH-30148 (GH-30203)
See discussion in GH-30179.
2021-12-20 12:48:35 +08:00
Raymond Hettinger 29ea68bd1d
Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)
This reverts commit 2ef06d4125.
2021-12-19 15:05:46 -06:00
Matti Picus 2ef06d4125
bpo-46131: add fastpath for PyFloat_Check() (#30200) 2021-12-19 14:24:30 -06:00
Alex Waygood aeb9ef4c72
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109) 2021-12-19 14:20:07 -06:00
Rafael Fontenelle 3d3615f41f
bpo-46130: [docs] Add anchor for whatsnew/3.10 type hint section (GH-30199)
This allows the title to be translated to other languages without linking problems.
2021-12-19 22:06:35 +08:00
Kumar Aditya da4b214304
bpo-42413: Replace `concurrent.futures.TimeoutError` and `asyncio.TimeoutError` with builtin `TimeoutError` (GH-30197)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-12-19 13:22:40 +02:00
Matthias Bussonnier fe68486197
bpo-46044: Fix doc typo introduced in GH-30043 (GH-30171)
See https://github.com/python/cpython/pull/30043/files#r770944718

My bad I likely messed up by using a repeat command in my editor

Automerge-Triggered-By: GH:merwok
2021-12-18 13:19:07 -08:00
andrei kulakov ae36cd1e79
bpo-37578: glob.glob -- added include_hidden parameter (GH-30153)
Automerge-Triggered-By: GH:asvetlov
2021-12-18 06:23:34 -08:00
Vivek Vashist 6f2df42951
bpo-46113: Minor fixes in stdtypes documentation (GH-30167)
* Fix#1 - isidentifier() function output

* Fix#2 Update the str.splitlines() function parameter

* Fix#3 Removed unwanted full stop for str and bytes types double quotes examples.

* Fix#4 Updated class dict from **kwarg to **kwargs
2021-12-18 21:52:51 +08:00
Alex Waygood 6ada013df1
bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-12-18 18:23:51 +08:00
Irit Katriel 396b58345f
bpo-45711: Remove type and traceback from exc_info (GH-30122)
* Do not PUSH/POP traceback or type to the stack as part of exc_info

* Remove exc_traceback and exc_type from _PyErr_StackItem

* Add to what's new, because this change breaks things like Cython
2021-12-17 14:46:22 +00:00
Julien Palard 62a0a2a25d
Doc: some rst linting. (GH-30149) 2021-12-17 13:55:03 +01:00
Matthias Bussonnier ecdc0ccede
bpo-46044: Annotate deprecated sdists formats (GH-30043)
While this page have deprecated informations it is still heavily index
by Google.

Discussed on twitter: https://twitter.com/brettsky/status/1469465729082662916
2021-12-16 11:57:39 -08:00
Irit Katriel 30322c497e
bpo-22047: [argparse] deprecate nested argument groups and mutually exclusive groups (GH-30098) 2021-12-16 15:31:08 +00:00
Mark Shannon 4506bbede1
bpo-46072: Document --enable-stats option. (GH-30139) 2021-12-16 13:40:54 +00:00
Vivek Vashist c5d18a5014
Fix the output of built-in iter() function example in Iterators (Section 9.8) of The Python Tutorial (GH-30110)
Updated the output for it=iter(s) from <iterator object at 0x00A1DB50> to <str_iterator object at 0x10c90e650>
2021-12-16 18:40:12 +08:00
Irit Katriel a951c95a13
bpo-28816: [doc] clarify that zipimport invokes importers only for python files (GH-30060) 2021-12-16 09:12:24 +00:00
Vivek Vashist f025ae63dc
Add Positional only arguments forward slash (/) to sorted() function in Built-in Functions document (GH-30113)
sorted() function is missing forward slash (/) in Built-in Functions documentation page.

Automerge-Triggered-By: GH:asvetlov
2021-12-15 03:24:38 -08:00
Mark Shannon f54fee7f37
Document new call opcodes for 3.11 (GH-30107) 2021-12-14 23:40:44 +00:00
Mark Shannon 9f8f45144b
bpo-44525: Split calls into PRECALL and CALL (GH-30011)
* Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW.

* Update specialization to handle new CALL opcodes.

* Specialize call to method descriptors.

* Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
2021-12-14 18:22:44 +00:00
Irit Katriel d60457a667
bpo-45292: [PEP-654] add except* (GH-29581) 2021-12-14 16:48:15 +00:00
Alex Waygood 1cbb88736c
bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)
The "Color" example in the pattern-matching section of the "control flow" documentation is not immediately runnable, leading to confusion.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-12-14 23:04:29 +08:00
Vinay Sajip cb589d1b6b
bpo-46063: Improve algorithm for computing which rolled-over log file… (GH-30093) 2021-12-14 00:53:37 +00:00
Christian Heimes eb483c46d6
bpo-45949: Pure Python freeze module for cross builds (GH-29899) 2021-12-13 20:48:46 +01:00
Gareth Rees a62be77266
bpo-45643: Add signal.SIGSTKFLT on platforms where this is defined (GH-29266) 2021-12-13 18:22:43 +01:00
Paul Bryan e09705f58f
Clarify new_event_loop return value. (GH-30078) 2021-12-13 14:39:22 +02:00
Irit Katriel 481f3ffdbe
bpo-37602: Clarify that the lib2to3 nonzero fixer changes only definitions (GH-30075) 2021-12-13 10:04:34 +00:00
Andre Delfino d0669c5e69
Remove erroneous padding in dataclasses (GH-30076)
Automerge-Triggered-By: GH:ericvsmith
2021-12-12 10:05:48 -08:00
Georg Brandl f4095e53ab
bpo-45855: document that `no_block` has no use anymore in PyCapsule_Import (#29665) 2021-12-12 10:49:50 +01:00
Eric V. Smith e029c53e1a
bpo-44674: Use unhashability as a proxy for mutability for default dataclass __init__ arguments. (GH-29867)
`@dataclass` in 3.10 prohibits using list, dict, or set as default values. It does this to avoid the mutable default problem. This test is both too strict, and not strict enough. Too strict, because some immutable subclasses should be safe, and not strict enough, because other mutable types should be prohibited. With this change applied, `@dataclass` now uses unhashability as a proxy for mutability: if objects aren't hashable, they're assumed to be mutable.
2021-12-11 16:12:17 -05:00
180909 4fe5585240
bpo-19737: Improved the documentation for globals (GH-29823)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-12-11 01:04:21 +01:00
Louis Sautier c1051e08b3
bpo-42114: ctypes documentation: fix winmode parameter default value (GH-29976)
Signed-off-by: Louis Sautier <sautier.louis@gmail.com>
2021-12-11 00:00:02 +01:00
andrei kulakov 8c74713d0e
bpo-42182: stdtypes doc - update and fix links to several dunder methods (GH-27384) 2021-12-10 11:40:06 +02:00
Gabriele N. Tornetta 50669083fe
bpo-43931: Export Python version as API data (GH-25577)
When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...).

Automerge-Triggered-By: GH:pablogsal
2021-12-09 17:52:05 -08:00
Kumar Aditya b123ad8030
bpo-46016: Fix rest syntax of GH-29993 (GH-30006) 2021-12-09 15:24:32 +01:00
Bernát Gábor e2cfc89e09
bpo-45391: mark UnionType as a class in documentation (GH-28757)
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
2021-12-09 20:56:14 +08:00
Victor Stinner 73325bbe77
bpo-46007: Exclude PyUnicode_CHECK_INTERNED() from limited C API (GH-29987)
Exclude the PyUnicode_CHECK_INTERNED() macro from the limited C API,
because it uses the PyASCIIObject structure which is excluded from
the limited C API.

Automerge-Triggered-By: GH:encukou
2021-12-09 00:58:09 -08:00
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