Commit graph

109538 commits

Author SHA1 Message Date
Pablo Galindo d9151cb453
Ensure that early = are not matched by the parser as invalid comparisons (GH-25375) 2021-04-13 02:32:33 +01:00
Eric V. Smith c1a66bdd6f
Remove an unnecessary copy of the 'namespace' parameter to make_dataclass(). (GH-25372) 2021-04-12 21:02:02 -04:00
Victor Stinner 85918e4ab6
bpo-43774: Add more links to configure options (GH-25363) 2021-04-12 23:27:35 +02:00
Pablo Galindo 20ac34772a
Fix Sphinx errors in the documentation and re-activate the suspicious check (GH-25368)
The suspicious check is still executed as part of the release process and release managers have been
lately fixing some actual errors that the suspicious target can find. For this reason, reactivate the suspicious
until we decide what to do in a coordinated fashion.
2021-04-12 20:53:15 +01:00
Karthikeyan Singaravelan a9cf69df2e
bpo-41515: Fix KeyError raised in get_type_hints (GH-25352)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: efahl <36704995+efahl@users.noreply.github.com>
2021-04-12 11:17:25 -07:00
Ken Jin 852150ddfe
bpo-42904: Fix get_type_hints for class local namespaces (GH-24201) 2021-04-12 10:23:12 -07:00
Ken Jin 37a5e22023
Use double quotes over single quotes for match statement grammar (GH-24943) 2021-04-12 10:03:20 -07:00
Pablo Galindo b86ed8e3bb
bpo-43797: Improve syntax error for invalid comparisons (#25317)
* bpo-43797: Improve syntax error for invalid comparisons

* Update Lib/test/test_fstring.py

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>

* Apply review comments

* can't -> cannot

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2021-04-12 16:59:30 +01:00
Victor Stinner 2459b92a4d
bpo-43774: Remove --without-cycle-gc doc (GH-25364)
The configure --without-cycle-gc option has been removed in Python
2.3 by the commit cccd1e7248. It's now
time to remove the last reference to it in the documentation.
2021-04-12 16:58:45 +01:00
Ethan Furman 8c14f5a787
bpo-42248: [Enum] ensure exceptions raised in `_missing_` are released (GH-25350) 2021-04-12 08:51:20 -07:00
Zackery Spytz 67c0b3d89c
bpo-41661: Document os.path.relpath() exception on Windows with different drives (GH-25346) 2021-04-12 16:39:31 +01:00
Cédric Krier e126547c07
bpo-34311: Add locale.localize (GH-15275)
* Add method localize to the locale module
* Update the documentation of the locale module
2021-04-12 14:17:40 +02:00
Christian Heimes 95bbb331ec
bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361) 2021-04-12 13:12:36 +02:00
Christian Heimes 3447750073
bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355)
Signed-off-by: Christian Heimes <christian@python.org>
2021-04-12 12:00:38 +02:00
Chris Withers 06e971fc0e
try and get a peak at mock-related PRs before they land (#25356) 2021-04-12 10:44:42 +01:00
Victor Stinner 77d668b122
bpo-43680: _pyio.open() becomes a static method (GH-25354)
The Python _pyio.open() function becomes a static method to behave as
io.open() built-in function: don't become a bound method when stored
as a class variable. It becomes possible since static methods are now
callable in Python 3.10. Moreover, _pyio.OpenWrapper becomes a simple
alias to _pyio.open.

init_set_builtins_open() now sets builtins.open to io.open, rather
than setting it to io.OpenWrapper, since OpenWrapper is now an alias
to open in the io and _pyio modules.
2021-04-12 10:44:53 +02:00
Jelle Zijlstra 9825bdfbd5
bpo-43723: Deprecate camelCase aliases from threading (GH-25174)
The snake_case names have existed since Python 2.6, so there is
no reason to keep the old camelCase names around. One similar
method, threading.Thread.isAlive, was already removed in
Python 3.9 (bpo-37804).
2021-04-12 10:42:53 +02:00
Inada Naoki cc2ffcdfd7
bpo-43785: Improve BZ2File performance by removing RLock (GH-25299)
Remove `RLock` from `BZ2File`. It makes `BZ2File` to thread unsafe, but
gzip and lzma don't use it too.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-04-12 14:46:53 +09:00
Victor Stinner 553ee2781a
bpo-43682: Make staticmethod objects callable (GH-25117)
Static methods (@staticmethod) are now callable as regular functions.
2021-04-12 00:21:22 +02:00
Victor Stinner 53114ffef1
bpo-43770: Refactor PyType_Ready() function (GH-25336)
* Split PyType_Ready() into sub-functions.
* type_ready_mro() now checks if bases are static types earlier.
* Check tp_name earlier, in type_ready_checks().
* Add _PyType_IsReady() macro to check if a type is ready.
2021-04-11 23:57:09 +02:00
Ken Jin b38601d496
bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818)
* coerce bytes separator to string

* Add news

* Update Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst
2021-04-11 06:26:09 -07:00
Sergey B Kirpichev 63bf1abfdc
Fix typo in 3.10.0a7.rst (GH-25340) 2021-04-11 09:50:42 +01:00
Mark Dickinson 79650d0118
Fix description of behaviour of an exception class in 'from' clause (GH-24303) 2021-04-11 09:33:59 +01:00
Dennis Sweeney dfb45323ce
bpo-43751: Fix anext() bug where it erroneously returned None (GH-25238) 2021-04-11 05:51:35 +01:00
Jelle Zijlstra 9045919bfa
bpo-43772: Fix TypeVar.__ror__ (GH-25339) 2021-04-10 20:00:05 -07:00
Jelle Zijlstra 522433601a
bpo-43783: Add ParamSpecArgs/Kwargs (GH-25298) 2021-04-10 19:57:05 -07:00
Eric V. Smith 750f484752
bpo-43764: Add match_args=False parameter to dataclass decorator and to make_dataclasses function. (GH-25337)
Add match_args=False parameter to dataclass decorator and to make_dataclass function.
2021-04-10 21:28:42 -04:00
Antti Haapala c3a478b7e5
Fix typo about line number in the 3.10 What's New document (GH-25328)
This was a typo copied from PEP 626.
2021-04-11 01:20:41 +01:00
DevilXD ac05f82ad4
bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)
(The deleted example no longer works and is thus irrelevant.)
2021-04-10 15:36:40 -07:00
Victor Stinner 09bbebea16
bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)
Add the Py_Is(x, y) function to test if the 'x' object is the 'y'
object, the same as "x is y" in Python. Add also the Py_IsNone(),
Py_IsTrue(), Py_IsFalse() functions to test if an object is,
respectively, the None singleton, the True singleton or the False
singleton.
2021-04-11 00:17:39 +02:00
Pablo Galindo 6e468cb16b
bpo-43478: Fix formatting of NEWS entry (GH-25335) 2021-04-10 22:19:02 +01:00
Victor Stinner ecf14e6557
bpo-43770: Refactor type_new() function (GH-25325)
* Split type_new() into into many small functions.
* Add type_new_ctx structure to pass variables between subfunctions.
* Initialize some PyTypeObject and PyHeapTypeObject members earlier
  in type_new_alloc().
* Rename variables to more specific names.
* Add "__weakref__" identifier for type_new_visit_slots().
* Factorize code to convert a method to a classmethod
  (__init_subclass__ and __class_getitem__).
* Add braces to respect PEP 7.
* Move variable declarations where the variables are initialized.
2021-04-10 23:15:32 +02:00
Matthew Suozzo 75a06f067b
bpo-43798: Add source location attributes to alias (GH-25324)
* Add source location attributes to alias.
* Move alias star construction to pegen helper.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-04-10 22:56:28 +02:00
Gregory P. Smith e05a703848
bpo-40701: doc typo historcal -> historical (GH-25334) 2021-04-10 10:55:14 -07:00
Shreyan Avigyan ea9b2d6319
bpo-43739: Add type declaration Doc/extending/extending.rst example 2021-04-10 08:54:32 -07:00
Matthew Suozzo dccdc500f9
bpo-43478: Restrict use of Mock objects as specs (GH-25326)
* Restrict using Mock objects as specs as this is always a test bug where the resulting mock is misleadingly useless.
* Skip a broken test that exposes a bug elsewhere in mock (noted in the original issue).
2021-04-09 20:45:50 -07:00
Barney Gale ba1db57198
bpo-39899: Don't double-check directory name if we're requesting the current user's home directory in ntpath.expanduser() (GH-25277) 2021-04-09 22:28:15 +01:00
Barney Gale 11c3bd3f6d
bpo-40107: Switch to using io.open() for pathlib.Path.open() (GH-25240)
Previously we had identical behaviour but only allowed accessors to override os.open(). This change allows the override to also construct the IO wrapper as well.
2021-04-09 21:52:49 +01:00
Christian Heimes 2d7fdc9073
bpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319)
ripemd160 is not available in OpenSSL 3.0.0's default crypto provider.
It's only present in legacy provider.

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-09 22:23:10 +02:00
Christian Heimes 6f37ebc61e
bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309)
Signed-off-by: Christian Heimes <christian@python.org>
2021-04-09 17:59:21 +02:00
Victor Stinner 507a574de3
bpo-43682: @staticmethod inherits attributes (GH-25268)
Static methods (@staticmethod) and class methods (@classmethod) now
inherit the method attributes (__module__, __name__, __qualname__,
__doc__, __annotations__) and have a new __wrapped__ attribute.

Changes:

* Add a repr() method to staticmethod and classmethod types.
* Add tests on the @classmethod decorator.
2021-04-09 17:51:22 +02:00
Christian Heimes 150af75432
bpo-43788: Generate version specific _ssl_data.h (GH-25300)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2021-04-09 08:02:00 -07:00
Christian Heimes 5151d64200
bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304)
Signed-off-by: Christian Heimes <christian@python.org>
2021-04-09 15:43:06 +02:00
Christian Heimes d3b73f32ef
bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303) 2021-04-09 15:23:38 +02:00
Victor Stinner bd88ccb943
bpo-43774: Document the Python Build System (GH-25302)
* Elaborate PGO and LTO documentaton.
* Document MAINCC, PURIFY and LINKCC variables.
2021-04-09 14:35:10 +02:00
Victor Stinner f7be26a8f2
bpo-43774: Doc job of Azure Pipelines uses Doc/requirements.txt (GH-25296)
Don't hardcode the Sphinx version but use Doc/requirements.txt.
2021-04-09 03:36:47 -07:00
Pablo Galindo d00a449d6d
Simplify _PyPegen_fill_token in pegen.c (GH-25295) 2021-04-09 01:32:25 +01:00
Pablo Galindo 58bafe42ab
Sanitize macros and debug functions in pegen.c (GH-25291) 2021-04-09 01:17:31 +01:00
Victor Stinner 5436695363
bpo-43774: Enhance configure documentation (GH-25293) 2021-04-09 01:58:20 +02:00
Pablo Galindo 4f642dae4e
Break down some complex functions in pegen.c for readability (GH-25292) 2021-04-09 00:48:53 +01:00