Commit Graph

309 Commits

Author SHA1 Message Date
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
Jeroen Demeyer 009ef2955d bpo-37913: document that __length_hint__ can return NotImplemented (GH-15383) 2019-09-10 15:01:13 +01:00
Raymond Hettinger 0dac68f1e5
bpo-36743: __get__ is sometimes called without the owner argument (#12992) 2019-08-29 01:27:42 -07:00
Joannah Nanjekye 6b16d938d6 bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call (GH-15478) 2019-08-25 23:53:11 -07:00
Serhiy Storchaka e9c90aa431
bpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269) 2019-08-24 12:49:27 +03:00
Serhiy Storchaka bdbad71b9d
bpo-20092. Use __index__ in constructors of int, float and complex. (GH-13108) 2019-06-02 00:05:48 +03:00
Pablo Galindo cd74e66a8c
bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726) 2019-06-01 18:08:04 +01:00
Serhiy Storchaka 70c5f2ae6e
Use more PEP 570 syntax in the documentation. (GH-13720) 2019-06-01 11:38:24 +03:00
Pablo Galindo ed222a74a0
Update data model docs to include missing attributes for code objects (GH-13696)
Include and document co_posonlyargcount and co_kwonlyargcount
2019-05-31 12:13:04 +01:00
Catherine Alvarado 5e98f05e55 bpo-36166: Change to rst datamodel file. (GH-13089) 2019-05-04 17:54:35 -04:00
Andre Delfino a8a79cacca Improve grammar on async context managers and shorten text (GH-12379) 2019-05-03 08:08:10 -07:00
Jules Lasne (jlasne) 1fc5bf2ff2 Doc: Fixed missing punctuation in datamodel.rst (GH-12581) 2019-03-27 11:10:33 +01:00
Martijn Pieters b727239575 closes bpo-36188: Clean up 'unbound' method left-overs. (GH-12169)
Methods are always bound, and `__self__` can no longer be `NULL`
(`method_new()` and `PyMethod_New()` both explicitly check for this).

Moreover, once a bound method is bound, it *stays* bound and won't be re-bound
to something else, so the section in the datamodel that talks about accessing
an methods in a different descriptor-binding context doesn't apply any more in
Python 3.
2019-03-04 21:19:34 -08:00
Raymond Hettinger 7463884f69 Document other performance implication for __slots__ (GH-11974) 2019-02-21 03:34:04 -08:00
Pierre Glaser df8d2cde63 bpo-35911: add cell constructor (GH-11771)
Add a cell constructor, expose the cell type in the types module.
2019-02-07 19:36:48 +00:00
Serhiy Storchaka 2b57c43f21
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
Andre Delfino 1ce853f377 Move __missing__ after __delitem__ in Data model. (GH-10923) 2018-12-05 21:42:44 +02:00
wim glenn a48e0eb967 Fix outdated info in datamodel about dicts (GH-9807) 2018-11-16 20:58:19 +09:00
Andrés Delfino c2ccac7b9f bpo-33816: Remove outdated metaclass example (GH-7566) 2018-11-16 20:41:55 +09:00
Denis Osipov 0bee3c36d4 bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)
https://bugs.python.org/issue35119
2018-11-06 01:53:21 +00:00
Serhiy Storchaka 913876d824
bpo-35054: Add yet more index entries for symbols. (GH-10121) 2018-10-28 13:41:26 +02:00
Serhiy Storchaka ddb961d2ab
bpo-35054: Add more index entries for symbols. (GH-10064) 2018-10-26 09:00:49 +03:00
Berker Peksag 3c1b590472
Fix HTML formatting in datamodel.rst (GH-8693) 2018-08-06 23:52:49 +03:00