summaryrefslogtreecommitdiffstats
path: root/Doc/reference
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* bpo-42010: [docs] Clarify subscription of types (GH-22822)kj2020-10-201-2/+13
|
* bpo-29981: Add examples and update index for set, dict, and generator ↵Florian Dahlitz2020-10-201-0/+4
| | | | | | comprehensions'(GH-20272) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-41192: Add documentation of undocumented audit events (GH-21308)Saiyang Gou2020-10-201-0/+18
|
* [doc] Remove mention of async and await as soft keywords (GH-22144)Andre Delfino2020-10-121-4/+5
|
* bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)Batuhan Taskaya2020-10-061-7/+3
| | | | | The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions. For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
* bpo-41584: clarify when the reflected method of a binary arithemtic operator ↵Brett Cannon2020-10-051-7/+8
| | | | is called (#22505)
* bpo-41762: Fix usage of productionlist markup in the doc (GH-22281)Victor Stinner2020-09-186-66/+67
| | | | | | | Use an unique identifier for the different grammars documented using the Sphinx productionlist markup. productionlist markups of the same grammar, like "expressions" or "compound statements", use the same identifier "python-grammar".
* [doc] Remove superfluous comment about equal in f-strings (GH-22006)Andre Delfino2020-09-101-1/+1
| | | Automerge-Triggered-By: @kushaldas
* bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)Victor Stinner2020-08-171-1/+1
| | | | | | | | Sphinx 3 disallows having more than one productionlist markup with the same name. Simply remove names in this case, since names are not shown anyway. For example, fix the Sphinx 3 warning: Doc/reference/introduction.rst:96: duplicate token description of *:name, other instance in reference/expressions
* bpo-40204: Fix reference to terms in the doc (GH-21865)Victor Stinner2020-08-141-2/+2
| | | | | | | | 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.
* bpo-41045: Document debug feature of f-strings ('=') (GH-21509)amaajemyfren2020-07-271-5/+32
| | | | | Co-Authored-By: Rishi <rishi93dev@gmail.com> Automerge-Triggered-By: @gvanrossum