Commit Graph

331 Commits

Author SHA1 Message Date
Dave Goncalves 8be7c2bc5a
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-31 16:56:48 +03:00
jmcb 3af68fc77c
bpo-46013: Fix confusing kerning on period in docs (GH-29989) 2022-03-20 09:58:13 +00:00
David Gilbertson ab014978ae
Removed ambiguity in __init_subclass__ docs (GH-31540) 2022-03-07 20:13:01 -08: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
Alex Waygood aeb9ef4c72
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109) 2021-12-19 14:20:07 -06:00
Pablo Galindo 3ea574f35b
Fix some false positives of documentation syntax problems 2021-12-08 22:22:55 +00:00
Raymond Hettinger 4ccccb1cfc
bpo-20751: Match variable name to the example. (GH-29980) 2021-12-07 21:38:21 -06:00
Alex Waygood c0521fe49f
bpo-45840: Improve cross-references in the data model documentation (GH-29633) 2021-12-05 22:49:36 +02: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
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
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
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
Arthur Milchior d9c1868c25
bpo-45583: Correct datamodel documentation of int() (GH-29182)
It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.
2021-10-28 21:48:37 +02:00
Serhiy Storchaka 4f05f15d7b
[docs] Improve the markup of powers (GH-28598) 2021-09-28 22:40:57 +02:00
Raymond Hettinger 94b462686b
bpo-45198: __set_name__ documentation not clear about its usage with non-descriptor classes (GH-28439) 2021-09-18 01:49:43 -05:00
Pablo Galindo Salgado ab327f2929
bpo-44964: Correct the note about the f_lasti field (GH-28208) 2021-09-10 17:53:42 +02:00
Raymond Hettinger fa15df77f0
bpo-45104: Clarify when __init__ is called (GH-28210) 2021-09-07 18:04:39 +02:00
Pablo Galindo Salgado fa2c0b85a8
bpo-44964: Add a note explaining the new semantics of f_last_i in frame objects (GH-28200) 2021-09-07 12:18:54 +01:00
William Chargin 80f33f266b
bpo-41706: Fix special method invocation docs to mention using type() (GH-22084) 2021-08-04 13:43:06 -07:00
Ammar Askar 9c3eaf88dc
bpo-43950: Add documentation for PEP-657 (GH-27047)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2021-07-13 01:29:39 +01:00
Pablo Galindo 8363c53369
bpo-44530: Document the new CodeObject.co_qualname attribute (GH-27052) 2021-07-07 14:20:49 +01:00
Illia Volochii a1092f6249
bpo-43216: Remove @asyncio.coroutine (GH-26369)
Remove the @asyncio.coroutine decorator
enabling legacy generator-based coroutines to be compatible with async/await
code; remove asyncio.coroutines.CoroWrapper used for wrapping
legacy coroutine objects in the debug mode.

The decorator has been deprecated
since Python 3.8 and the removal was initially scheduled for Python 3.10.
2021-07-01 15:13:59 +02:00
larryhastings 49b26fa517
bpo-43987: Add "Annotations Best Practices" HOWTO doc. (#25746)
Add "Annotations Best Practices" HOWTO doc.
2021-05-01 21:19:24 -07:00
Ryan Hileman 9a2c2a9ec3
bpo-42800: add audit hooks for f_code and tb_frame (GH-24182)
Accessing the following attributes will now fire PEP 578 style audit hooks as ("object.__getattr__", obj, name):
* PyTracebackObject: tb_frame
* PyFrameObject: f_code
* PyGenObject: gi_code, gi_frame
* PyCoroObject: cr_code, cr_frame
* PyAsyncGenObject: ag_code, ag_frame
Add an AUDIT_READ attribute flag aliased to READ_RESTRICTED.
Update obsolete flag documentation.
2021-04-30 00:15:55 +01:00
Géry Ogam a1a5e3c4c8
Fix a typo in datamodel reference document (GH-24930) 2021-04-25 14:13:19 -07:00
Victor Stinner 553ee2781a
bpo-43682: Make staticmethod objects callable (GH-25117)
Static methods (@staticmethod) are now callable as regular functions.
2021-04-12 00:21:22 +02:00
Ken Jin 5143fd15b4
Update pattern matching docs for changes to the PEP (#25185)
See:
- https://github.com/python/peps/pull/1909 (__match_args__ must be a tuple)
- https://github.com/python/peps/pull/1908 (allow keyword patterns for int(x) etc.)
2021-04-06 09:03:00 -07:00
Daniel F Moisset a22bca6b1e
bpo-42128: Add documentation for pattern matching (PEP 634) (#24664)
This is a first edition, ready to go out with the implementation. We'll iterate during the rest of the period leading up to 3.10.0.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandt@python.org>
Co-authored-by: Raymond Hettinger <1623689+rhettinger@users.noreply.github.com>
Co-authored-by: Guido van Rossum <guido@python.org>
2021-02-28 20:08:38 -08:00
Andre Delfino 96a09df644
[doc] Fix a few margins due to bad markup (GH-23619) 2020-12-17 09:25:55 -08:00
Andre Delfino 95f710c557
bpo-6761: Enhance __call__ documentation (GH-7987) 2020-10-27 17:18:57 +01:00
Brett Cannon 3c69f0c933
bpo-41910: specify the default implementations of object.__eq__ and object.__ne__ (GH-22874)
See Objects/typeobject.c:object_richcompare() for the implementation of this in CPython.

Automerge-Triggered-By: GH:brettcannon
2020-10-21 16:24:38 -07:00
kpinc f8b1ccd63c
Fix bpo-39416: Change "Numeric" to lower case; an english word, not a class name (GH-22867)
This is a trivial fix to [bpo-39416](), which didn't come up until it was already committed

```
Change "Numeric" to "numeric".

I believe this is trivial enough to not need an issue or a NEWS entry, although
I'm unclear on what branches the original pull request received backports.
```

Automerge-Triggered-By: GH:merwok
2020-10-21 13:34:15 -07:00
kpinc c60394c7fc
bpo-39416: Document some restrictions on the default string representations of numeric classes (GH-18111)
[bpo-39416](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/python-dev@python.org/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
2020-10-21 10:13:50 -07:00
Saiyang Gou 3f7e990fd4
bpo-41192: Add documentation of undocumented audit events (GH-21308) 2020-10-20 15:23:15 -04:00
Brett Cannon d02d824e05
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505) 2020-10-05 09:42:21 -07:00
Victor Stinner bb0b08540c
bpo-40204: Fix reference to terms in the doc (GH-21865)
Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.
2020-08-14 12:20:05 +02:00
Heshy Roskes ef33712baa
Fix typo in object.__format__ docs (GH-19504) 2020-04-25 21:57:09 -04:00
Mathieu Dupuy c49016e67c
fix comma location in various places (GH-19233) 2020-03-30 14:28:25 -07:00
Lahfa Samy 59c644eaa7
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Co-authored-by: furkanonder <furkantahaonder@gmail.com>
2020-03-26 09:54:04 -05:00
Caleb Donovick e59334ebc9
bpo-17422: slightly more precise language (GH-18682) 2020-03-06 10:20:48 -08:00
MojoVampire 469325c30e
bpo-35712: Make using NotImplemented in a boolean context issue a deprecation warning (GH-13195) 2020-03-03 20:50:17 +02:00
ananthan-123 fbe2e0bb8a
bpo-17422: Language reference should specify restrictions on class namespace (#18559)
The language reference now specifies restrictions on class namespaces.  Adapted from a patch by Ethan Furman.
2020-02-22 09:56:01 -08:00
alclarks 7de617455e bpo-15243: Document __prepare__ as classmethod (GH-17124) 2020-01-25 21:49:58 +03:00
HongWeipeng abc0c4fa99 Fix the parameter list of object. _rpow_ (#GH-16477) 2020-01-05 17:20:29 -05:00
Batuhan Taşkaya d587272fe3 bpo-38316: Fix co_stacksize documentation (GH-16983) 2019-12-15 23:02:47 +01:00
Tal Einat 02519f75d1
bpo-38524: clarify example a bit and improve formatting (GH-17406) 2019-11-28 07:22:09 +02:00
Florian Dahlitz 1bddf890e5 bpo-38524: document implicit and explicit calling of descriptors' __set_name__ (GH-17364) 2019-11-27 10:46:40 +02:00
alclarks 4544e78ec4 bpo-25866: Minor cleanups to "sequence" in docs (GH-17177) 2019-11-17 14:00:43 -08:00
Géry Ogam 4c155f738d bpo-38336: Remove the __set__ method restriction on data descriptors for attribute lookup precedence (GH-16520) 2019-10-29 00:04:01 -07:00
Steve Dower a39a4c7439
bpo-37913: Link to NotImplemented from new docs (GH-15860) 2019-09-10 15:25:12 +01:00