Commit Graph

980 Commits

Author SHA1 Message Date
Serhiy Storchaka 1a0c7b9ba4
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
Bénédikt Tran f4d6e45c1e
gh-120452: improve documentation about private name mangling (#120451)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-07-13 07:45:18 -07:00
Jongbum Won 715ec630dd
gh-121355: Fix incorrect word in simple_stmts.rst (#121356) 2024-07-04 06:34:34 -07:00
Danny Yang 91313afdb3
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (#121175) 2024-07-01 22:04:39 +05:30
chaen 1c13b29d54
gh-120937: Reference weakref from the `__del__` documentation (#120940)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-26 23:07:09 +03:00
Danny Yang 58b3f11176
gh-120521: clarify except* documentation to allow tuples (#120523)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 18:49:00 +00:00
Jelle Zijlstra 9e0b11eb21
annotations: expand documentation on "simple" assignment targets (#120535)
This behavior is rather surprising and it was not clearly specified.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 15:18:16 +00:00
Paulo Freitas bf5e1065f4
doc: Mention the missing reflected special methods for all binary operations (GH-119931) 2024-06-04 17:55:11 +00:00
Mark Dickinson f79ffc879b
gh-119740: Remove deprecated trunc delegation (#119743)
Remove the delegation of `int` to the `__trunc__` special method: `int` will now only delegate to `__int__` and `__index__` (in that order). `__trunc__` continues to exist, but its sole purpose is to support `math.trunc`.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-02 10:16:49 +01:00
Alyssa Coghlan fd6cd621e0
gh-118934: Fix PyEval_GetLocals docs (PEP 667) (#119932)
PEP 667's description of the planned changes to PyEval_GetLocals
was internally inconsistent when accepted, so the docs added for
gh-74929 didn't match either the current behaviour or the intended
behaviour once gh-118934 is fixed.

This PR updates the documentation and 3.13 What's New to match the
intended behaviour (once gh-118934 is fixed).

It also tidies up lingering references to `f_locals` always being a
dictionary (this hasn't been true since at least when custom
namespace support for class statement execution was added)
2024-06-02 04:44:29 +00:00
Irit Katriel 015b1fdd0a
gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (#119364) 2024-05-31 17:09:48 +00:00
Alyssa Coghlan e870c852c0
gh-74929: PEP 667 general docs update (gh-119201)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)
2024-05-21 03:32:15 +00:00
Jelle Zijlstra 35b5eaa176
gh-118767: Improve tests and docs for bool(NotImplemented) (#118813) 2024-05-09 13:52:08 +00:00
Jelle Zijlstra 3c079a0203
gh-118767: Make bool(NotImplemented) raise TypeError (#118775) 2024-05-08 11:12:00 -07:00
Serhiy Storchaka 153b3f7530
gh-118465: Add __firstlineno__ attribute to class (GH-118475)
It is set by compiler with the line number of the first line of
the class definition.
2024-05-06 12:02:37 +03:00
Guido van Rossum 9c13d9e37a
gh-74929: Rudimentary docs for PEP 667 (#118581)
This is *not* sufficient for the final 3.13 release, but it will do for beta 1:

- What's new entry
- Updated changelog entry (news blurb)
- Mention the proxy for f_globals in the datamodel and Python frame object docs

This doesn't have any C API details (what's new refers to the PEP).
2024-05-05 15:31:26 +00:00
Jelle Zijlstra ca269e58c2
gh-116126: Implement PEP 696 (#116129)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-05-03 06:17:32 -07:00
Quazi Irfan 1558d99316
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (#114009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-20 18:42:51 -07:00
Irit Katriel 8a01fd7b9b
gh-115775: Add whatsnew entry about __static_attributes__ (GH-117909)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 12:57:31 +02:00
Hugo van Kemenade 7d0be7aea5
Add 'The Python 2.3 Method Resolution Order' (#116435) 2024-04-15 13:01:15 +03:00
Adorilson Bezerra c2276176d5
Add information about negative indexes to sequence datamodel doc (#110903)
Co-authored by Terry Jan Reedy
2024-03-25 18:34:20 -04:00
Terry Jan Reedy 025ef7a5f7
gh-56374: Clarify documentation of nonlocal (#116942)
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc.  Add "Programmer's note".
2024-03-19 13:55:21 -04:00
Sunghyun Kim 7f64ae30dd
gh-107607: Update comment about utf-8 BOM being ignored (#107858)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-19 11:51:12 -04:00
Terry Jan Reedy 4e45c6c54a
gh-116881: Remove erroneous or redundant grammar NULL (GH-116885)
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'.  In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>.  Remove it there.
2024-03-18 10:31:13 +01:00
Serhiy Storchaka 808a77612f
gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298) 2024-03-07 10:05:03 +02:00
Gouvernathor 67f742e03a
gh-72971: Clarify the special no-TypeError behavior for equality (#110729) 2024-03-03 00:45:48 +00:00
Gouvernathor 2713c2abc8
gh-104219: Document that idunders can return NotImplemented (#104220)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-01 16:51:47 +01:00
Erlend E. Aasland dbe44f150c
Docs: mark up NotImplemented using the :data: role throughout the docs (#116135) 2024-02-29 20:46:12 +00:00
Adorilson Bezerra f7455864f2
Erase some unnecessary quotes on data model doc (#113521)
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.
2024-02-24 19:16:19 -05:00
Daler 0c80da4c14
gh-115572: Move `codeobject.replace()` docs to the data model (#115631) 2024-02-18 14:13:46 +00:00
Christophe Papazian de07941729
gh-115405: add versionadded tag for co_qualname in code objects documentation (#115411) 2024-02-13 16:10:00 +00:00
Nikita Sobolev e19103a346
gh-114552: Update `__dir__` method docs: it allows returning an iterable (#114662) 2024-02-10 08:34:23 +00:00
Terry Jan Reedy a1332a99cf
Clarify one-item tuple (#114745)
A 'single tuple' means 'one typle, of whatever length.
Remove the unneeded and slight distracting parenthetical 'singleton' comment.
2024-01-30 18:40:54 +00:00
Nikita Sobolev a384b20c0c
gh-101100: Fix sphinx warnings in `reference/import.rst` (#114646) 2024-01-27 07:30:21 -07:00
Hugo van Kemenade 8ccd1ba461
gh-101100: Fix Sphinx warnings in `reference/expressions.rst` (#114194) 2024-01-22 18:21:14 +02:00
cdzhan b04c5005cc
Fix the confusing "User-defined methods" reference in the datamodel (#114276)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-01-21 03:45:38 +00:00
Sergey B Kirpichev 029ecee10d
gh-114070: fix token reference warnings in expressions.rst (#114169) 2024-01-17 18:39:50 +02:00
InSync a47353d587
datamodel: Fix a typo in ``object.__init_subclass__`` (#111599) 2024-01-12 22:59:24 +00:00
Ned Batchelder e68806c712
Docs: Amend codeobject.co_lines docs; end number is exclusive (#113970)
The end number should be exclusive, not inclusive.
2024-01-12 16:04:14 +01:00
Serhiy Storchaka a8629816c6
gh-113664: Improve style of Big O notation (GH-113695)
Use cursive to make it looking like mathematic formulas.
2024-01-10 15:01:18 +02:00
Alex Waygood f1f8392432
Document the `co_lines` method on code objects (#113682)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-01-03 19:29:24 +00:00
John D. McDonald 8ff44f8554
gh-81094: Refer to PEP 318 in compound_statements.rst (#113588)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-01-02 10:40:14 +02:00
Raymond Hettinger 6a5b4736e5
gh-113313: Note that slice support is not required for all sequences. (gh-113377) 2023-12-21 15:54:59 -06:00
Rodrigo Girão Serrão 5a7cc667f8
Fix typo in datamodel docs (#113314)
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-12-20 11:58:38 +00:00
Hugo van Kemenade 32d87a8899
Docs: Add label to grammar spec for linking from PEPs (#113235) 2023-12-17 12:23:14 -07:00
Alex Waygood 4b3cb082da
gh-101100: Fix Sphinx nitpicks in `library/inspect.rst` and `reference/simple_stmts.rst` (#113107) 2023-12-14 13:30:57 +00:00
Alex Waygood d05a180350
gh-101100: Improve docs on exception attributes (GH-113057)
* Improve docs on exception attributes

* thanks sphinx-lint

* fix doctests

* argh, okay, give up on doctests

* Various improvements
2023-12-13 10:59:36 -08:00
Alex Waygood 81a15ea74e
gh-101100: Further improve docs on function attributes (#113001) 2023-12-12 20:21:12 +00:00
Alex Waygood 4c5b9c107a
gh-101100: Improve documentation on function attributes (#112933)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-11 12:00:42 +02:00
Hugo van Kemenade 5bf7580d72
Docs: Use 'f-strings' as header (#112888) 2023-12-10 10:39:51 +02:00