summaryrefslogtreecommitdiffstats
path: root/Doc/reference
Commit message (Collapse)AuthorAgeFilesLines
* Replace the esoteric term 'datum' when describing dict comprehensions (#106119)Ned Batchelder2023-07-032-12/+12
|
* gh-106046: Improve error message from `os.fspath` if `__fspath__` is set to ↵Alex Waygood2023-06-251-2/+3
| | | | `None` (#106082)
* gh-103921: Document PEP 695 (#104642)Jelle Zijlstra2023-05-265-12/+422
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-102856: Update "Formatted string literals" docs section after PEP701 ↵Lysandros Nikolaou2023-05-241-17/+35
| | | | (#104861)
* gh-104770: Let generator.close() return value (#104771)Nicolas Tessore2023-05-231-6/+13
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* GH-97950: Use new-style index directive ('builtin') (#104164)Adam Turner2023-05-064-31/+31
| | | | | | | | | | | | | * Uncomment builtin removal in pairindextypes * Use new-style index directive ('builtin') - C API * Use new-style index directive ('builtin') - Extending * Use new-style index directive ('builtin') - Library * Use new-style index directive ('builtin') - Reference * Use new-style index directive ('builtin') - Tutorial
* gh-102500: Document PEP 688 (#102571)Jelle Zijlstra2023-05-041-0/+41
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* GH-97950: Use new-style index directive ('statement') (#104162)Adam Turner2023-05-043-41/+41
|
* GH-97950: Use new-style index directive ('exception') (#104160)Adam Turner2023-05-042-12/+12
|
* GH-97950: Use new-style index directive ('object') (#104158)Adam Turner2023-05-044-87/+87
| | | | | | | | | | | * Uncomment object removal in pairindextypes * Use new-style index directive ('object') - C API * Use new-style index directive ('object') - Library * Use new-style index directive ('object') - Reference * Use new-style index directive ('object') - Tutorial
* GH-97950: Use new-style index directive ('operator') (#104156)Adam Turner2023-05-041-25/+25
|
* GH-97950: Use new-style index directive ('keyword') (#104153)Adam Turner2023-05-043-27/+27
| | | | | * Uncomment keyword removal in pairindextypes * Use new-style index directive ('keyword') - Reference
* GH-97950: Use new-style index directive ('module') (#103996)Adam Turner2023-05-044-10/+10
| | | | | | | | | | | | | | | | | * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
* gh-103590: mention that the change is included in 3.11.4 and clarify except* ↵Irit Katriel2023-05-031-2/+4
| | | | documentation (#104095)
* GH-97850: Suppress cross-references to the removed ``module_repr`` method ↵Adam Turner2023-05-031-1/+1
| | | | | (#104133) Suppress cross-references to ``module_repr``
* gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059)Barry Warsaw2023-05-031-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove deprecated classes from pkgutil * Remove some other PEP 302 obsolescence * Use find_spec instead of load_module * Remove more tests of PEP 302 obsolete APIs * Remove another bunch of tests using obsolete load_modules() * Remove deleted names from __all__ * Remove obsolete footnote * imp is removed * Remove `imp` from generated stdlib names * What's new and blurb * Update zipimport documentation for the removed methods * Fix some Windows tests * Remove any test (or part of a test) that references `find_module()`. * Use assertIsNone() / assertIsNotNone() consistently. * Update Doc/reference/import.rst * We don't need pkgutil._get_spec() any more either * test.test_importlib.fixtures.NullFinder * ...BadLoaderFinder.find_module * ...test_api.InvalidatingNullFinder.find_module * ...test.test_zipimport test of z.find_module * Suppress cross-references to find_loader and find_module * Suppress cross-references to Finder * Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader --------- Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* GH-103484: Fix redirected permanently URLs (#104001)Rafael Fontenelle2023-05-022-2/+2
| | | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-1/+2
|
* gh-101688: Implement types.get_original_bases (#101827)James Hilton-Balfe2023-04-231-0/+4
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-103373: `__mro_entries__` docs: improve cross references (#103398)Alex Waygood2023-04-111-5/+10
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-103373: Improve documentation for `__mro_entries__` (#103374)Alex Waygood2023-04-081-5/+9
|
* gh-101865: Deprecate `co_lnotab` from code objects as per PEP 626 (#101866)Nikita Sobolev2023-04-031-1/+2
| | | Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-100315: clarification to `__slots__` docs. (#102621)T2023-03-141-2/+4
| | | refer to tp_itemsize in discussion on "variable-length" built-in types
* Fix duplicated words in the docs (GH-102629)Виталий Дмитриев2023-03-121-1/+1
| | | | | With grep utility found some duplicated words Automerge-Triggered-By: GH:AlexWaygood
* gh-102011: use sys.exception() instead of sys.exc_info() in docs where ↵Irit Katriel2023-02-202-18/+16
| | | | possible (#102012)
* GH-101898: Fix missing term references for hashable definition (#101899)Furkan Onder2023-02-141-1/+1
| | | Fix missing term references for hashable definition
* gh-81611: Improve `range` paragraph in 8.3 of language reference (#98353)4l4k4z4m2023-01-031-3/+2
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* fix `grammer` -> `grammar` typo in expressions.rst (GH-100683)Kumar Aditya2023-01-021-1/+1
| | | Automerge-Triggered-By: GH:AlexWaygood
* gh-100201: Document behavior with a bare `yield` statement (#100416)ram vikram singh2023-01-011-1/+3
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-85979: Clarify specification of `object.__await__` (#22320)Paolo Lammens2022-12-311-0/+8
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-48496: Added example and link to faq for UnboundLocalError in reference ↵Stanley2022-12-221-0/+2
| | | | (#93068)
* "Compound statement" docs: Fix with-statement step indexing (#100286)Frank Dana2022-12-161-1/+1
| | | | | Back in commit 226e6e7d4326cf91ef37e13528eb1f62de1bb832 an item was added to the list, renumbering all the rest of the items, but the forward-reference wasn't updated to match.
* Fix typo in `__match_args__` doc (#99785)Terry Jan Reedy2022-11-261-1/+1
| | | A opy of #98549, whose author (@icecream17) uses a school computer that blocks the CLA site. I did not mention this in commit comment above so CLA bot does not pick up the name and request the CLA again.
* doc: Formatting and typo fixes (#98974)jmcb2022-11-072-5/+5
|
* gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)Victor Stinner2022-11-031-6/+12
| | | | | | | | | | | | | | | | | | | | | | A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence), use raw strings for regular expression: re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. Octal escapes with value larger than 0o377 (ex: "\477"), deprecated in Python 3.11, now produce a SyntaxWarning, instead of DeprecationWarning. In a future Python version they will be eventually a SyntaxError. codecs.escape_decode() and codecs.unicode_escape_decode() are left unchanged: they still emit DeprecationWarning. * The parser only emits SyntaxWarning for Python 3.12 (feature version), and still emits DeprecationWarning on older Python versions. * Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and wasm_build.py.
* Docs: Add 'as, match statement' to the index (#99001)Hugo van Kemenade2022-11-031-0/+1
|
* Python documents state elsewhere that a comma is not an operator, so … ↵Gerardwx2022-10-271-1/+1
| | | | | (GH-98736) …calling it an operator here is confusing. See https://docs.python.org/3/reference/lexical_analysis.html#operators and https://docs.python.org/3/faq/programming.html#id22.
* docs: Change links to label refs (#98454)Stanley2022-10-261-0/+2
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-98172: [doc] mention that except* handles naked exceptions (GH-98496)Irit Katriel2022-10-211-1/+13
|
* gh-98227: executionmodel.rst: except* can also bind names (#98256)BiscuitCandy2022-10-151-1/+1
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-98172: Fix formatting in `except*` docs (#98173)Jelle Zijlstra2022-10-111-12/+11
|
* gh-97913 Docs: Add walrus operator to the index (#97921)Hugo van Kemenade2022-10-081-0/+6
| | | | | | | | | | | | | | * Add walrus operator to the index * Add named expression to the index Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com> * Fix indentation and add missing newline Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-86298: Ensure that __loader__ and __spec__.loader agree in ↵Barry Warsaw2022-10-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | warnings.warn_explicit() (GH-97803) In `_warnings.c`, in the C equivalent of `warnings.warn_explicit()`, if the module globals are given (and not None), the warning will attempt to get the source line for the issued warning. To do this, it needs the module's loader. Previously, it would only look up `__loader__` in the module globals. In https://github.com/python/cpython/issues/86298 we want to defer to the `__spec__.loader` if available. The first step on this journey is to check that `loader == __spec__.loader` and issue another warning if it is not. This commit does that. Since this is a PoC, only manual testing for now. ```python # /tmp/foo.py import warnings import bar warnings.warn_explicit( 'warning!', RuntimeWarning, 'bar.py', 2, module='bar knee', module_globals=bar.__dict__, ) ``` ```python # /tmp/bar.py import sys import os import pathlib # __loader__ = pathlib.Path() ``` Then running this: `./python.exe -Wdefault /tmp/foo.py` Produces: ``` bar.py:2: RuntimeWarning: warning! import os ``` Uncomment the `__loader__ = ` line in `bar.py` and try it again: ``` sys:1: ImportWarning: Module bar; __loader__ != __spec__.loader (<_frozen_importlib_external.SourceFileLoader object at 0x109f7dfa0> != PosixPath('.')) bar.py:2: RuntimeWarning: warning! import os ``` Automerge-Triggered-By: GH:warsaw
* Docs: Fix backtick errors found by sphinx-lint (#97998)Hugo van Kemenade2022-10-073-10/+2
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-97850: Remove the open issues section from the import reference (#97935)Brett Cannon2022-10-061-19/+0
| | | | | Remove the open issues section from the import reference Tracking in https://github.com/python/cpython/issues/97850 instead.
* gh-86482: Document assignment expression need for ()s (#23291)Terry Jan Reedy2022-10-061-0/+7
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-65961: Raise `DeprecationWarning` when `__package__` differs from ↵Brett Cannon2022-10-051-6/+24
| | | | | | | `__spec__.parent` (#97879) Also remove `importlib.util.set_package()` which was already slated for removal. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-051-1/+1
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-95975: Move except/*/finally ref labels to more precise locations (#95976)C.A.M. Gerlach2022-10-021-45/+76
| | | | | | | | | | | | | | | | | | | * gh-95975: Move except/*/finally ref labels to more precise locations * Add section headers to fix :keyword: role and aid navigation * Move see also to the introduction rather than a particular subsection * Fix other minor Sphinx syntax issues with except Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> * Suppress redundant link to same section for except too * Don't link try/except/else/finally keywords if in the same section * Format try/except/finally as keywords in modified sections Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-96348: Deprecate the 3-arg signature of coroutine.throw and ↵Ofey Chan2022-09-302-1/+17
| | | | generator.throw (GH-96428)