Commit Graph

24456 Commits

Author SHA1 Message Date
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
Thomas Grainger c1df8808e0
Correct the changelog entry for the syntax error message for multiple exception types (GH-26038) 2021-05-12 00:22:50 +01:00
Irit Katriel 23ae2c3bac
bpo-10548: expectedFailure does not apply to fixtures (#23201) 2021-05-11 22:48:20 +01:00
uniocto 5f2eb87f28
bpo-23750: Document os-system, subprocess. Patch by Martin Panter. (GH-26016)
* Document os-system, subprocess Patch

* Update Doc/library/os.rst

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

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-11 13:47:05 -07:00
Irit Katriel 12e7d10dfd
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (#23192) 2021-05-11 18:55:24 +01:00
Petr Viktorin b05955d6f5
bpo-43795: PEP 652 user documentation (GH-25668)
- Reformat the C API and ABI Versioning page (and extend/clarify a bit)
- Rewrite the stable ABI docs into a general text on C API Compatibility
- Add a list of Limited API contents, and notes for the individual items. 
- Replace `Include/README.rst` with a link to a devguide page with the same info
2021-05-11 07:04:33 -07:00
Julien Palard d1b81574ed
Doc: http.server: directory is not a class attribute, but an argument. (GH-26017)
* Doc: http.server: directory is not a class attribute, but an argument.
2021-05-10 18:26:53 -07:00
dhoekstra2000 2a031723ee
bpo-43558: Add note about base class initialization to dataclasses doc (GH-25967) 2021-05-10 09:30:22 -04:00
Eric V. Smith 801497a115
Fix a word in dataclasses docs. (GH-26003) 2021-05-08 22:20:04 -04:00
Serhiy Storchaka a0bd9e9c11
bpo-28307: Convert simple C-style formatting with literal format into f-string. (GH-5012)
C-style formatting with literal format containing only format codes
%s, %r and %a (with optional width, precision and alignment)
will be converted to an equivalent f-string expression.

It can speed up formatting more than 2 times by eliminating
runtime parsing of the format string and creating temporary tuple.
2021-05-08 22:33:10 +03:00
Pablo Galindo 6692dc1ca9
bpo-43149: Correct the syntax error message for multiple exception types (GH-25996)
Automerge-Triggered-By: GH:pablogsal
2021-05-08 11:24:41 -07:00
Pablo Galindo 873275e64a
Update references to master to point to main in customsourcelink.html (GH-25993) 2021-05-08 17:13:24 +01:00
Batuhan Taskaya 17229ab4a2
bpo-42725: mention the changes on what's new (GH-25974) 2021-05-08 14:49:40 +03:00
Ned Deily 42fcad26a4
Fix the whatsnew/3.11.rst to link to the blurb-generated changelog. (GH-25979) 2021-05-07 23:25:37 -04:00
Pablo Galindo c40ab5b699
Update the SOURCE_URI in pyspecific.py to point to the new branch (GH-25977) 2021-05-08 03:43:23 +01:00
Mark Shannon adcd220556
bpo-40222: "Zero cost" exception handling (GH-25729)
"Zero cost" exception handling.

* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
2021-05-07 15:19:19 +01:00
Senthil Kumaran b32c8e9795
Simple Enhancement. Add missing return statements in ftplib documentation. (GH-25968) 2021-05-07 07:08:47 -07:00
Julien Palard a0cb2e4302
Doc: What's new in Python 3.11 (GH-25963) 2021-05-07 10:06:45 +02:00
Inada Naoki 9ad8f109ac
bpo-44029: Remove Py_UNICODE APIs (GH-25881)
Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`,
`PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`,
`PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`,
`PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`,
`PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`,
`PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`,
`PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`,
`PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`.

See :pep:`393` and :pep:`624` for reference.
2021-05-07 15:58:29 +09:00
Scott Noyes ee8e7c2fa9
Fix minor grammar problems in dataclasses documentation (GH-25948)
Some missing words; some odd word choices.
2021-05-06 17:52:46 -04:00
Tal Einat 92ceb1c840
docs: clearly document that ":#X" string formatting results in "0X..." (GH-25941)
* clearly document that ":#X" string formatting results in "0X..."

* put back the "serial comma"
2021-05-06 12:27:29 -07:00
Jean-Abou-Samra 09490298d4
Clarify rx parameter of compileall functions (#25857) 2021-05-04 21:37:39 +02:00
Roberto Hueso a0b9915a8b
bpo-32822: Add finally with return/break/continue to the tutorial (#25600)
This documents in the tutorial docs the behavior of a finally clause in
case it should re-raise an exception but contains a
return/break/continue statement.
2021-05-04 14:36:01 +02:00
krisaoe 33d9bf298b
Fix error in Enum documentation example code that was referring to the wrong enum. (#25837) 2021-05-04 14:34:14 +02:00
Jelle Zijlstra f6d7abc6e7
Copyedits to 3.10 What's New (#25787)
Co-authored-by: Dominic Davis-Foster <dominic@davis-foster.co.uk>
2021-05-04 11:19:23 +02:00
Terry Jan Reedy 3b200b2aa6
bpo-44025: Clarify when '_' is a keyword. (#25873)
In match statements, in case patterns and nowhere else.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 11:00:29 +02:00
Raymond Hettinger 70a071d9e1
bpo-40465: Remove random module features deprecated in 3.9 (GH-25874) 2021-05-04 10:55:40 +02:00
Jelle Zijlstra 87109f4d85
bpo-44001: improve Literal documentation (GH-25877) 2021-05-04 10:54:12 +02:00
Jelle Zijlstra 6fee0835cb
fix enum.property reference in docs (GH-25875) 2021-05-03 20:19:46 -07:00
Pablo Galindo bb3e0c240b
Python 3.11.0a0 2021-05-03 21:25:35 +01:00
Pablo Galindo c2931d31f8
bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) 2021-05-03 15:50:24 +01:00
Julien Palard 440c025726
Doc: Fix random.uniform example comment. (GH-25784) 2021-05-03 02:20:54 -07:00
Eric V. Smith 72720a2639
dataclasses docs: add a missing word. (GH-25839) 2021-05-03 02:33:34 -04:00
Eric V. Smith a21b3d2fa2
More clarification of kw_only args. (GH-25838)
Also, clarify that the dataclass decorator is what raises an error for some mutable defaults.
2021-05-03 01:55:13 -04:00
Raymond Hettinger 4ae828f3c0
Fix invalid markup (#25833) 2021-05-02 21:07:29 -07:00
Raymond Hettinger 8c598dbb94
bpo-25478: Add total() method to collections.Counter (GH-25829) 2021-05-02 20:19:51 -07:00
Tal Einat b43cc31a27
bpo-37903: IDLE: add shell sidebar mouse interactions (GH-25708)
Left click and drag to select lines.  With selection, right click for context menu with copy and copy-with-prompts.
Also add copy-with-prompts to the text-box context menu.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-02 22:27:38 -04:00
Eric V. Smith 821f0c8c39
More work on documenting dataclass keyword-only fields. (GH-25828) 2021-05-02 21:20:50 -04:00
Brandt Bucher 9387fac100
bpo-43977: Document the new pattern matching type flags (GH-25734) 2021-05-02 15:35:00 -07:00
Jason R. Coombs 37e0c7850d
bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)
* bpo-43926: Cleaner metadata with PEP 566 JSON support.

* Add blurb

* Add versionchanged and versionadded declarations for changes to metadata.

* Use descriptor for PEP 566
2021-05-02 17:03:40 -04:00
Brandt Bucher 0ad1e0384c
bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
Zackery Spytz 7d2b83e9f0
bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805)
Footnotes 5 and 6 were in the wrong order.
2021-05-02 10:29:15 -07:00
Shreyan Avigyan a5eabc9a39
bpo-43997: Add versionadded directives for to match_args, kw_only, and slots in dataclasses.dataclasses documentation (GH-25803) 2021-05-02 08:43:50 -07:00
Christian Heimes d8389e3e50
bpo-38820: Add ssl, hashlib, and hmac changes to whatsnew 3.10 (GH-25817)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-02 16:38:02 +02:00
Christian Heimes 60ce8f0be6
bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099)
Reverts commit e653d4d8e8 and makes
parsing even more strict. Like socket.inet_pton() any leading zero
is now treated as invalid input.

Signed-off-by: Christian Heimes <christian@python.org>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-05-02 14:00:35 +02:00
Inada Naoki fd0bc7e7f4
bpo-43733: netrc try to use UTF-8 before using locale encoding. (GH-25781) 2021-05-02 14:01:02 +09:00
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
Eric V. Smith 318ca1764c
Minor tweaks to dataclasses keyword-only fields documentation. (GH-25801) 2021-05-01 21:46:05 -04:00
Eric V. Smith 2f59a767bc
Improve the dataclasses kw_only documentation. (GH-25799) 2021-05-01 19:51:12 -04:00
Shreyash Sharma 779232413a
Fix exceptions mentioned in os.setxattr() docs (GH-25742) 2021-05-01 16:54:39 -04:00
Christian Heimes e983252b51
bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)
The ssl module now has more secure default settings. Ciphers without forward
secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits
weak RSA, DH, and ECC keys with less than 112 bits of security.
:class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2.
Settings are based on Hynek Schlawack's research.

```
$ openssl version
OpenSSL 1.1.1k  FIPS 25 Mar 2021
$ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM'
TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any      Au=any  Enc=CHACHA20/POLY1305(256) Mac=AEAD
TLS_AES_128_GCM_SHA256  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(128) Mac=AEAD
TLS_AES_128_CCM_SHA256  TLSv1.3 Kx=any      Au=any  Enc=AESCCM(128) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=RSA  Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AES(256)  Mac=SHA384
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(256)  Mac=SHA384
ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AES(128)  Mac=SHA256
ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AES(128)  Mac=SHA256
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES256-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(256)  Mac=SHA256
DHE-RSA-AES128-SHA256   TLSv1.2 Kx=DH       Au=RSA  Enc=AES(128)  Mac=SHA256
```

Signed-off-by: Christian Heimes <christian@python.org>
2021-05-01 20:53:10 +02:00
Shreyash Sharma 50c21ad353
Fixing doc for callback for lambda (GG-25779)
Fixing callback for lambda when no return value is provided
2021-05-01 14:24:10 -04:00
larryhastings 99f71aea5c
Noted my recent contributions in "What's New In Python 3.10". (#25771)
Noted my recent contributions in "What's New In Python 3.10".  Also made some edits clarifying "annotations" vs "type hints", and some other edits for correctness.
2021-04-30 22:55:21 -07:00
Yurii Karabas c24199184b
bpo-42269: Add slots parameter to dataclass decorator (GH-24171)
Add slots parameter to dataclass decorator and make_dataclass function.
2021-04-30 22:14:30 -04:00
Pablo Galindo 558df90109
bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the curses module (GH-25768) 2021-05-01 02:21:19 +01:00
Mohamed Moselhy e726a902b7
bpo-43971: Add spaces around annotated arg default '=' (GH-25702)
Result: "quantity_on_hand: int = 0".
2021-04-30 19:06:55 -04:00
JT e08c67372d
bpo-43928: Fix 'succesfully' typo in document (GH-25569) 2021-04-30 18:35:07 -04:00
Victor Stinner 3bb09947ec
bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)
Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow
creating type instances: set tp_new to NULL and don't create the
"__new__" key in the type dictionary.

The flag is set automatically on static types if tp_base is NULL or
&PyBaseObject_Type and tp_new is NULL.

Use the flag on the following types:

* _curses.ncurses_version type
* _curses_panel.panel
* _tkinter.Tcl_Obj
* _tkinter.tkapp
* _tkinter.tktimertoken
* _xxsubinterpretersmodule.ChannelID
* sys.flags type
* sys.getwindowsversion() type
* sys.version_info type

Update MyStr example in the C API documentation to use
Py_TPFLAGS_DISALLOW_INSTANTIATION.

Add _PyStructSequence_InitType() function to create a structseq type
with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set.

type_new() calls _PyType_CheckConsistency() at exit.
2021-04-30 12:46:15 +02:00
Zackery Spytz 2abbd8f2ad
bpo-43954: Fix a missing word in the unittest docs (GH-25672) 2021-04-30 09:32:19 +02:00
larryhastings 74613a46fc
bpo-43817: Add inspect.get_annotations(). (#25522)
Add inspect.get_annotations, which safely computes the annotations defined on an object.  It works around the quirks of accessing the annotations from various types of objects, and makes very few assumptions about the object passed in. inspect.get_annotations can also correctly un-stringize stringized annotations.

inspect.signature, inspect.from_callable, and inspect.from_function now call inspect.get_annotations to retrieve annotations.  This means inspect.signature and inspect.from_callable can now un-stringize stringized annotations, too.
2021-04-29 21:16:28 -07:00
Steve Dower 87655e2cf5
bpo-42800: Rename AUDIT_READ to PY_AUDIT_READ (GH-25736) 2021-04-30 01:08:55 +01: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
sblondon 2fd928c8c1
bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872)
Links for 'raise Exception from x' target to 'The raise statement' (7.8) section instead of 'The import statement' (7.11) section.

There are more modified links than in the bug report because I searched some other ones which can get the same improvement.
2021-04-29 11:02:40 -07:00
Senthil Kumaran 76cd81d603
bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. (GH-25595)
* issue43882 - urllib.parse should sanitize urls containing ASCII newline and tabs.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-04-29 10:16:50 -07:00
Victor Stinner abfd6388cd
bpo-43774: Enhance debug build documentation (GH-25712)
* Add also references to --with-trace-refs option.
* Move _ob_next and _ob_prev at the end, since they don't exist by
  default and are related to debug.
2021-04-29 13:06:59 +02:00
Petr Viktorin f6ee4dad58
bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315) 2021-04-29 11:33:14 +02:00
Victor Stinner 645ed62fb4
bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)
Enhance also the documentation of debug hooks on memory allocators.
2021-04-29 10:47:47 +02:00
Victor Stinner 5bd0619533
bpo-43908: Document Static Types in the C API (GH-25710)
Update also PyTypeObject structure definition in the doc.
2021-04-29 10:26:34 +02:00
Nick Coghlan 1e7b858575
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2021-04-28 22:58:44 -07:00
Inada Naoki e52ab42ced
bpo-41139: Deprecate `cgi.log()` (GH-25625) 2021-04-29 11:36:04 +09:00
Andre Delfino 69a733bda3
[doc] Be more clear on super() regarding multiple base classes methods (GH-21789) 2021-04-28 18:12:15 -07:00
Andre Delfino 08a4803863
[doc] Do some polishing in IDEs section (GH-22070) 2021-04-28 18:06:53 -07:00
Paul Moore b38b2fa021
Document importlib.metadata.PackagePath.locate method (GH-25669) 2021-04-28 19:27:37 -04:00
Erlend Egeberg Aasland 3b52c8d66b
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)
Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and
modify PyType_Ready() to set it for static types.

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-28 19:02:42 +02:00
scoder 3cc481b9de
bpo-28254: Add a C-API for controlling the GC state (GH-25687)
Add new C-API functions to control the state of the garbage collector:
PyGC_Enable(), PyGC_Disable(), PyGC_IsEnabled(),
corresponding to the functions in the gc module.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-28 18:12:16 +02:00
Barney Gale baecfbd849
bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264)
Also adds a new "strict" argument to realpath() to avoid changing the default behaviour of pathlib while sharing the implementation.
2021-04-28 16:50:17 +01:00
scoder 4c49be7668
bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)
Automerge-Triggered-By: GH:scoder
2021-04-28 07:03:19 -07:00
Ma Lin f9bedb630e
bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740)
Faster bz2/lzma/zlib via new output buffering.
Also adds .readall() function to _compression.DecompressReader class
to take best advantage of this in the consume-all-output at once scenario.

Often a 5-20% speedup in common scenarios due to less data copying.

Contributed by Ma Lin.
2021-04-27 23:58:54 -07:00
Inada Naoki 5c84bb506a
bpo-37751: Update `codecs.register()` doc. (GH-25643) 2021-04-28 09:37:02 +09:00
Ethan Furman 6bd9288b80
bpo-43957: [Enum] Deprecate ``TypeError`` from containment checks. (GH-25670)
In 3.12 ``True`` or ``False`` will be returned for all containment checks,
with ``True`` being returned if the value is either a member of that enum
or one of its members' value.
2021-04-27 13:05:08 -07:00
Ken Jin 99fdd78200
bpo-43766: Fix TypeGuard docs (#25660) 2021-04-27 08:55:08 -07:00
Ken Jin 05ab4b60ab
bpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py (#25282) 2021-04-27 07:31:04 -07:00
Tzu-ping Chung d92513390a
bpo-43312: Functions returning default and preferred sysconfig schemes (GH-24644) 2021-04-27 09:45:55 +01:00
Andre Delfino 743e2bae10
[doc] Remove duplicated operator.itemgetter example (GH-24178)
* Remove duplicated itemgetter example
* Add spaces
2021-04-26 21:15:31 -07:00
Erlend Egeberg Aasland 7244c0060d
bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246) 2021-04-27 00:16:46 +01:00
Andre Delfino 52cd6d5e1b
Use the zero argument form of super() in examples for Python3 docs. (GH-22314) 2021-04-26 15:13:54 -07:00
Llandy Riveron Del Risco 8a307e488d
bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) 2021-04-26 14:53:28 -04:00
Adorilson Bezerra bd25bcd37a
Doc: Fix the array.fromfile method doc (GH-22037)
The check about the f argument type was removed in this commit:
2c94aa567e

Thanks for Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) by the help with
this bug.
2021-04-26 07:19:21 -07:00
Gabriel R F 3c4850e222
Update asyncio-subprocess.rst (GH-21680) 2021-04-25 21:38:16 -07:00
Etienne Gautier b6daab2f67
documentation: clarification about the function remove in os library (GH-19024) 2021-04-25 21:21:50 -07:00
Taneli Hukkinen 7be870f945
Fix documentation typos of argparse exit_on_error (GH-22706) 2021-04-25 21:04:26 -07:00
Denis Laxalde cb5c802dcf
Fix id of 'Internet Message Format' RFC in email doc (GH-24137)
Previous ID (5233) refers to "Sieve Email Filtering: Subaddress
Extension". It seems that the actual reference should be "Internet
Message Format" RFC 5322 (https://tools.ietf.org/html/rfc5322).

(The typo probably comes from commit 29d1bc0842 in which the ID of
this RFC got updated from the obsolete 2822.)

Co-authored-by: Ambrose Chua <ambrose@hey.com>
2021-04-25 18:38:12 -07:00
Andre Delfino 0d930f108c
Fix copy.Error casing in documentation GH-22004 2021-04-25 18:22:28 -07:00
Andre Delfino d28b346953
Fix broken links and improve stand-alone tools list in FAQ GH-22124 2021-04-25 18:10:05 -07:00
Eric V. Smith c0280532dc
Add keyword-only fields to dataclasses. (GH=25608) 2021-04-25 20:42:39 -04:00
Sergey Fedoseev 7f8e072c6d
Remove mention of dst parameter from description of os.lstat() (GH-24704)
It looks like it was accidentally copy-pasted in 
6fa7aada9b.
2021-04-25 14:24:41 -07:00
Géry Ogam a1a5e3c4c8
Fix a typo in datamodel reference document (GH-24930) 2021-04-25 14:13:19 -07:00
Saiyang Gou f84f1b5c63
bpo-38605: Update __future__ module doc as `annotations` is now "mandatory in 3.11" (GH-25602) 2021-04-25 12:49:26 -07:00
Senthil Kumaran a89d8a94a0
BaseHTTPRequestHandler, that path includes query (#25597)
* Clarify, for BaseHTTPRequestHandler, that path includes query

Co-authored-by: David Jones <drj@pobox.com>
2021-04-25 10:08:29 -07:00
Tymoteusz Wołodźko 09aa6f914d
bpo-38490: statistics: Add covariance, Pearson's correlation, and simple linear regression (#16813)
Co-authored-by: Tymoteusz Wołodźko <twolodzko+gitkraken@gmail.com
2021-04-25 14:45:09 +03:00
Serhiy Storchaka 172c0f2752
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)
asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().
2021-04-25 13:40:44 +03:00
Batuhan Taskaya 8cc3cfa8af
bpo-42737: annotations with complex targets no longer causes any runtime effects (GH-23952) 2021-04-25 05:31:20 +03:00
Zackery Spytz b2fac1afaa
bpo-31870: Add a timeout parameter to ssl.get_server_certificate() (GH-22270) 2021-04-23 21:46:01 -07:00
Barney Gale f24e2e5464
bpo-39950: add `pathlib.Path.hardlink_to()` method that supersedes `link_to()` (GH-18909)
The argument order of `link_to()` is reversed compared to what one may expect, so:

    a.link_to(b)

Might be expected to create *a* as a link to *b*, in fact it creates *b* as a link to *a*, making it function more like a "link from". This doesn't match `symlink_to()` nor the documentation and doesn't seem to be the original author's intent.

This PR deprecates `link_to()` and introduces `hardlink_to()`, which has the same argument order as `symlink_to()`.
2021-04-23 13:48:52 -07:00
Steve Dower 019e9e8168
bpo-43538: Add extra arguments to os.startfile (GH-25538) 2021-04-23 18:03:17 +01:00
Pablo Galindo a77aac4fca
bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525)
To improve the user experience understanding what part of the error messages associated with SyntaxErrors is wrong, we can highlight the whole error range and not only place the caret at the first character. In this way:

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^
SyntaxError: Generator expression must be parenthesized

becomes

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Generator expression must be parenthesized
2021-04-23 14:27:05 +01:00
Petr Viktorin 91b69b77cf
bpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (GH-25442)
The inclusion of PyOS_ReadlineFunctionPointer in python3dll.c was a mistake.

According to PEP 384:
> functions expecting FILE* are not part of the ABI, to avoid depending
> on a specific version of the Microsoft C runtime DLL on Windows.

https://bugs.python.org/issue43868
2021-04-23 14:23:38 +02:00
Petr Viktorin 9d6a2d0ee7
bpo-43795: PEP-652: Clean up the stable ABI/limited API (GH-25482)
- `_Py_EncodeLocaleRaw`, which is private by name, undocumented,
  and wasn't exported in `python3.dll`, is moved to a private header.
- `_Py_HashSecret_Initialized`, again private by name, undocumented,
  and not exported in `python3.dll`, is excluded with `Py_LIMITED_API`.
- `PyMarshal_*` and `PyMember_*One` functions, declared in private headers and
  not exported in `python3.dll`, are removed from `Doc/data/stable_abi.dat`.
- `PyMem_Calloc` which *was* exported in `python3dll.c`, is moved to public
  headers where it joins its other `PyMem_*` friends.

Only the last change is documented in the blurb; others are not user-visible.
(Nothing uses `Doc/data/stable_abi.dat` yet.)


https://bugs.python.org/issue43795
2021-04-23 14:17:58 +02:00
Lumír 'Frenzy' Balhar 90d02e5e63
bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation of the PEP) (GH-23142)
This change:
* merges `distutils.sysconfig` into `sysconfig` while keeping the original functionality and
* marks `distutils.sysconfig` as deprecated

https://bugs.python.org/issue41282
2021-04-23 14:02:41 +02:00
Saiyang Gou 927b841c21
bpo-37363: Add audit events to the `http.client` module (GH-21321)
Add audit events to the `http.client` module

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-04-23 12:19:08 +02:00
Hai Shi 32980fb669
bpo-37751: Document codecs.lookup() change in What's New in Python 3.9 (GH-23096) 2021-04-23 11:10:43 +02:00
Raymond Hettinger fe24088293
Add more tests. Fix code excerpt. (GH-25549) 2021-04-22 20:02:46 -07:00
Raymond Hettinger 14092b5a4a
bpo-43917: Fix pure python equivalent for classmethod (GH-25544)
Reported by Yahor Harunovich.
2021-04-22 17:53:36 -07:00
Shreyan Avigyan 2a3f4899c6
bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsversion() (GH-25500)
The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version.
Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part).
sys.getwindowsversion() is not updated to avoid launching executables from that module.
2021-04-22 17:43:37 +01:00
Raymond Hettinger a07da09ad5
bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493) 2021-04-22 08:34:57 -07:00
Saiyang Gou 660592f67c
bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH-22608) 2021-04-22 13:08:46 +09:00
Saiyang Gou a32f8fe713
bpo-43756: Add new audit event for new arguments added to glob.glob (GH-25239) 2021-04-21 23:42:55 +01:00
Steve Dower 7b86e47617
bpo-43472: Ensure PyInterpreterState_New audit events are raised when called through _xxsubinterpreters module (GH-25506) 2021-04-21 23:34:29 +01:00
Batuhan Taskaya 81fe01492c
doc: Sync some missing 3.10 changes with the What's New (GH-25503)
Automerge-Triggered-By: GH:isidentical
2021-04-21 13:44:27 -07:00
JunWei Song 18e0d32804
Fix typo in whatsnew/3.10.rst (GH-25498) 2021-04-21 18:34:05 +01:00
Ethan Furman a02cb474f9
bpo-38659: [Enum] add _simple_enum decorator (GH-25497)
add:

* `_simple_enum` decorator to transform a normal class into an enum
* `_test_simple_enum` function to compare
* `_old_convert_` to enable checking `_convert_` generated enums

`_simple_enum` takes a normal class and converts it into an enum:

    @simple_enum(Enum)
    class Color:
        RED = 1
        GREEN = 2
        BLUE = 3

`_old_convert_` works much like` _convert_` does, using the original logic:

    # in a test file
    import socket, enum
    CheckedAddressFamily = enum._old_convert_(
            enum.IntEnum, 'AddressFamily', 'socket',
            lambda C: C.isupper() and C.startswith('AF_'),
            source=_socket,
            )

`_test_simple_enum` takes a traditional enum and a simple enum and
compares the two:

    # in the REPL or the same module as Color
    class CheckedColor(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3

    _test_simple_enum(CheckedColor, Color)

    _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError
2021-04-21 10:20:44 -07:00
Pablo Galindo 56c95dfe27
bpo-43859: Improve the error message for IndentationError exceptions (GH-25431) 2021-04-21 15:28:21 +01:00
Pablo Galindo b0544ba77c
bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490)
This reverts commits 044a1048ca and 1be456ae9d, adapting the code to changes that happened after it.
2021-04-21 12:41:19 +01:00
Géry Ogam d35eef3b90
Update Sphinx directive for super from function to class (GH-25489) 2021-04-20 11:58:02 -07:00
Ned Batchelder b2b6cd00c6
docs: clarify what patterns Path.glob accepts (GH-25486)
Automerge-Triggered-By: GH:Yhg1s
2021-04-20 09:45:45 -07:00
Joonas Paalasmaa 389212c5db
Document that random.gauss is normal distribution (GH-24935) 2021-04-20 07:33:54 -07:00
Ethan Furman 503cdc7c12
Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)
This reverts commit dbac8f40e8.
2021-04-19 19:12:24 -07:00
Ethan Furman dbac8f40e8
bpo-38659: [Enum] add _simple_enum decorator (GH-25285)
add:

_simple_enum decorator to transform a normal class into an enum
_test_simple_enum function to compare
_old_convert_ to enable checking _convert_ generated enums
_simple_enum takes a normal class and converts it into an enum:

@simple_enum(Enum)
class Color:
    RED = 1
    GREEN = 2
    BLUE = 3

_old_convert_ works much like _convert_ does, using the original logic:

# in a test file
import socket, enum
CheckedAddressFamily = enum._old_convert_(
        enum.IntEnum, 'AddressFamily', 'socket',
        lambda C: C.isupper() and C.startswith('AF_'),
        source=_socket,
        )

test_simple_enum takes a traditional enum and a simple enum and
compares the two:

# in the REPL or the same module as Color
class CheckedColor(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3

_test_simple_enum(CheckedColor, Color)

_test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError
2021-04-19 18:04:53 -07:00
Raymond Hettinger 4f9ffa8f9c
Add doctests (GH-25474) 2021-04-19 14:12:36 -07:00
Ammar Askar 68ba0c67ca
bpo-43837: Reverse order of precedence table to show tightly binding operators first (GH-25469) 2021-04-19 08:22:03 -07:00
l0x 64d975202f
bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag (GH-20463)
This short PR exposes an openssl flag that  wasn't exposed. I've also updated to doc to reflect the change. It's heavily inspired by 990fcaac3c.
2021-04-19 04:51:18 -07:00
Christian Heimes 2875c603b2
bpo-43880: Show DeprecationWarnings for deprecated ssl module features (GH-25455)
* ssl.OP_NO_SSLv2
* ssl.OP_NO_SSLv3
* ssl.OP_NO_TLSv1
* ssl.OP_NO_TLSv1_1
* ssl.OP_NO_TLSv1_2
* ssl.OP_NO_TLSv1_3
* ssl.PROTOCOL_SSLv2
* ssl.PROTOCOL_SSLv3
* ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS)
* ssl.PROTOCOL_TLS
* ssl.PROTOCOL_TLSv1
* ssl.PROTOCOL_TLSv1_1
* ssl.PROTOCOL_TLSv1_2
* ssl.TLSVersion.SSLv3
* ssl.TLSVersion.TLSv1
* ssl.TLSVersion.TLSv1_1
* ssl.wrap_socket()
* ssl.RAND_pseudo_bytes()
* ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1)
* ssl.SSLContext() without a protocol argument
* ssl.match_hostname()
* hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL
  function will stay)

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-19 07:27:10 +02:00
Christian Heimes 89d1550d14
bpo-42854: Use SSL_read/write_ex() (GH-25468)
The ssl module now uses ``SSL_read_ex`` and ``SSL_write_ex``
internally. The functions support reading and writing of data larger
than 2 GB. Writing zero-length data no longer fails with a protocol
violation error.

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-19 06:55:30 +02:00
Illia Volochii 2798f247c0
bpo-43641: Stop stating that TLS 1.2 is the most modern version in docs (GH-25041)
Automerge-Triggered-By: GH:tiran
2021-04-18 00:10:53 -07:00
Pablo Galindo f5c5c0c362
Fix type group capture in the PEG highlight tool (GH-25464) 2021-04-18 00:18:13 +01:00
Pablo Galindo 8bf274a500
Small changes to the section about SyntaxErrors in the 3.10 What's New document (GH-25461) 2021-04-17 22:41:46 +01:00
Christian Heimes b8d0fa035d
bpo-43669: Remove OpenSSL 0.9 to 1.1.0 specific documentation (GH-25453) 2021-04-17 15:49:50 +02:00
andrei kulakov ea39f82b97
Fix a typo in subprocess documentation (GH-25426)
Fix a typo per conversation with vstinner on IRC: in posix => on posix.
2021-04-17 11:59:18 +02:00
Christian Heimes 39258d3595
bpo-43669: PEP 644: Require OpenSSL 1.1.1 or newer (GH-23014)
- Remove HAVE_X509_VERIFY_PARAM_SET1_HOST check
- Update hashopenssl to require OpenSSL 1.1.1
- multissltests only OpenSSL > 1.1.0
- ALPN is always supported
- SNI is always supported
- Remove deprecated NPN code. Python wrappers are no-op.
- ECDH is always supported
- Remove OPENSSL_VERSION_1_1 macro
- Remove locking callbacks
- Drop PY_OPENSSL_1_1_API macro
- Drop HAVE_SSL_CTX_CLEAR_OPTIONS macro
- SSL_CTRL_GET_MAX_PROTO_VERSION is always defined now
- security level is always available now
- get_num_tickets is available with TLS 1.3
- X509_V_ERR MISMATCH is always available now
- Always set SSL_MODE_RELEASE_BUFFERS
- X509_V_FLAG_TRUSTED_FIRST is always available
- get_ciphers is always supported
- SSL_CTX_set_keylog_callback is always available
- Update Modules/Setup with static link example
- Mention PEP in whatsnew
- Drop 1.0.2 and 1.1.0 from GHA tests
2021-04-17 11:36:35 +02:00
Christian Heimes b467d9a240
bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899)
Fix problem with ssl.SSLContext.hostname_checks_common_name. OpenSSL does not
copy hostflags from *struct SSL_CTX* to *struct SSL*.

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-17 10:07:19 +02:00
Ikko Ashimine cfaa2d338b
Fix typo in exceptions.rst (GH-25434)
attemps -> attempts
2021-04-17 12:02:53 +05:30
Zackery Spytz adf24bd835
bpo-43856: Add a versionadded directive to the importlib.metadata docs (GH-25445)
Use a versionadded directive to generate the text "New in version
3.8." (to match with the documentation of other modules).

Automerge-Triggered-By: GH:jaraco
2021-04-16 16:13:38 -07:00
Victor Stinner 62ec638648
bpo-43862: Enhance -W cmdline option documentation (GH-25439)
The -W format is "action:message:category:module:lineno".

Update also the Python manual page.
2021-04-16 19:12:14 +02:00
Pablo Galindo ff3d9c0f1a
Improve the section with SyntaxError message improvements to the What's New of 3.10 (GH-25428) 2021-04-16 01:28:48 +01:00
Pablo Galindo b280248be8
bpo-43822: Improve syntax errors for missing commas (GH-25377) 2021-04-15 21:38:45 +01:00
Jason R. Coombs 23acadcc1c
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415)
Automerge-Triggered-By: GH:jaraco
2021-04-14 17:56:21 -07:00
Zackery Spytz 0c4c436325
Fix typo in 3.10's What's New documentation (GH-25409)
"occured" ->  "occurred"
2021-04-14 09:16:11 -07:00
Pablo Galindo 5bf8bf2267
bpo-38530: Offer suggestions on NameError (GH-25397)
When printing NameError raised by the interpreter, PyErr_Display
will offer suggestions of simmilar variable names in the function that the exception
was raised from:

    >>> schwarzschild_black_hole = None
    >>> schwarschild_black_hole
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'schwarschild_black_hole' is not defined. Did you mean: schwarzschild_black_hole?
2021-04-14 15:10:33 +01:00
Pablo Galindo c4073a24f9
Fix typo in the What's New for 3.10 (GH-25396) 2021-04-14 14:16:47 +01:00
Erlend Egeberg Aasland 3386ca0b36
bpo-20364: Improve sqlite3 placeholder docs (GH-25003) 2021-04-14 15:28:55 +03:00
Inada Naoki 333d10cbb5
bpo-43712 : fileinput: Add encoding parameter (GH-25272) 2021-04-14 14:12:58 +09:00
Bob Kline 133705b85c
bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) 2021-04-14 14:09:32 +09:00