Commit graph

885 commits

Author SHA1 Message Date
Miss Islington (bot)
ec00397912
[3.12] gh-111181: Fix enum doctests (GH-111180) (GH-111518)
gh-111181: Fix enum doctests (GH-111180)
(cherry picked from commit c4dc5a6ae8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-10-31 15:01:28 -07:00
Miss Islington (bot)
4d781bce27
[3.12] gh-110383: Italicize variable name (GH-111206) (#111207)
Co-authored-by: Nick <Nikki1993@users.noreply.github.com>
2023-10-23 11:11:41 +03:00
Miss Islington (bot)
8f94d0f692
[3.12] gh-110383: Added explanation about simplest regex use case for quantifiers. (GH-111110) (#111204)
Co-authored-by: Nick <Nikki1993@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-23 07:31:56 +00:00
Erlend E. Aasland
e8d04190c6
[3.12] GH-107518: Remove the Argument Clinic How-To (#109900) (#110760)
(cherry picked from commit d1f7fae424)

* Remove the content of the Argument Clinic HOWTO
* Update cross-references to the Argument Clinic
* Add a note directing readers to the devguide

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-12 09:37:37 +00:00
Ezio Melotti
7d5a982609
[3.12] gh-110631: Fix reST indentation (GH-110724) (#110738)
* Fix wrong indentation in the other dirs.

* Fix more wrong indentation..
(cherry picked from commit 718391f475)
2023-10-11 23:12:36 +02:00
Miss Islington (bot)
5635913125
[3.12] Fix env var typo in perf profiling docs (GH-110404) (#110414)
Fix env var typo in perf profiling docs (GH-110404)

Fix typo in docs
(cherry picked from commit a13620685f)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-10-05 20:40:19 +03:00
Miss Islington (bot)
d2a31319a5
[3.12] gh-101100: Fix references to `URLError and HTTPError in howto/urllib2.rst` (GH-107966) (#110086)
gh-101100: Fix references to ``URLError`` and ``HTTPError`` in ``howto/urllib2.rst`` (GH-107966)
(cherry picked from commit bfd94ab9e9)

Co-authored-by: Yuki K <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-29 15:30:44 +02:00
Miss Islington (bot)
2622b13046
[3.12] gh-109634: Use :samp: role (GH-109635) (#109776)
gh-109634: Use :samp: role (GH-109635)
(cherry picked from commit 92af0cc580)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-24 13:54:36 +02:00
Miss Islington (bot)
8c3793a539
[3.12] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (#108733)
gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704)

When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
(cherry picked from commit d48760b2f1)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-09-01 00:04:55 +02:00
Miss Islington (bot)
420db1027b
[3.12] gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (#108680)
gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678)
(cherry picked from commit c7cef54631)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-30 15:21:58 +02:00
Miss Islington (bot)
09487a202f
[3.12] gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434) (#108409)
gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434)

https://docs.python.org/3/howto/pyporting.htmlGH-porting-python-2-code-to-python-3 was written for another time. In this patch:

- material that frames Python 3 as "new" is removed
- descriptions and directions have been trimmed
(cherry picked from commit 809ea7c4b6)

Co-authored-by: Daniele Procida <daniele@vurt.org>
2023-08-24 12:30:57 +02:00
Miss Islington (bot)
a27f18a382
[3.12] docs: fix grammar in isolating-extensions.rst (GH-108037) (#108218)
docs: fix grammar in isolating-extensions.rst (GH-108037)
(cherry picked from commit 47022a079e)

Co-authored-by: David Lechner <david@pybricks.com>
2023-08-21 21:40:08 +02:00
Miss Islington (bot)
19863c36d2
[3.12] Docs: Argument Clinic: Move the CConverter class to the reference (GH-107671) (#107701)
Docs: Argument Clinic: Move the CConverter class to the reference (GH-107671)
(cherry picked from commit a6675b1a59)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-07 12:03:07 +02:00
Miss Islington (bot)
e94548479a
[3.12] Docs: Argument Clinic: Improve 'How to write a custom converter' (GH-107328) (#107669)
Docs: Argument Clinic: Improve 'How to write a custom converter' (GH-107328)

- Omit unneccesary wording and sentences
- Don't mention implementation details (no digression, explanation)

(cherry picked from commit 4a5b4221e3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-08-06 22:09:00 +02:00
Miss Islington (bot)
236cdadb08
[3.12] gh-107432 Fix incorrect indentation in annotations HOWTO (GH-107445) (#107654)
gh-107432 Fix incorrect indentation in annotations HOWTO (GH-107445)

gh-107432 Fix incorrect indentation in annotations document

Body text in https://docs.python.org/3/howto/annotations.html was
indented throughout, and was being rendered in blockquote elements.
(cherry picked from commit 5e2746d6e2)

Co-authored-by: Daniele Procida <daniele@vurt.org>
2023-08-05 14:08:04 +02:00
Miss Islington (bot)
3f6afafa7e
[3.12] gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403) (gh-107521)
gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403)

It was added in 3.12 for PEP 684 (per-interpreter GIL).
(cherry picked from commit fb344e99aa)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-31 23:15:13 +00:00
Miss Islington (bot)
fd60855299
[3.12] gh-107507: Replace 'The goals of Argument Clinic' with a summary (GH-107508) (#107516)
Summarise the goals of Argument Clinic in a single sentence.
Mention that Argument Clinic was introduced with PEP-436.
(cherry picked from commit abb71c6a8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 21:42:58 +00:00
Serhiy Storchaka
d514e1439f
[3.12] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) (GH-107419)
(cherry picked from commit f2d07d3289)
2023-07-29 09:16:27 +03:00
Serhiy Storchaka
4014869b4b
[3.12] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) (GH-107380)
(cherry picked from commit 983305268e)
2023-07-28 08:20:53 +00:00
Miss Islington (bot)
5f3e371e2d
[3.12] Docs: Argument Clinic: Restructure "Basic concepts and usage" (GH-106981) (#107325)
Split "Basic concepts and usage" into:

- Reference
  - Terminology
  - CLI reference

- Background
  - Basic concepts

(cherry picked from commit 2ad699002e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-27 09:07:55 +02:00
Miss Islington (bot)
6bbcd792f7
[3.12] Docs: Remove the numbered steps from the Argument Clinic tutorial (GH-107203) (#107317)
Instead, order the tutorial as one body of prose, making it easier to
align the tutorial according to Diátaxis principles.

(cherry picked from commit 592395577c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-26 21:03:35 +00:00
Miss Islington (bot)
9f5a5f0b33
[3.12] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107310)
(cherry picked from commit af61cb9c78)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-26 22:30:46 +03:00
Miss Islington (bot)
5ff4dfa0cb
[3.12] Docs: Add missing markup to Argument Clinic docs (GH-106876) (#107181)
(cherry picked from commit ff5f94b72c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-24 15:32:51 +00:00
Miss Islington (bot)
03271069af
[3.12] Docs: Remove duplicate word in Argument Clinic howto heading (GH-107169) (#107171)
(cherry picked from commit ebe44a5155)

Co-authored-by: Hakan Celik <hakancelikdev@gmail.com>
2023-07-24 12:03:01 +00:00
Miss Islington (bot)
40a337fbaa
[3.12] gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (GH-107062) (#107154)
(cherry picked from commit b447e19e72)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-23 23:13:23 +02:00
Miss Islington (bot)
95a82dcbe7
[3.12] gh-107091: Fix the use of some C domain roles (GH-107092) (GH-107113)
(cherry picked from commit 08a228da05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-23 14:50:21 +03:00
Miss Islington (bot)
332db37835
[3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103)
(cherry picked from commit f5147c0cfb)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
2023-07-23 12:00:31 +02:00
Miss Islington (bot)
63ae7edd35
[3.12] gh-54738: Add argparse i18n howto (GH-104562) (#107102)
(cherry picked from commit dcd7acb04a)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2023-07-23 11:36:10 +02:00
Serhiy Storchaka
ac9aa8a369
[3.12] gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) (GH-106951)
(cherry picked from commit fcc816dbff)
2023-07-21 14:48:15 +03:00
Miss Islington (bot)
1a3766bb3e
[3.12] Docs: Argument Clinic: Add Background and Tutorial top-level sections (GH-106904) (#106945)
Docs: Argument Clinic: Add Background and Tutorial top-level sections (GH-106904)

Add Background as a toplevel section with the following subsections:

- Background
  - The goals of Argument Clinic
  - Basic concepts and usage

Rename "Converting your first function" to Tutorial.

Add anchors for Background, Tutorial, and How-to Guides:

- :ref:`clinic-background`
- :ref:`clinic-tutorial`
- :ref:`clinic-howtos`

Link to these from within the Abstract.

Break the compatibility paragraph out of Abstract and make it a note.
(cherry picked from commit 81861fd90b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-21 08:18:18 +02:00
Miss Islington (bot)
0c106a91e8
[3.12] Docs: Argument Clinic: Group guides about default values (GH-106872) (#106874)
Docs: Argument Clinic: Group guides about default values (GH-106872)

Previous ToC layout (excerpt):

    - How to use symbolic default values
    ...
    - How to assign default values to parameter
      - How to use the ``NULL`` default value
      - How to use expressions as default values

New layout:

    - How to assign default values to parameter
      - The ``NULL`` default value
      - Symbolic default values
      - Expressions as default values

(cherry picked from commit 505eede38d)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-19 01:16:19 +02:00
Miss Islington (bot)
b79f3b36c3
[3.12] Docs: Normalise Argument Clinic advanced topics headings (GH-106842) (#106853)
(cherry picked from commit 4cb0b9c0a9)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-18 12:24:44 +02:00
Miss Islington (bot)
30c127fcec
[3.12] Docs: Normalize Argument Clinic How-To section capitalization (GH-106788) (#106791)
(cherry picked from commit 8c17729489)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-15 22:43:46 +00:00
Miss Islington (bot)
2f4a2d6c1b
[3.12] gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348) (GH-105520)
* revert enum pickling from by-name to by-value

(cherry picked from commit 4ff5690e59)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-06-08 18:01:51 -07:00
Victor Stinner
82ab13c49a
[3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) (#105371)
* gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)

* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:

  - Lib/test/test_stable_abi_ctypes.py
  - PC/python3dll.c

(cherry picked from commit bae415ad02)

* gh-102304: Fix up Simple ABI doc (GH-105351)

(cherry picked from commit 0202aa002e)
2023-06-06 13:11:28 +00:00
Miss Islington (bot)
25b5ce72c9
[3.12] howto/urllib2: remove link to an outdated french translation (GH-104193) (#104758)
We now have our own translation and it's not outdated
(cherry picked from commit 151b6bfb5d)

Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>
2023-05-23 08:57:52 +00:00
gsallam
be0c106789
gh-103295: expose API for writing perf map files (#103546)
Co-authored-by: Aniket Panse <aniketpanse@fb.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-21 11:12:24 +01:00
Erlend E. Aasland
b2c1b4da19
gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)
Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    SomeBaseClass.stubmethod
        flag: bool(unused=True)
    [clinic start generated code]*/
2023-05-12 10:34:00 +02:00
Hugo van Kemenade
13ac1766bc
gh-103960: Dark mode: invert image brightness (#103983) 2023-05-10 16:46:37 +03:00
Erlend E. Aasland
721a78395d
gh-64658: Expand Argument Clinic return converter docs (#104175) 2023-05-05 13:32:00 +02:00
Hugo van Kemenade
5b05b013ff
gh-101100: Fix Sphinx warnings in curses and curses.ascii modules (#103457)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-02 23:09:04 -06:00
Rafael Fontenelle
68ed2a2a3f
GH-103484: Fix redirected permanently URLs (#104001)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2023-05-02 09:34:44 +03:00
Hugo van Kemenade
79ae019164
gh-101100: Fix Sphinx warnings in argparse module (#103289)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-04-24 15:36:32 -06:00
Rafael Fontenelle
caed49448d
GH-103484: Fix broken links reported by linkcheck (#103608)
* Doc: Fix broken links reported by linkcheck

* Apply suggestions from code review

- Remove extra diff line in faq/library.rst (merwok)
- Use HTTPS to link Unicode 15.0.0 to solve a redirect (hugovk)
- Use wayback machine link for openssl 1.1.0 instead of linking 1.1.1, "as this text mentions a feature from 1.1.0" (hugovk)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Doc: Make mark-up code as literal

* Doc: Alphabetize items in linkcheck_ignore

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Doc: Improve comment in sphinx conf

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

---------

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-04-22 08:24:47 -06:00
Raymond Hettinger
7b134d3e71
Descriptor HowTo: Update to include attributes added in Python 3.10 (GH-103666) 2023-04-22 08:29:40 -05:00
Ethan Furman
700ec657c8
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
For example:

    class Book(StrEnum):
        title = auto()
        author = auto()
        desc = auto()

    Book.author.desc is Book.desc

but

    Book.author.title() == 'Author'

is commonly expected.  Using upper-case member names avoids this confusion and possible performance impacts.

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2023-04-18 16:19:23 -07:00
AN Long
282f0d26e3
Fix syntax typo in isolating extensions doc (#103516) 2023-04-14 00:40:25 -07:00
Boris Verkhovskiy
a3d313a9e2
Proofread howto/perf_profiling.rst (#103530) 2023-04-13 20:07:49 -07:00
Ethan Furman
a6f95941a3
gh-103479: [Enum] require __new__ to be considered a data type (GH-103495)
a mixin must either have a __new__ method, or be a dataclass, to be interpreted as a data-type
2023-04-13 08:31:03 -07:00
Ethan Furman
4ec8dd10bd
gh-93910: [Enum] remove member.member deprecation (GH-103236)
i.e. Color.RED.BLUE is now officially supported.
2023-04-05 17:33:52 -07:00