Commit Graph

24507 Commits

Author SHA1 Message Date
Mariusz Felisiak 2e41df4d60
bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385)
Follow up to 11749e2dc2
2021-07-27 10:57:52 +02:00
Vinicius Gubiani Ferreira 6fa4060b86
[doc] Fix typo in asyncio Event Loop (GH-27377)
First Pull Request to cpython, so forgive me for any mistakes

Automerge-Triggered-By: GH:Mariatta
2021-07-26 20:01:00 -07:00
Mariusz Felisiak 11749e2dc2
bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-27 00:11:55 +02:00
Steffen Zeile 6c7ec7282b
Fix typos in `Weekday.today` example (GH-27363) 2021-07-26 23:35:09 +02:00
partev 5fdd2a14ce
docs: replace "Mac OS X" -> "macOS" (GH-27364)
"Mac OS X" has been rebranded as macOS

https://www.apple.com/macos
2021-07-26 21:37:31 +02:00
Jelle Zijlstra f22737abfa
The current documentation says it returns None if the name is not found, but (GH-26785)
the implementation uses [] and will raise KeyError instead.

Noticed by @srittau in python/typeshed@5659.
2021-07-26 18:18:19 +02:00
Serhiy Storchaka c97c2a050c
bpo-43443: Clarify difference between shelve objects and dicts (GH-27004) 2021-07-26 18:11:25 +02:00
Yurii Karabas 6c1b57d958
bpo-44490: Add 'Whats New' docs regarding types.Union changes (GH-27215) 2021-07-26 18:05:55 +02:00
Hasan 2b8ad9e6c5
bpo-44732: Rename types.Union to types.UnionType (#27342)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-07-26 18:00:21 +02:00
Elliot Waite 3e5b82ed7e
Small text fixes for enum.rst (#27322)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-07-26 17:59:20 +02:00
thomkeh aa0e4a64b0
Fix typo in dataclasses documentation (#27360)
"affect" -> "effect"
2021-07-26 08:39:45 -04:00
Steven Hsu 0363a4014d
bpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349)
Replace sentence with confusing "pseudo-module" with two sentences
separating future statements and the __future__ module.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-07-25 21:11:12 -04:00
andrei kulakov 96cf5a63d2
bpo-42378: fixed log truncation on logging shutdown (GH-27310)
Automerge-Triggered-By: GH:vsajip
2021-07-25 13:17:47 -07:00
Vinay Sajip 9751f85914
bpo-44399: Update logging cookbook to document patterns to be avoided. (GH-27348) 2021-07-25 18:05:39 +01:00
Vinay Sajip 50b72768ff
bpo-43184: Add information about added attribute and method. (GH-27347) 2021-07-25 17:36:30 +01:00
Anton Grübel 717f608c4a
Fix typo in ssl documentation (GH-27329) 2021-07-24 18:54:51 -03:00
Dong-hee Na 4463fa2fa1
bpo-44611: Update docs for os and whatsnew 3.11 (#27314) 2021-07-24 11:14:08 +02:00
Ken Jin 7aac3f6236
bpo-44353: Document that typing.NewType is now a class (#27319) 2021-07-24 10:53:49 +02:00
Dong-hee Na 906fe47083
bpo-44611: Use BCryptGenRandom instead of CryptGenRandom on Windows (GH-27168) 2021-07-23 23:04:30 +09:00
Petr Viktorin a4760cc32d
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260)
* Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG
    
    The field is always present in the type struct, as explained
    in the added comment.

* Remove Py_TPFLAGS_HAVE_AM_SEND
    
    The flag is not needed, and since it was added in 3.10 it can be removed now.
2021-07-23 06:21:11 -07:00
Jack DeVries 7d25254cf0
bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297)
This fixes a small typo. The code fragment should not be quoted. Thank you
@merwok for the feedback.
2021-07-22 16:06:18 -07:00
Jack DeVries 50ffbe3daf
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) 2021-07-22 19:23:29 +01:00
Steven Hsu c05a790693
bpo-44651: delete entry of "coercion" in Doc/glossary.rst (GH-27226)
bpo 44651: delete entry of "coercion".
2021-07-22 13:18:07 +01:00
Elliot Waite 92a5c0871b
Fix typo in collections.rst (#27270) 2021-07-22 09:31:22 +02:00
andrei kulakov 64f54b7ccd
bpo-30511: Add note on thread safety to shutil.make_archive() (#26933)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-21 10:33:11 +02:00
Sondre Lillebø Gundersen e25e43e355
correct spelling (GH-27076) 2021-07-19 17:46:42 -03:00
α∂мιηιχтяαтσя 1e651c6ada
Clean up comma usage in Doc/library/functions.rst (#27083) 2021-07-19 18:02:23 +02:00
Julien Palard fbf10080bb
bpo-42238: Fix small rst issue in NEWS.d/. (#27238) 2021-07-19 16:34:48 +02:00
Dong-hee Na b2cf2513f9
bpo-44340: Add support for building with clang full/thin lto (GH-27231) 2021-07-19 19:52:56 +09:00
Irit Katriel aab1899c9d
bpo-41546: make pprint (like print) not write to stdout when it is None (GH-26810) 2021-07-19 10:19:02 +01:00
Idan Moral 35b98e38b6
bpo-43086: Add handling for out-of-spec data in a2b_base64 (GH-24402)
binascii.a2b_base64 gains a strict_mode= parameter. When enabled it will raise an
error on input that deviates from the base64 spec in any way.  The default remains
False for backward compatibility.

Code reviews and minor tweaks by: Gregory P. Smith <greg@krypto.org> [Google]
2021-07-18 17:45:19 -07:00
Steven Hsu b494685b25
bpo-44561: Update hyperlinks in Doc/distributing/index.rst (#27032)
* Update hyperlinks in Doc/distributing/index.rst

Update three expired hyperlinks.

Closes bpo-44561.
2021-07-19 10:10:48 +10:00
Batuhan Taskaya a045991f60
bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found (GH-23278) 2021-07-18 15:56:09 +03:00
Jason R. Coombs 29358e93f2
bpo-44638: Add a reference to the zipp project and hint as to how to use it. (GH-27188)
Automerge-Triggered-By: GH:jaraco
2021-07-16 06:14:54 -07:00
Ammar Askar 8ce3008585
bpo-44569: Decouple frame formatting in traceback.py (GH-27038) 2021-07-16 13:21:16 +01:00
andrei kulakov b39eea06d1
bpo-42799: fnmatch module: bump up size of lru_cache for patterns (GH-27084) 2021-07-15 12:53:26 +02:00
Jack DeVries 2693132292
bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) 2021-07-14 17:38:42 -07:00
Vinay Sajip 3b8075f907
bpo-44473: Update docstring and documentation for QueueHandler.prepar… (GH-27140)
…e().
2021-07-14 17:06:48 -07:00
Shane Harvey d59d7374a3
bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079) 2021-07-14 23:53:15 +01:00
Pablo Galindo Salgado 2b47af6398
Add release highlights for the 3.10 what's new document (GH-27150) 2021-07-14 23:19:55 +01:00
Jack DeVries 1ca27f2647
bpo-44639: fix typo in sqlite.rst (transation => transaction) (GH-27145)
To my understanding, this is supposed to say "transaction".

See the relevant source:

a158b20019/Modules/_sqlite/connection.c (L1434-L1467)
2021-07-14 14:39:54 -07:00
Serhiy Storchaka 054e9c84ac
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-07-13 22:27:50 +01:00
andrei kulakov 3b5b99da4b
bpo-43126: Expand docs on io.IOBase.readlines() method (#27061)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-13 16:07:56 +02:00
Kevin Follstad 48a5aa7f12
bpo-44514: Add doctest testcleanup for configparser and bz2 (#26909)
Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.
2021-07-13 15:57:05 +02: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
Barry Warsaw f6954cdfc5
bpo-44613: Make importlib.metadata non-provisional (#27101)
* importlib.metadata is no longer provisional as of 3.10
* Add NEWS entry
2021-07-12 16:56:40 -07:00
Batuhan Taskaya 1890dd235f
bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-07-12 20:32:33 +01:00
David Sanders da2e673c53
bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026) 2021-07-12 17:19:54 +02:00
Furkan Onder 66c5853406
bpo-26329: update os.path.normpath documentation (GH-20138)
* bpo-26329: update os.path.normpath documentation

* Update os.path.rst

* Update posixpath.py

* update Pathname Resolution note
2021-07-12 09:48:01 -03:00
Ned Batchelder af4a2dcc40
docs: add the word 'official' (GH-26849) 2021-07-08 09:58:13 -05:00
Erlend Egeberg Aasland a3739b207a
bpo-43908: Immutable types inherit vectorcall (GH-27001)
Heap types with the Py_TPFLAGS_IMMUTABLETYPE flag can now inherit the
PEP 590 vectorcall protocol.  Previously, this was only possible for static types.

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-07-08 12:48:01 +02:00
Julien Palard 15f0fc571c
Doc: Fix wrong exception used in example. (GH-26572) 2021-07-08 09:31:28 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 58248d9437
bpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263) 2021-07-08 16:16:08 +09:00
Ammar Askar 4823d9a512
bpo-43950: Add option to opt-out of PEP-657 (GH-27023)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-07-07 20:07:12 +01:00
Pablo Galindo 8363c53369
bpo-44530: Document the new CodeObject.co_qualname attribute (GH-27052) 2021-07-07 14:20:49 +01:00
Gabriele N. Tornetta 2f180ce2cb
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941) 2021-07-07 12:21:51 +01:00
Julien Palard 32096df0e0
Doc: Fix link in multiprocessing.starmap pointing to builtin map. (GH-26560) 2021-07-07 10:25:01 +02:00
andrei kulakov 17f94e2888
bpo-43453: Update and re-add example to typing runtime_checkable (#27013)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-07-05 09:23:42 -07:00
Jack DeVries abb08e3af6
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000 2021-07-05 07:52:32 +01:00
Ammar Askar 5644c7b3ff
bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2021-07-05 00:14:33 +01:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) a79e2b6497
Fix a small typo in the docs (GH-26991) 2021-07-03 11:04:57 -03:00
Julien Palard 01331f1a3c
bpo-42238: rstlint: Add two new checks. (GH-26966) 2021-07-03 10:35:02 +02:00
Matthew Clapp 4bcef2bb48
bpo-44388: Update venv EnvBuilder.ensure_directories() docs. (GH-26663)
Ref: 

This changes the documentation for `EnvBuilder.ensure_directories(env_dir)` to match the actual behavior of that API call.

In particular, `ensure_directories()` is not affected by the state of the `upgrade` attribute, and will not cause an error to have existing directories whether or not the `clear` attribute is set.

This documentation change I believe should be valid to all python versions back to 3.6.

Automerge-Triggered-By: GH:vsajip
2021-07-02 13:48:15 -07:00
Irit Katriel 943e77d42d
bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru… (GH-26967) 2021-07-02 10:42:08 +01:00
Illia Volochii ddd5f36971
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540) 2021-07-01 17:46:49 +03: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
Steve Dower 95919b0d27
bpo-41180: Fixes documentation to specify correct event name and add versionchanged (GH-26972) 2021-06-30 18:53:13 +01:00
Steve Dower 139de04518
bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26961) 2021-06-30 17:21:37 +01:00
Julien Palard 86eeeb4259
Doc: fix a rst tag. (GH-26965) 2021-06-30 11:31:04 +02:00
Jack DeVries 12803c59d5
bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935) 2021-06-29 18:28:03 +01:00
Julien Palard 50148cacfa
Doc: Remove trailing whitespaces. (GH-26953) 2021-06-29 13:16:53 +02:00
andrei kulakov 0d7f7975d5
bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834) 2021-06-29 11:54:28 +01:00
Serhiy Storchaka 6cb145d23f
bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820)
A TypeError is now raised instead of an AttributeError in
ExitStack.enter_context() and AsyncExitStack.enter_async_context()
for objects which do not support the context manager or
asynchronous context manager protocols correspondingly.
2021-06-29 11:28:15 +03:00
Serhiy Storchaka 20a88004ba
bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)
A TypeError is now raised instead of an AttributeError in
"with" and "async with" statements for objects which do not
support the context manager or asynchronous context manager
protocols correspondingly.
2021-06-29 11:27:04 +03:00
Rodrigo Girão Serrão dcb1caef5b
[doc] Fix typo in what's new in 3.10 (GH-26911)
The `try` statement was missing a colon and therefore was not exemplifying the correct `SyntaxError`.
2021-06-28 23:02:18 +01:00
Jason R. Coombs efe7d08d17
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807)
Sync with importlib_metadata 4.6.
2021-06-27 17:59:18 -04:00
jdevries3133 2f49c9debc
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) 2021-06-27 20:27:20 +01:00
andrei kulakov 6dd69f45f5
Add missing arg to DICT_MERGE opcode (GH-26859) 2021-06-27 13:19:14 +01:00
Brandt Bucher ca2009d72a
bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864) 2021-06-25 08:20:43 -07:00
Barry Warsaw 8488b85c63
bpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (#26882)
* Issue a deprecation warning on smtpd import

* Also issue DeprecationWarnings for asynchat and asyncore

* Fix some tests

* test___all__ requires the word 'module' or 'package' in the deprecation
  warning text, so add those to smtpd, asynchat, and asyncore.
* In test_support, use pprint now instead of asyncore as the landmark.

* Add What's New

* Use ..deprecated::

* Use ..deprecated::

* Update Lib/smtpd.py

Co-authored-by: Miro Hrončok <miro@hroncok.cz>

* Update Doc/library/smtpd.rst

Co-authored-by: Miro Hrončok <miro@hroncok.cz>

* Import async{hat,ore} after the DeprecationWarning for this module

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2021-06-24 12:37:26 -07:00
Samuel Marks 19459f8ce6
bpo-44321: Adds `os.EX_OK` for Windows (GH-26559) 2021-06-24 17:45:18 +01:00
Erlend Egeberg Aasland b19f455339
bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863) 2021-06-24 15:35:57 +01:00
Arnon Yaari 599c07006a
Fix typo in whatsnew 3.10.rst (GH-26854)
Thanks for the fix @wiggin15 .
2021-06-24 10:01:42 -03:00
Petr Viktorin 29987f7265
bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)
I tried to be relatively thorough and give lots of links.
One reason is that this wasn't deprecated very long; also it seems people running into this tend to not be familiar with similar APIs.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-06-24 14:57:28 +02:00
Erlend Egeberg Aasland 9049ea51ec
bpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889)
Automerge-Triggered-By: GH:vstinner
2021-06-24 00:57:14 -07:00
Guido van Rossum 769d7d0c66
bpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)
All uses of this flag are either setting it
or in doc or tests for it. So we should be
able to get rid of it completely.
2021-06-23 09:51:44 -07:00
Victor Stinner 489699ca05
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.
2021-06-23 14:13:27 +02:00
Géry Ogam a6b47de07a
[doc] Improve punctuation atexit doc 2021-06-22 17:49:12 +01:00
Dennis Sweeney d1ae57027f
bpo-41621: Document defaultdict's default_factory parameter (GH-21945)
It defaults to None and is positional only.
2021-06-22 10:19:24 -04:00
Terry Jan Reedy 51f45d085d
bpo-13814: Explain why generators are not context managers (GH-26835)
Put entry in Design FAQ after a question about a context manager for assignment.
Original patch by Aidan Lowe.
2021-06-21 17:23:29 -04:00
Victor Stinner d19163912b
bpo-44466: Faulthandler now detects the GC (GH-26823)
The faulthandler module now detects if a fatal error occurs during a
garbage collector collection (only if all_threads is true).
2021-06-21 13:15:40 +02:00
Georg Sauthoff a317778fd5
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-06-20 21:08:07 +01:00
Hemangii 7265b277fa
Fix typos and grammatical changes in the 3.10 what's new document (GH-26319) 2021-06-20 20:46:59 +01:00
Mark Dickinson 291848195f
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) 2021-06-19 15:32:24 +01:00
Raymond Hettinger e5c7ee1156
Remove dubious suggestion (GH-26789)
Remove the weakref example.  If a new instance is created and the same arguments are passes, it raises a ReferenceError.
2021-06-18 19:19:32 -05:00
Pablo Galindo 83c9dad8da
Add a note about NameError/AttributeError suggestions with custom error functions (GH-26794) 2021-06-18 23:08:38 +01:00
Ethan Furman f60b07ab6c
bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)
* [Enum] reduce scope of new format behavior

Instead of treating all Enums the same for format(), only user mixed-in
enums will be affected.  In other words, IntEnum and IntFlag will not be
changing the format() behavior, due to the requirement that they be
drop-in replacements of existing integer constants.

If a user creates their own integer-based enum, then the new behavior
will apply:

    class Grades(int, Enum):
        A = 5
        B = 4
        C = 3
        D = 2
        F = 0

Now:  format(Grades.B)  -> DeprecationWarning and '4'
3.12:                   -> no warning, and 'B'
2021-06-18 13:15:46 -07:00
Raymond Hettinger 7f01f77f8f
bpo-44310: Add a FAQ entry for caching method calls (GH-26731) 2021-06-17 15:39:42 -05:00
Mark Dickinson 7247f6f433
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) 2021-06-16 18:43:49 +01:00
Ken Jin 6773c3eaa7
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Also fix stable ABI type definitions
2021-06-16 07:12:25 -07:00
Petr Viktorin 7cad9cb51b
bpo-43795: Don't list private names in the limited API (GH-26740)
* Remove struct _node from the stable ABI list

This struct was removed along with the old parser in Python 3.9 (PEP 617)

* Stable ABI list: Use the public name "PyFrameObject" rather than "_frame"

* Ensure limited API doesn't contain private names

Names prefixed by an underscore are private by definition.

* Add a blurb
2021-06-16 11:22:36 +02:00
Ethan Furman 741b8ae1cf
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750) 2021-06-15 18:51:19 -07:00
Mark Dickinson 1d10bf0bb9
bpo-43475: Add what's new entry for NaN hash changes (GH-26725) 2021-06-15 19:48:35 +01:00
Sebastian Rittau 8a76683cfb
bpo-38291: Remove mention of typing.io and typing.re again (GH-26113)
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
2021-06-14 07:45:19 -07:00
Raymond Hettinger fafcfff926
bpo-44310: Note that lru_cache keep references to both arguments and results (GH-26715)
* Simplify the count_vowels example
* Hits and misses are fetched while a lock is held
* Add note that references are kept for arguments and return values
* Clarify behavior when *typed* is false.
2021-06-14 00:47:26 -05:00
Serhiy Storchaka 9f1c5f6e8a
bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) 2021-06-12 15:15:17 +03:00
Mark Dickinson 4a42cebf6d
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)
Change the behaviour of `math.pow(0.0, -math.inf)` and `math.pow(-0.0, -math.inf)` to return positive infinity instead of raising `ValueError`. This makes `math.pow` consistent with the built-in `pow` (and the `**` operator) for this particular special case, and brings the `math.pow` special-case handling into compliance with IEEE 754.
2021-06-12 10:23:02 +01:00
Christian Heimes e26014f1c4
bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-11 09:15:48 +02:00
Julien Palard c4955e2c4f
Doc: Prettier exception hierarchy. (GH-26533) 2021-06-11 08:53:52 +02:00
Ajith Ramachandran ac867f10b4
bpo-44357:Add `math.cbrt()` function: Cube Root (GH-26622)
* Add math.cbrt() function: Cube Root

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-06-10 17:42:09 +01:00
Dong-hee Na 309ab61602
bpo-35800: Remove smtpd.MailmanProxy since 3.11 (GH-26617) 2021-06-10 08:12:41 +09:00
Furkan Onder 878d7e4ee4
bpo-21760: fix __file__ description (GH-19097) 2021-06-09 14:10:20 -07:00
Ethan Furman eea8148b7d
bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586)
Move the check for missing named flags in flag aliases from Flag creation
to a new *verify* decorator.
2021-06-09 09:03:55 -07:00
Serhiy Storchaka 2ea6d89028
bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)
Emit a deprecation warning if the numeric literal is immediately followed by
one of keywords: and, else, for, if, in, is, or. Raise a syntax error with
more informative message if it is immediately followed by other keyword or
identifier.

Automerge-Triggered-By: GH:pablogsal
2021-06-08 16:31:10 -07:00
Eric Snow 3e1c7167d8
bpo-43693: Un-revert commit f3fa63e. (#26609)
This was reverted in GH-26596 (commit 6d518bb) due to some bad memory accesses.

* Add the MAKE_CELL opcode. (gh-26396)

The memory accesses have been fixed.

https://bugs.python.org/issue43693
2021-06-08 16:01:34 -06:00
Petr Viktorin 257e400a19
bpo-43795: Note Stable ABI PEP in What's New (GH-26479)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-06-08 17:20:07 +02:00
Pablo Galindo 3fe921cd49
Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396)" (GH-26597)
This reverts commit 631f9938b1.
2021-06-08 13:17:55 +01:00
Pablo Galindo 6d518bb3a1
bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function (GH-26493)" (GH-26596)
This reverts commit f3fa63ec75 as is
causing crashes in some Windows tests in the buildbots.
2021-06-08 12:24:40 +01:00
Eric Snow 631f9938b1
bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396)
This moves logic out of the frame initialization code and into the compiler and eval loop.  Doing so simplifies the runtime code and allows us to optimize it better.

https://bugs.python.org/issue43693
2021-06-07 16:52:00 -06:00
Eric Snow 2ab27c4af4
bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)
These were reverted in gh-26530 (commit 17c4edc) due to refleaks.

* 2c1e258 - Compute deref offsets in compiler (gh-25152)
* b2bf2bc - Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)

This change fixes the refleaks.

https://bugs.python.org/issue43693
2021-06-07 12:22:26 -06:00
Sergey B Kirpichev 89e50ab36f
bpo-44258: support PEP 515 for Fraction's initialization from string (GH-26422)
* bpo-44258: support PEP 515 for Fraction's initialization from string

* regexps's version

* A different regexps version, which doesn't suffer from catastrophic backtracking

* revert denom -> den

* strip "_" from the decimal str, add few tests

* drop redundant tests

* Add versionchanged & whatsnew entry

* Amend Fraction constructor docs

* Change .. versionchanged:...
2021-06-07 08:06:33 +01:00
Terry Jan Reedy 67dfa6f2a5
bpo-44322: Document more SyntaxError details. (GH-26562)
1. SyntaxError args have a tuple of other attributes.
2. Attributes are adjusted for errors in f-string field expressions.
3. Compile() can raise SyntaxErrors.
2021-06-06 21:42:31 -04:00
NAKAMURA Osamu 71be461704
bpo-44320: Fix markup for W3C C14N test suite (GH-26556) 2021-06-06 11:34:10 +09:00
Irit Katriel dda9ecbfec
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) 2021-06-04 23:07:57 +01:00
Pablo Galindo 17c4edc4e0
bpo-43693: Revert commits 2c1e2583fd and b2bf2bc1ec (GH-26530)
* Revert "bpo-43693: Compute deref offsets in compiler (gh-25152)"

This reverts commit b2bf2bc1ec.

* Revert "bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)"

This reverts commit 2c1e2583fd.

These two commits are breaking the refleak buildbots.
2021-06-04 17:51:05 +01:00
Mark Shannon b2bf2bc1ec
bpo-43693: Compute deref offsets in compiler (gh-25152)
Merges locals and cells into a single array.
Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more

https://bugs.python.org/issue43693
2021-06-03 18:03:54 -06:00
Pablo Galindo b250f89bb7
bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) 2021-06-03 23:52:12 +01:00
Erlend Egeberg Aasland f461a7fc3f
bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module (GH-24203)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-03 20:59:26 +01:00
Victor Stinner f3fa63ec75
bpo-39573: Py_TYPE becomes a static inline function (GH-26493)
Convert the Py_TYPE() and Py_SIZE() macros to static inline
functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be
used to set an object type and size.
2021-06-03 18:42:59 +02:00
Eric Snow 2c1e2583fd
bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)
A number of places in the code base (notably ceval.c and frameobject.c) rely on mapping variable names to indices in the frame "locals plus" array (AKA fast locals), and thus opargs.  Currently the compiler indirectly encodes that information on the code object as the tuples co_varnames, co_cellvars, and co_freevars.  At runtime the dependent code must calculate the proper mapping from those, which isn't ideal and impacts performance-sensitive sections.  This is something we can easily address in the compiler instead.

This change addresses the situation by replacing internal use of co_varnames, etc. with a single combined tuple of names in locals-plus order, along with a minimal array mapping each to its kind (local vs. cell vs. free).  These two new PyCodeObject fields, co_fastlocalnames and co_fastllocalkinds, are not exposed to Python code for now, but co_varnames, etc. are still available with the same values as before (though computed lazily).

Aside from the (mild) performance impact, there are a number of other benefits:

* there's now a clear, direct relationship between locals-plus and variables
* code that relies on the locals-plus-to-name mapping is simpler
* marshaled code objects are smaller and serialize/de-serialize faster

Also note that we can take this approach further by expanding the possible values in co_fastlocalkinds to include specific argument types (e.g. positional-only, kwargs).  Doing so would allow further speed-ups in _PyEval_MakeFrameVector(), which is where args get unpacked into the locals-plus array.  It would also allow us to shrink marshaled code objects even further.

https://bugs.python.org/issue43693
2021-06-03 10:28:27 -06:00
Zackery Spytz 4eed2821d4
bpo-39560: Document PyUnicode_FromKindAndData() kind transformation (GH-23848) 2021-06-03 10:33:44 -03:00
andrei kulakov 8b93f0e696
bpo-43858: Add logging.getLevelNamesMapping() (GH-26459)
Added a function that returns a copy of a dict of logging levels.
2021-06-03 01:12:59 -07:00
Wm. Keith van der Meulen 4846ea95d1
Add bpo-42914 to What's New (GH-25124)
BPO-42914 was not added to the What's New in #24864. This includes it in the "Improved Modules" section.

Automerge-Triggered-By: GH:gpshead
2021-06-02 20:45:34 -07:00
Zac Bentley 225caf78d1
Typo fix in asyncio-eventloop.rst (GH-26482) 2021-06-02 12:00:25 -03:00
Victor Stinner ee7637596d
bpo-44263: Py_TPFLAGS_HAVE_GC requires tp_traverse (GH-26463)
The PyType_Ready() function now raises an error if a type is defined
with the Py_TPFLAGS_HAVE_GC flag set but has no traverse function
(PyTypeObject.tp_traverse).
2021-06-01 23:37:12 +02:00
MapleCCC 87272b70f1
bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) 2021-06-01 21:15:30 +01:00
Jason R. Coombs 78d9a9b190
bpo-44246: Remove note about access by index now that a compatibility shim is offered. (GH-26472) 2021-05-31 12:29:24 -04:00
Jules Lasne 8ab5b7eeca
Fixing typos in turtle.rst (GH-24385)
* Fixing typos in turtle.rst

* Update turtle.rst

* Update turtle.rst

* Update turtle.rst

* Update turtle.rst
2021-05-30 13:35:30 -03:00
Dong-hee Na 14ba761078
bpo-44235: Remove deprecated functions in the gettext module. (GH-26378) 2021-05-30 10:29:45 +09:00
Zackery Spytz 5f28752f5b
bpo-43750: Fix incorrect reference to PACKET_MULTIHOST in the docs (GH-25241)
It should be PACKET_MULTICAST, not PACKET_MULTIHOST.
2021-05-29 19:46:01 -03:00
Martmists 0b11c429c7
bpo-42085: [docs] Add versionadded for am_send in type object documentation (GH-25465) 2021-05-29 21:30:27 +01:00
Pablo Galindo 43cf7c864a
bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) 2021-05-29 04:32:42 +01:00
Pablo Galindo 8b55bc3f93
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442) 2021-05-29 03:57:39 +01:00
Jürgen Gmach 2138b2edaf
bpo-44045: fix spelling of uppercase vs upper-case (GH-25985)
And also of lowercase vs lower-case.

The `-` notation should only be used for adjectives.
2021-05-28 17:54:25 -03:00
Jason R. Coombs 28f12c9f4f
bpo-44246: Update What's New for importlib.metadata. (#26408)
* bpo-44246: Update What's New for importlib.metadata.

Bump version of importlib_metadata included.
Add note about compatibility notice and fix link to entry_points documentation.
Add note about removal of access by index on Distribution.entry_points.

* Fix syntax mistake in issue reference.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

* Fix broken reference in entry-points.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-27 19:36:06 -04:00
Erlend Egeberg Aasland 8cec740820
bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394) 2021-05-27 12:55:38 +02:00
Ken Jin d8fd8c8568
bpo-42392: [docs] Add deprecated-removed loop labels for asyncio (GH-26357)
* Add deprecated-removed loop labels for all reelvant functions/classes in asyncio
2021-05-26 14:59:34 -07:00
Peter Law 46db39d7bd
bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) 2021-05-26 15:13:09 +01:00
Jero Bado add805f921
Correct minor spelling typos (GH-26339)
surroundeded to surrounded
extensins to extensions
2021-05-25 18:01:30 -03:00
Mark ee3d78ef73
Point to recent link to PyFLTK (GH-26315) 2021-05-25 17:37:28 -03:00
Mariusz Felisiak d18e5dae91
bpo-20408: Fix memoryview() signature in docs (GH-24431) 2021-05-25 17:24:30 +03:00
Petr Viktorin d16856960e
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241)
Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4);
but to fix that issue it would be enough to add it to the regular C API.

The function is undocumented, tests were added very recently ([bpo-44131]()),
and most importantly, it is not present in all builds of Python, as
the linker sometimes omits it as unused.
It should be added back when these issues are fixed.

Note that this does not affect Python's regular C API.
2021-05-25 04:42:03 -07:00
Victor Stinner 63f17c252a
bpo-43109: configure doc: LTO requires "ar" on macOS (GH-26349) 2021-05-25 12:25:22 +02:00
Raymond Hettinger 2f2e703244
bpo-44151: Various grammar, word order, and markup fixes (GH-26344) 2021-05-24 23:04:04 -07:00
Zack Kneupper 2f3a87856c
bpo-44151: linear_regression() minor API improvements (GH-26199) 2021-05-24 17:30:58 -07:00
Ken Jin 8450e8a81f
bpo-38908: [docs] Add changes to 3.10 whatsnew and fix some minor inaccuracies in news (GH-26096)
The fix only applies to ``isinstance``. ``issubclass`` isn't affected (because it was always working to begin with). So I also fixed the news to reflect that.
2021-05-24 16:51:08 -07:00
Jason R. Coombs 7148293d96
bpo-44195: Use 'TraversableResources' in the docs to match the implementation. (GH-26317) 2021-05-24 13:08:10 -04:00
Tushar Sadhwani 3ad101b317
Fix typo in whatsnew/3.10.rst (GH-26310) 2021-05-23 23:10:24 +01:00
Junnosuke Kuroda 8b9310d902
bpo-43207: InspectLoader.is_package is not an abstract method (GH-24517)
Making the description of `InspectLoader.is_package` aligned with the current implementation.

Automerge-Triggered-By: GH:jaraco
2021-05-23 12:19:52 -07:00
Erlend Egeberg Aasland 2a1e6698b1
bpo-30757: Improve "How to make stand-alone binaries" FAQ (GH-26309)
Co-authored-by: denfromufa <denfromufa@users.noreply.github.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-22 23:03:09 +01:00
Irit Katriel 220dd80a26
bpo-33809: add the TracebackException.print() method (GH-24231) 2021-05-22 17:39:33 +01:00
E-Paine e9f66aedf4
Remove effbot urls (GH-26308) 2021-05-22 14:09:54 +02:00
Terry Jan Reedy 604cd71e50
Specify Python Cookbook edition for reference (GH-26301)
The timeit doc references Tim Peters introduction to the Chapter 18,
Algorithms, of the second edition.  The first editiion was before timeit.
The third edition instead has Chapter 1, Data Structures and Algorithms,
without Tim's introduction.
2021-05-21 15:17:10 -07:00
Mariusz Felisiak b06ed1d883
Remove duplicate words in docs. (GH-26167) 2021-05-21 23:39:09 +05:30
Terry Jan Reedy 2f47d8dcc7
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
2021-05-21 13:54:01 -04:00
Numerlor 642fdfdc04
[doc] Fix indentation in inspect documentation (GH-24846) 2021-05-21 18:05:35 +01:00
Raymond Hettinger be4dd7fcd9
bpo-44150: Support optional weights parameter for fmean() (GH-26175) 2021-05-20 20:22:26 -07:00
Bruno b66a03a491
[doc] Fix typo in asyncio-eventloop documentation (GH-22311) 2021-05-19 22:18:42 +01:00
naglis c054e8f78f
bpo-40975: [doc] Identify AsyncExitStack.enter_async_context()/aclose() as coroutine methods (GH-20870) 2021-05-19 21:36:05 +01:00
Ken Jin 5c6619552d
bpo-26110: Document `CALL_METHOD_KW` (GH-26159)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:32:06 +01:00
Catherine Devlin b3ab4344d1
bpo-4928: Document NamedTemporaryFile non-deletion after SIGKILL (#26198)
* bpo-4928 Document NamedTemporaryFile non-deletion after SIGKILL

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-05-19 10:21:03 -04:00
Tal Einat 60d343a816
bpo-44010: IDLE: colorize pattern-matching soft keywords (GH-25851) 2021-05-19 12:18:10 +03:00
Erlend Egeberg Aasland d798acc873
bpo-44106: Purge unused sqlite3 doc includes (GH-26234) 2021-05-19 11:08:12 +03:00
Erlend Egeberg Aasland 92d1064727
bpo-44106: Improve sqlite3 example database contents (GH-26027) 2021-05-19 10:41:19 +03:00
Erlend Egeberg Aasland 9014437573
bpo-30593: Doc'ed that executescript() disregards isolation level (GH-26220) 2021-05-19 10:05:48 +03:00
Zackery Spytz 4fdcc39f71
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) 2021-05-18 14:56:01 -07:00
Jürgen Gmach 02ee819126
bpo-41963: document that ConfigParser strips off comments (GH-26197)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Laura Gutierrez Funderburk <58710704+lgfunderburk@users.noreply.github.com>
2021-05-18 18:11:23 +02:00
Raymond Hettinger b3f65e819f
Apply edits from Allen Downey's review of the linear_regression docs. (GH-26176) 2021-05-16 19:21:14 -07:00
Rafael Fontenelle fdc7e52f5f
[doc] Fix typo in os module (GH-24464)
Automerge-Triggered-By: GH:iritkatriel
2021-05-16 16:38:11 -07:00
Miguel Brito 086b5c6ce1
bpo-32133: Improve numbers docs (GH-26124) 2021-05-15 09:56:12 -07:00
Pablo Galindo c5b833046d
bpo-44139: Use a more descriptive syntax error comprehension case in the What's New for 3.10 (GH-26145) 2021-05-15 17:37:12 +01:00
Rory Yorke 4aa63d65a9
bpo-44072: fix Complex, Integral docs for `**` (GH-25986)
In numbers module docstrings and docs.
2021-05-14 18:01:48 -04:00
Erlend Egeberg Aasland 07797121cc
bpo-43729: Clarify comment in tutorial example (GH-25191) 2021-05-14 12:09:08 -07:00
Miguel Brito dc0b364de4
bpo-44095: Add suffix, stem and suffixes to zipfile.Path (GH-26129) 2021-05-14 10:57:36 -07:00
kudavid 2918846a4f
Subprocess Protocols Documentation (GH-20950)
Should be "Subprocess Protocol instances" not "Datagram Protocol instances"
2021-05-14 10:20:33 -07:00
Géry Ogam 19d839ae20
[doc] Fix typos in cgi.rst (#24766) 2021-05-14 18:09:01 +01:00
Daniel Shahaf fe175a87ad
Doc: Fix ambiguous pronoun (GH-26037) 2021-05-13 23:27:06 -07:00
josephernest 56b8ea65d2
Updated code example for asyncio.gather (GH-20604)
The previous example did not fully showcase the interest of using gather.

Here the example showcases "the result is an aggregate list of returned values".
2021-05-13 23:06:26 -07:00
Shantanu 65d180d983
bpo-38250: add version added for FlagBoundary (GH-25820)
* bpo-38250: add version added for FlagBoundary

* Also add versionadded for utilities

Co-authored-by: hauntsaninja <>
2021-05-13 22:59:53 -07:00
Saiyang Gou 3d4b5f1019
Update doc as relative import can be used with star import (GH-25667) 2021-05-13 22:37:19 -07:00
Ken Jin 53c91ac525
bpo-43977: Update pattern matching language reference docs (GH-25917)
* Update patma language reference with new changes to sequence and mapping

* update 3.10 whatsnew too
2021-05-13 22:31:28 -07:00
Petr Viktorin ddd30b2dd2
Reword paragraph on specific value for Py_LIMITED_API (GH-26101) 2021-05-13 22:22:44 -07:00
Erlend Egeberg Aasland a09fc9c63f
bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) 2021-05-13 15:44:55 -07:00
Barney Gale 366c69f3f6
bpo-39906: Document new follow_symlinks argument to pathlib.Path.stat() and chmod() in 3.10 whatsnew. (GH-26089) 2021-05-13 13:17:04 +01:00
Barney Gale d1560d2429
bpo-43757: Document os.path.realpath(strict=True) in 3.10 whatsnew. (GH-26090) 2021-05-13 13:14:45 +01:00
Miguel Brito 8ea350ee90
bpo-44030: Fix formatting error in exceptions docs (GH-25929) 2021-05-13 01:11:36 +01:00
Victor Stinner 6cd0446ef7
bpo-44113: Deprecate old functions to config Python init (GH-26060)
Deprecate the following functions to configure the Python
initialization:

* PySys_AddWarnOption()
* PySys_AddWarnOptionUnicode()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Use the new PyConfig API of the Python Initialization Configuration
instead (PEP 587).
2021-05-12 23:59:25 +02:00
Victor Stinner ff230153fd
bpo-44117: Add C API section to What's New in Python 3.11 (GH-26071)
Add also references to PyFrame_BlockPop() removal.
2021-05-12 18:46:29 +02:00
Mark Shannon 78b2abca8e
bpo-40222: Mention zero-cost exceptions in whats-new for 3.11 (GH-26021) 2021-05-12 11:31:48 +01:00
Irit Katriel 6574334a68
bpo-40640: doc -- add missing ... in example of Continue (#26055)
Co-authored-by: Chas Belov <59780179+ChasBelov@users.noreply.github.com>
2021-05-12 11:23:03 +01:00