summaryrefslogtreecommitdiffstats
path: root/Doc/reference
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45346: Keep docs consistent regarding true and false values (GH-28697) ↵Miss Islington (bot)2021-10-031-4/+4
| | | | (GH-28698)
* [3.10] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28511)Łukasz Langa2021-09-291-1/+1
| | | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* bpo-44964: Correct the note about the f_lasti field (GH-28208) (GH-28276)Miss Islington (bot)2021-09-291-3/+2
| | | | | (cherry picked from commit ab327f2929589407595a3de95727c8ab34ddd4af) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-45198: __set_name__ documentation not clear about its usage with ↵Miss Islington (bot)2021-09-291-29/+34
| | | | | | | non-descriptor classes (GH-28439) (cherry picked from commit 94b462686b7dfabbd69cc9401037d736d71c4dc2) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.10] [docs] Improve the markup of powers (GH-28598) (GH-28607)Łukasz Langa2021-09-291-1/+1
| | | | | (cherry picked from commit 4f05f15d7b25ef8b690cb94fdc4c8cb5521a4e27) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45104: Clarify when __init__ is called (GH-28210)Miss Islington (bot)2021-09-071-1/+1
| | | | | (cherry picked from commit fa15df77f02ba4a66ba0b71989381a426038be01) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-44964: Add a note explaining the new semantics of f_last_i in frame ↵Miss Islington (bot)2021-09-071-2/+3
| | | | | | | objects (GH-28200) (cherry picked from commit fa2c0b85a8d5c9486661083afdf38cbaadb3432a) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-45003: Change __div__ to __truediv__ in py3 language reference. ↵Miss Islington (bot)2021-08-261-1/+1
| | | | | | | | (GH-27951) (GH-27963) (cherry picked from commit 806e25fd3173a80021e6df87b81263b5f6056f38) Co-authored-by: Objectivitix <79152594+Objectivitix@users.noreply.github.com>
* bpo-39452: Rewrite and expand __main__.rst (GH-26883)Miss Islington (bot)2021-08-241-0/+2
| | | | | | | | | | Broadened scope of the document to explicitly discuss and differentiate between ``__main__.py`` in packages versus the ``__name__ == '__main__'`` expression (and the idioms that surround it), as well as ``import __main__``. Co-authored-by: Géry Ogam <gery.ogam@gmail.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 7cba23164cf82f6619db002cd30021b5dfb1f809) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
* bpo-41911: Update docs for various expressions (GH-27470) (GH-27490)Miss Islington (bot)2021-07-301-7/+34
| | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 4bd9caafb64589288e5171087070bde726178c58) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* [3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate ↵Miss Islington (bot)2021-07-151-4/+5
| | | | | | | | | | literal keys (GH-27131) (GH-27157) (cherry picked from commit 2693132292b2acf381ac6fa729bf3acf41d9d72b) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com> Automerge-Triggered-By: GH:brandtbucher
* Update doc as relative import can be used with star import (GH-25667) (GH-26121)Miss Islington (bot)2021-05-141-1/+1
| | | | | | | (cherry picked from commit 3d4b5f1019123a7d74801500eb18ec8fa12136bc) Co-authored-by: Saiyang Gou <gousaiyang@163.com> Co-authored-by: Saiyang Gou <gousaiyang@163.com>
* bpo-43977: Update pattern matching language reference docs (GH-25917) (GH-26117)Miss Islington (bot)2021-05-141-7/+35
| | | | | | | | | | * Update patma language reference with new changes to sequence and mapping * update 3.10 whatsnew too (cherry picked from commit 53c91ac5253bf1cb3cb20e1345e798a53f4c3517) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44025: Clarify when '_' is a keyword. (GH-25873)Miss Islington (bot)2021-05-041-2/+4
| | | | | | | | In match statements, in case patterns and nowhere else. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 3b200b2aa648fcc8a2673871807c1463afe00195) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805)Zackery Spytz2021-05-021-3/+3
| | | Footnotes 5 and 6 were in the wrong order.
* bpo-43987: Add "Annotations Best Practices" HOWTO doc. (#25746)larryhastings2021-05-021-19/+51
| | | Add "Annotations Best Practices" HOWTO doc.
* bpo-42800: add audit hooks for f_code and tb_frame (GH-24182)Ryan Hileman2021-04-291-0/+6
| | | | | | | | | | 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.
* Fix a typo in datamodel reference document (GH-24930)Géry Ogam2021-04-251-1/+1
|
* bpo-38605: Revert making 'from __future__ import annotations' the default ↵Pablo Galindo2021-04-212-5/+12
| | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
* bpo-43837: Reverse order of precedence table to show tightly binding ↵Ammar Askar2021-04-191-29/+29
| | | | operators first (GH-25469)
* Use double quotes over single quotes for match statement grammar (GH-24943)Ken Jin2021-04-121-2/+2
|
* bpo-43682: Make staticmethod objects callable (GH-25117)Victor Stinner2021-04-111-3/+2
| | | Static methods (@staticmethod) are now callable as regular functions.
* Fix description of behaviour of an exception class in 'from' clause (GH-24303)Mark Dickinson2021-04-111-4/+7
|
* bpo-39702: Remove dotted_name from decorator documentation (GH-25234)Saiyang Gou2021-04-081-1/+0
|
* bpo-36540: Improve doc of function definition regarding positional-only ↵Saiyang Gou2021-04-071-2/+8
| | | | arguments (GH-25235)
* bpo-38605: Update "Future statements" docs since PEP 563 is always enabled ↵Saiyang Gou2021-04-071-5/+2
| | | | | (GH-25236) Update documentation section for "Future statements" to reflect that `from __future__ import annotations` is on by default, and no features require using the future statement now.
* bpo-43755: Update docs to reflect that lambda is not allowed in `comp_if` ↵Saiyang Gou2021-04-061-3/+1
| | | | since 3.9 (GH-25231)
* Update pattern matching docs for changes to the PEP (#25185)Ken Jin2021-04-062-3/+3
| | | | | 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.)
* bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)Brett Cannon2021-04-021-1/+2
|
* bpo-42134: Raise ImportWarning when calling find_module() in the import ↵Brett Cannon2021-03-301-0/+11
| | | | system (GH-25044)
* bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)Brett Cannon2021-03-261-0/+7
|
* bpo-42128: Add documentation for pattern matching (PEP 634) (#24664)Daniel F Moisset2021-03-013-0/+650
| | | | | | | | | 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>
* bpo-27646: Say that 'yield from' expression can be any iterable (GH-24595)Terry Jan Reedy2021-02-211-2/+2
| | | Previously, the doc at least strongly implied that it had to be an iterator.
* bpo-8264: Document hasattr and getattr behavior for private attributes ↵Ken Jin2021-02-021-0/+2
| | | | | | | | (GH-23513) Clarify ``getattr`` and ``setattr`` requirements for accessing name-mangled attributes Co-Authored-By: Catalin Iacob <iacobcatalin@gmail.com>
* Document new parenthesized with statements (GH-24281)Pablo Galindo2021-01-251-1/+14
|
* bpo-35790: Correct the description of sys.exc_info() and add a code example ↵Géry Ogam2020-12-211-3/+21
| | | | (GH-11625)
* bpo-42669: Document that `except` rejects nested tuples (GH-23822)Colin Watson2020-12-201-1/+2
| | | | | | | | | | | | | In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural. For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this: try: self.getInputValue() return True except (InputErrors, SomethingElse): return False As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple. However, the reference documentation was never updated to match this new restriction. Make it clear that the definition is no longer recursive. Automerge-Triggered-By: GH:ericvsmith
* [doc] Mention with and except clauses in globals() (GH-13232)Andre Delfino2020-12-191-1/+1
|
* [doc] Fix a few margins due to bad markup (GH-23619)Andre Delfino2020-12-171-1/+0
|
* bpo-41879: Doc: Fix description of async for statement (GH-23548)Nick Gaya2020-12-111-4/+4
| | | Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables. This fix is relevant for version 3.7 onward.
* bpo-42485: [Doc] Link to PEP 617 from full grammar specification (GH-23532)James Gerity2020-11-301-1/+2
| | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-41229: Update docs for explicit aclose()-required cases and add ↵Joongi Kim2020-11-021-3/+13
| | | | | | | | | | | | | | | | | | | contextlib.aclosing() method (GH-21545) This is a PR to: * Add `contextlib.aclosing` which ia analogous to `contextlib.closing` but for async-generators with an explicit test case for [bpo-41229]() * Update the docs to describe when we need explicit `aclose()` invocation. which are motivated by the following issues, articles, and examples: * [bpo-41229]() * https://github.com/njsmith/async_generator * https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#cleanup-in-generators-and-async-generators * https://www.python.org/dev/peps/pep-0533/ * https://github.com/achimnol/aiotools/blob/ef7bf0cea7af/src/aiotools/context.py#L152 Particuarly regarding [PEP-533](https://www.python.org/dev/peps/pep-0533/), its acceptance (`__aiterclose__()`) would make this little addition of `contextlib.aclosing()` unnecessary for most use cases, but until then this could serve as a good counterpart and analogy to `contextlib.closing()`. The same applies for `contextlib.closing` with `__iterclose__()`. Also, still there are other use cases, e.g., when working with non-generator objects with `aclose()` methods.
* bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)kj2020-10-301-7/+1
| | | Follow up to 7cdf30fff39ea97f403b5472096349998d190e30 and 4173320920706b49a004bdddd8d7108e8984e3fc. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
* bpo-6761: Enhance __call__ documentation (GH-7987)Andre Delfino2020-10-271-1/+1
|
* bpo-41910: specify the default implementations of object.__eq__ and ↵Brett Cannon2020-10-211-6/+8
| | | | | | | object.__ne__ (GH-22874) See Objects/typeobject.c:object_richcompare() for the implementation of this in CPython. Automerge-Triggered-By: GH:brettcannon
* bpo-35181: Correct importlib documentation for some module attributes (GH-15190)Géry Ogam2020-10-211-15/+3
| | | | | | | | | | | | | | | @ericsnowcurrently This PR will change the following: In the library documentation importlib.rst: - `module.__package__` can be `module.__name__` for packages; - `spec.parent` can be `spec.__name__` for packages; - `spec.loader` is not `None` for namespaces packages. In the language documentation import.rst: - `spec.loader` is not `None` for namespace packages. Automerge-Triggered-By: GH:warsaw
* Fix bpo-39416: Change "Numeric" to lower case; an english word, not a class ↵kpinc2020-10-211-1/+1
| | | | | | | | | | | | | | 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
* bpo-39416: Document some restrictions on the default string representations ↵kpinc2020-10-211-0/+18
| | | | | | | | | | | | | | | | 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/
* Doc: Fix a typo/error in the docs for cached bytecode (GH-22445)Zackery Spytz2020-10-211-1/+1
|
* Doc: Remove old Python version from future stmt (GH-21802)Andre Delfino2020-10-211-2/+2
|