Commit Graph

11202 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Michael Oliver 73decdf021
Remove unused `Any` from `Concatenate` example in typing docs (GH-30516) 2022-01-11 21:59:26 +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
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
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