Commit Graph

11135 Commits

Author SHA1 Message Date
Mark Dickinson e9a01e231a
Update potentially confusing note for mean. (GH-30174) 2021-12-21 09:00:53 +00:00
Alex Waygood 7c5c3f7254
bpo-46104: Fix example broken by GH-30148 (GH-30203)
See discussion in GH-30179.
2021-12-20 12:48:35 +08:00
Kumar Aditya da4b214304
bpo-42413: Replace `concurrent.futures.TimeoutError` and `asyncio.TimeoutError` with builtin `TimeoutError` (GH-30197)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-12-19 13:22:40 +02:00
andrei kulakov ae36cd1e79
bpo-37578: glob.glob -- added include_hidden parameter (GH-30153)
Automerge-Triggered-By: GH:asvetlov
2021-12-18 06:23:34 -08:00
Vivek Vashist 6f2df42951
bpo-46113: Minor fixes in stdtypes documentation (GH-30167)
* Fix#1 - isidentifier() function output

* Fix#2 Update the str.splitlines() function parameter

* Fix#3 Removed unwanted full stop for str and bytes types double quotes examples.

* Fix#4 Updated class dict from **kwarg to **kwargs
2021-12-18 21:52:51 +08:00
Alex Waygood 6ada013df1
bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-12-18 18:23:51 +08:00
Irit Katriel 396b58345f
bpo-45711: Remove type and traceback from exc_info (GH-30122)
* Do not PUSH/POP traceback or type to the stack as part of exc_info

* Remove exc_traceback and exc_type from _PyErr_StackItem

* Add to what's new, because this change breaks things like Cython
2021-12-17 14:46:22 +00:00
Julien Palard 62a0a2a25d
Doc: some rst linting. (GH-30149) 2021-12-17 13:55:03 +01:00
Irit Katriel 30322c497e
bpo-22047: [argparse] deprecate nested argument groups and mutually exclusive groups (GH-30098) 2021-12-16 15:31:08 +00:00
Irit Katriel a951c95a13
bpo-28816: [doc] clarify that zipimport invokes importers only for python files (GH-30060) 2021-12-16 09:12:24 +00:00
Vivek Vashist f025ae63dc
Add Positional only arguments forward slash (/) to sorted() function in Built-in Functions document (GH-30113)
sorted() function is missing forward slash (/) in Built-in Functions documentation page.

Automerge-Triggered-By: GH:asvetlov
2021-12-15 03:24:38 -08:00
Mark Shannon 9f8f45144b
bpo-44525: Split calls into PRECALL and CALL (GH-30011)
* Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW.

* Update specialization to handle new CALL opcodes.

* Specialize call to method descriptors.

* Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
2021-12-14 18:22:44 +00:00
Irit Katriel d60457a667
bpo-45292: [PEP-654] add except* (GH-29581) 2021-12-14 16:48:15 +00:00
Vinay Sajip cb589d1b6b
bpo-46063: Improve algorithm for computing which rolled-over log file… (GH-30093) 2021-12-14 00:53:37 +00:00
Gareth Rees a62be77266
bpo-45643: Add signal.SIGSTKFLT on platforms where this is defined (GH-29266) 2021-12-13 18:22:43 +01:00
Paul Bryan e09705f58f
Clarify new_event_loop return value. (GH-30078) 2021-12-13 14:39:22 +02:00
Irit Katriel 481f3ffdbe
bpo-37602: Clarify that the lib2to3 nonzero fixer changes only definitions (GH-30075) 2021-12-13 10:04:34 +00:00
Andre Delfino d0669c5e69
Remove erroneous padding in dataclasses (GH-30076)
Automerge-Triggered-By: GH:ericvsmith
2021-12-12 10:05:48 -08:00
Eric V. Smith e029c53e1a
bpo-44674: Use unhashability as a proxy for mutability for default dataclass __init__ arguments. (GH-29867)
`@dataclass` in 3.10 prohibits using list, dict, or set as default values. It does this to avoid the mutable default problem. This test is both too strict, and not strict enough. Too strict, because some immutable subclasses should be safe, and not strict enough, because other mutable types should be prohibited. With this change applied, `@dataclass` now uses unhashability as a proxy for mutability: if objects aren't hashable, they're assumed to be mutable.
2021-12-11 16:12:17 -05:00
180909 4fe5585240
bpo-19737: Improved the documentation for globals (GH-29823)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-12-11 01:04:21 +01:00
Louis Sautier c1051e08b3
bpo-42114: ctypes documentation: fix winmode parameter default value (GH-29976)
Signed-off-by: Louis Sautier <sautier.louis@gmail.com>
2021-12-11 00:00:02 +01:00
andrei kulakov 8c74713d0e
bpo-42182: stdtypes doc - update and fix links to several dunder methods (GH-27384) 2021-12-10 11:40:06 +02:00
Bernát Gábor e2cfc89e09
bpo-45391: mark UnionType as a class in documentation (GH-28757)
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
2021-12-09 20:56:14 +08:00
David CARLIER 267539bff7
bpo-46016: fcntl module add FreeBSD's F_DUP2FD_CLOEXEC flag support (GH-29993) 2021-12-08 23:28:51 +01:00
Mark Shannon 69806b9516
bpo-46009: Do not exhaust generator when send() method raises (GH-29986) 2021-12-08 12:09:26 +00:00
Irit Katriel 7989e9dff6
bpo-40222: update doc entry with respect to the change in WITH_EXCEPT_START (GH-29975) 2021-12-08 09:41:28 +00:00
Ken Jin c7e7a4b969
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963) 2021-12-07 23:25:13 +08:00
Victor Stinner cf7eaa4617
Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" (GH-29951)
This reverts commit 9bf2cbc4c4.
2021-12-07 12:31:04 +01:00
Vinay Sajip 2bf551757e
bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 2021-12-07 11:15:44 +00:00
James Gerity 8db06528ca
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) 2021-12-07 11:58:40 +02:00
Taras Sereda 8518ee348c
removal of duplicated text paragraph (#29666) 2021-12-07 01:12:29 +02:00
Irit Katriel 5bb7ef2768
bpo-45607: Make it possible to enrich exception displays via setting their __note__ field (GH-29880) 2021-12-03 22:01:15 +00:00
Alex Waygood b2afdc95cc
bpo-45535: Improve output of Enum ``dir()`` (GH-29316)
Modify the ``EnumType.__dir__()`` and ``Enum.__dir__()`` to ensure
that user-defined methods and methods inherited from mixin classes always
show up in the output of `help()`. This change also makes it easier for
IDEs to provide auto-completion.
2021-12-02 08:49:52 -08:00
Christian Clauss 226d22ff2d
docs: Improve example for urlparse() (GH-29816) 2021-12-02 10:52:32 +02:00
Weipeng Hong c2bb29ce9a
bpo-30533: Add docs for `inspect.getmembers_static` (#29874)
* Add docs for `inspect.getmembers_static`

* update
2021-12-01 11:23:46 -08:00
Rob f27bef3043
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) 2021-12-01 14:24:46 +02:00
Irit Katriel 8a45ca542a
bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (GH-29780) 2021-11-30 22:37:04 +00:00
Vishal Pandey f97ec09baf
bpo-33381: [doc] strftime's %f option may pad zeros on the left or the right (GH-29801) 2021-11-30 11:01:44 +00:00
Gideon 6266e4af87
bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-11-29 18:55:43 +00:00
andrei kulakov c1f93f0d37
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
Expanded ``astuple()`` docs, warning about deepcopy being applied 
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
2021-11-29 10:10:32 -08:00
Erlend Egeberg Aasland c4a69a4ad0
bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591) 2021-11-29 15:22:32 +00:00
Sergey Kolesnikov e0f8a3e9b9
Add missing 'await writer.drain()' call to example (GH-29162)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 09:15:24 -08:00
Zbigniew Siciarz 4dd82194f4
bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 04:30:48 -08:00
Jim Crist-Harif d71c7bc733
bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760)
Document the `port` parameter to `loop.create_server` in `asyncio`. In
particular, note that if `host` resolves to multiple network interfaces,
passing in `port=0` will result in a different random unused port being
used for each interface.

Automerge-Triggered-By: GH:ericvsmith
2021-11-24 11:43:57 -08:00
Jason R. Coombs d5cd2effa6
bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)
* bpo-45514: Apply changes from importlib_resources@a3ef4128c6

* Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs.

* Apply changes from importlib_resources@329ae9d5f2c.

* Indicate importlib.resources as a module.

Co-authored-by: Filipe Laíns <lains@riseup.net>
2021-11-24 02:51:37 -05:00
Miro Hrončok ae1965ccb4
bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… (GH-29384)
Consider the following directory structure:

    .
    └── PATH1
        └── namespace
            └── sub1
                └── __init__.py

And both PATH1 and PATH2 in sys path:

    $ PYTHONPATH=PATH1:PATH2 python3.11
    >>> import namespace
    >>> import namespace.sub1
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> ...

While this interpreter still runs, PATH2/namespace/sub2 is created:

    .
    ├── PATH1
    │   └── namespace
    │       └── sub1
    │           └── __init__.py
    └── PATH2
        └── namespace
            └── sub2
                └── __init__.py

The newly created module cannot be imported:

    >>> ...
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'namespace.sub2'

Calling importlib.invalidate_caches() now newly allows to import it:

    >>> import importlib
    >>> importlib.invalidate_caches()
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace'])

This was not previously possible.
2021-11-23 07:38:02 -08:00
Petr Viktorin 2c047f604e
Clarify that discutils.(plat)include is for CPython's headers (GH-29578)
Change the docs to note that "include" and "platinclude" are
for CPython's headers, and not necessarily for headers of
third-party libraries.

See discussion in: https://discuss.python.org/t/clarification-on-a-wheels-header-data/9305/19
2021-11-23 11:28:14 +01:00
Mark Shannon 135cabd328
bpo-44525: Copy free variables in bytecode to allow calls to inner functions to be specialized (GH-29595)
* Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead.

* Add reference to function to frame, borrow references to builtins and globals.

* Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
2021-11-23 09:53:24 +00:00
Raymond Hettinger d2b55b07d2
bpo-45766: Add direct proportion option to linear_regression(). (#29490)
* bpo-45766: Add direct proportion option to linear_regression().

* Update 2021-11-09-09-18-06.bpo-45766.dvbcMf.rst

* Use ellipsis to avoid round-off issues.

* Update Misc/NEWS.d/next/Library/2021-11-09-09-18-06.bpo-45766.dvbcMf.rst

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

* Update signature in main docs

* Fix missing comma

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-21 08:39:26 -06:00
Logan Jones fdc0e09c33
bpo-44733: Add max_tasks_per_child to ProcessPoolExecutor (GH-27373)
Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-11-20 21:19:41 +01:00