]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-41979: Accept star-unpacking on with-item targets (GH-22611)
Batuhan Taskaya [Fri, 9 Oct 2020 09:56:48 +0000 (12:56 +0300)] 
bpo-41979: Accept star-unpacking on with-item targets (GH-22611)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoUpdated README for python 3.10 (GH-22605)
Nishit [Fri, 9 Oct 2020 09:32:15 +0000 (15:02 +0530)] 
Updated README for python 3.10 (GH-22605)

Updated python version and link to the release schedule

5 years agoFix the attribute names in the docstring of GenericAlias (GH-22594)
Mikhail Golubev [Thu, 8 Oct 2020 21:38:36 +0000 (00:38 +0300)] 
Fix the attribute names in the docstring of GenericAlias (GH-22594)

5 years agobpo-39337: Add a test case for normalizing of codec names (GH-19069)
Hai Shi [Thu, 8 Oct 2020 19:20:57 +0000 (03:20 +0800)] 
bpo-39337: Add a test case for normalizing of codec names (GH-19069)

5 years agobpo-41557: Update Windows installer to use SQLite 3.33.0 (GH-21960)
Erlend Egeberg Aasland [Thu, 8 Oct 2020 18:40:27 +0000 (20:40 +0200)] 
bpo-41557: Update Windows installer to use SQLite 3.33.0 (GH-21960)

5 years agobpo-41976: Fix the fallback to gcc of ctypes.util.find_library when using gcc>9 ...
Pablo Galindo [Thu, 8 Oct 2020 18:31:19 +0000 (19:31 +0100)] 
bpo-41976: Fix the fallback to gcc of ctypes.util.find_library when using gcc>9 (GH-22598)

5 years agobpo-41306: Allow scale value to not be rounded (GH-21715)
E-Paine [Thu, 8 Oct 2020 13:30:13 +0000 (14:30 +0100)] 
bpo-41306: Allow scale value to not be rounded (GH-21715)

This fixes the test failure with Tk 6.8.10 which is caused by changes to how Tk rounds the `from`, `to` and `tickinterval` arguments. This PR uses `noconv` if the patchlevel is greater than or equal to 8.6.10 (credit to Serhiy for this idea as it is much simpler than what I previously proposed).

Going into more detail for those who want it, the Tk change was made in [commit 591f68c](https://github.com/tcltk/tk/commit/591f68cb382525b72664c6fecaab87742b6cc87a) and means that the arguments listed above are rounded relative to the value of `from`. However, when rounding the `from` argument ([line 623](https://github.com/tcltk/tk/blob/591f68cb382525b72664c6fecaab87742b6cc87a/generic/tkScale.c#L623)), it is rounded relative to itself (i.e. rounding `0`) and therefore the assigned value for `from` is always what is given (no matter what values of `from` and `resolution`).

Automerge-Triggered-By: @pablogsal
5 years agobpo-41970: Avoid test failure in test_lib2to3 if the module is already imported ...
Pablo Galindo [Thu, 8 Oct 2020 13:24:28 +0000 (14:24 +0100)] 
bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported (GH-22595)



Automerge-Triggered-By: @pablogsal
5 years agobpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
Phil Elson [Thu, 8 Oct 2020 06:37:46 +0000 (08:37 +0200)] 
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)

`site.getusersitepackages()` returns the location of the user-specific site-packages directory
even when the user-specific site-packages is disabled.

```
$ python -s -m site
sys.path = [
    '/home/user/conda/lib/python37.zip',
    '/home/user/conda/lib/python3.7',
    '/home/user/conda/lib/python3.7/lib-dynload',
    '/home/user/conda/lib/python3.7/site-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
```

It was not practical to prevent the function from returning None if user-specific site-packages are disabled, since there are other uses of the function which are relying on this behaviour (e.g. `python -m site`).

5 years agoRevert "bpo-26680: Incorporate is_integer in all built-in and standard library numeri...
Raymond Hettinger [Wed, 7 Oct 2020 23:43:44 +0000 (16:43 -0700)] 
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)

This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.

5 years agobpo-41923: PEP 613: Add TypeAlias to typing module (#22532)
Mikhail Golubev [Wed, 7 Oct 2020 21:44:31 +0000 (00:44 +0300)] 
bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)

This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.

5 years agoFix comment about PyObject_IsTrue. (GH-22343)
Stefan Pochmann [Wed, 7 Oct 2020 14:12:52 +0000 (16:12 +0200)] 
Fix comment about PyObject_IsTrue. (GH-22343)

The `for` statement doesn't use a condition and this function, the `while` statement does.

5 years agobpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
Batuhan Taskaya [Tue, 6 Oct 2020 20:03:02 +0000 (23:03 +0300)] 
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)

The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.

For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).

5 years agobpo-41905: Add abc.update_abstractmethods() (GH-22485)
Ben Avrahami [Tue, 6 Oct 2020 17:40:50 +0000 (20:40 +0300)] 
bpo-41905: Add abc.update_abstractmethods() (GH-22485)

This function recomputes `cls.__abstractmethods__`.
Also update `@dataclass` to use it.

5 years agobpo-41944: No longer call eval() on content received via HTTP in the UnicodeNames...
Florian Bruhin [Tue, 6 Oct 2020 14:21:56 +0000 (16:21 +0200)] 
bpo-41944: No longer call eval() on content received via HTTP in the UnicodeNames tests (GH-22575)

Similarly to GH-22566, those tests called eval() on content received via
HTTP in test_named_sequences_full. This likely isn't exploitable because
unicodedata.lookup(seqname) is called before self.checkletter(seqname,
None) - thus any string which isn't a valid unicode character name
wouldn't ever reach the checkletter method.

Still, it's probably better to be safe than sorry.

5 years agobpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests...
Serhiy Storchaka [Tue, 6 Oct 2020 12:14:51 +0000 (15:14 +0300)] 
bpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests (GH-22566)

5 years agoPost 3.10.0a1
Pablo Galindo [Mon, 5 Oct 2020 20:16:35 +0000 (21:16 +0100)] 
Post 3.10.0a1

5 years agoPython 3.10.0a1 v3.10.0a1
Pablo Galindo [Mon, 5 Oct 2020 17:24:54 +0000 (18:24 +0100)] 
Python 3.10.0a1

5 years agobpo-41584: clarify when the reflected method of a binary arithemtic operator is calle...
Brett Cannon [Mon, 5 Oct 2020 16:42:21 +0000 (09:42 -0700)] 
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505)

5 years agobpo-41939: Fix test_site.test_license_exists_at_url() (#22559)
Victor Stinner [Mon, 5 Oct 2020 16:24:00 +0000 (18:24 +0200)] 
bpo-41939: Fix test_site.test_license_exists_at_url() (#22559)

Call urllib.request.urlcleanup() to reset the global
urllib.request._opener.

5 years agobpo-41774: Tweak new programming FAQ entry (GH-22562)
Terry Jan Reedy [Mon, 5 Oct 2020 14:31:44 +0000 (10:31 -0400)] 
bpo-41774: Tweak new programming FAQ entry (GH-22562)

Remove mention of space in "remove multiple items from list".

5 years agobpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552)
Serhiy Storchaka [Mon, 5 Oct 2020 09:32:00 +0000 (12:32 +0300)] 
bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552)

5 years agobpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959)
Erlend Egeberg Aasland [Mon, 5 Oct 2020 08:09:16 +0000 (10:09 +0200)] 
bpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959)

https://sqlite.org/releaselog/3_33_0.html

5 years agobpo-41428: Documentation for PEP 604 (gh-22517)
Fidget-Spinner [Mon, 5 Oct 2020 04:40:52 +0000 (12:40 +0800)] 
bpo-41428: Documentation for PEP 604  (gh-22517)

5 years agobpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifyin...
scoder [Sun, 4 Oct 2020 23:13:46 +0000 (01:13 +0200)] 
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464)

5 years agobpo-41909: Enable previously disabled recursion checks. (GH-22536)
Serhiy Storchaka [Sun, 4 Oct 2020 21:55:57 +0000 (00:55 +0300)] 
bpo-41909: Enable previously disabled recursion checks. (GH-22536)

Enable recursion checks which were disabled when get __bases__ of
non-type objects in issubclass() and isinstance() and when intern
strings. It fixes a stack overflow when getting __bases__ leads
to infinite recursion.

Originally recursion checks was disabled for PyDict_GetItem() which
silences all errors including the one raised in case of detected
recursion and can return incorrect result. But now the code uses
PyDict_GetItemWithError() and PyDict_SetDefault() instead.

5 years agoTypo fix (GH-22496)
Manan Kumar Garg [Sun, 4 Oct 2020 21:28:43 +0000 (02:58 +0530)] 
Typo fix (GH-22496)

Multiple typo fixes in code comments

Automerge-Triggered-By: @Mariatta
5 years agobpo-41490: Bump vendored pip to version 20.2.3 (#22527)
Pablo Galindo [Sun, 4 Oct 2020 16:45:31 +0000 (17:45 +0100)] 
bpo-41490: Bump vendored pip to version 20.2.3 (#22527)

5 years agoDelete extra 'the' from `Formatter` class docstring (GH-22530)
Hansraj Das [Sun, 4 Oct 2020 16:09:26 +0000 (21:39 +0530)] 
Delete extra 'the' from `Formatter` class docstring (GH-22530)

5 years agobpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526)
Irit Katriel [Sun, 4 Oct 2020 13:16:04 +0000 (14:16 +0100)] 
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526)

5 years agobpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Batuhan Taskaya [Sun, 4 Oct 2020 00:46:44 +0000 (03:46 +0300)] 
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)

Also document that eval() does this (the same way).

5 years ago[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
Andre Delfino [Sat, 3 Oct 2020 22:10:59 +0000 (19:10 -0300)] 
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)

This changes a few occurrences left behind by #22340.

Automerge-Triggered-By: @gvanrossum
5 years agobpo-41840: Report module-level globals as both local and global in the symtable modul...
Pablo Galindo [Sat, 3 Oct 2020 19:45:55 +0000 (20:45 +0100)] 
bpo-41840: Report module-level globals as both local and global in the symtable module (GH-22391)

5 years agobpo-41922: Use PEP 590 vectorcall to speed up reversed() (GH-22523)
Dong-hee Na [Sat, 3 Oct 2020 17:16:56 +0000 (02:16 +0900)] 
bpo-41922: Use PEP 590 vectorcall to speed up reversed() (GH-22523)

5 years ago[doc] Fix link to abc.collections.Iterable (GH-22520)
Andre Delfino [Sat, 3 Oct 2020 15:51:13 +0000 (12:51 -0300)] 
[doc] Fix link to abc.collections.Iterable (GH-22520)

Missed this occurrence before, sorry. Also changed "the PEP" to "PEP".

Automerge-Triggered-By: @gvanrossum
5 years agobpo-40564: Avoid copying state from extant ZipFile. (GH-22371)
Jason R. Coombs [Sat, 3 Oct 2020 14:58:39 +0000 (10:58 -0400)] 
bpo-40564: Avoid copying state from extant ZipFile. (GH-22371)

bpo-40564: Avoid copying state from extant ZipFile.

5 years agobpo-41826: Fix compiler warnings in test_peg_generator (GH-22455)
Pablo Galindo [Sat, 3 Oct 2020 14:28:51 +0000 (15:28 +0100)] 
bpo-41826: Fix compiler warnings in test_peg_generator (GH-22455)

Co-authored-by: Skip Montanaro
5 years agobpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418)
Ram Rachum [Sat, 3 Oct 2020 10:43:47 +0000 (13:43 +0300)] 
bpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418)

5 years agobpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)
Ram Rachum [Sat, 3 Oct 2020 09:52:13 +0000 (12:52 +0300)] 
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)

5 years agobpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default...
scoder [Sat, 3 Oct 2020 06:07:07 +0000 (08:07 +0200)] 
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474)

5 years ago[doc] Fix link to abc.collections.Iterable (GH-22502)
Andre Delfino [Fri, 2 Oct 2020 23:15:28 +0000 (20:15 -0300)] 
[doc] Fix link to abc.collections.Iterable (GH-22502)

Automerge-Triggered-By: @gvanrossum
5 years agoFix is_typeddict markup (#22501)
Andre Delfino [Fri, 2 Oct 2020 22:36:26 +0000 (19:36 -0300)] 
Fix is_typeddict markup (#22501)

5 years agoTypo fix - "mesasge" should be "message" (GH-22498)
Hansraj Das [Fri, 2 Oct 2020 20:21:45 +0000 (01:51 +0530)] 
Typo fix - "mesasge" should be "message" (GH-22498)

* Correct at 2 places in email module

5 years agobpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291)
Campbell Barton [Fri, 2 Oct 2020 16:18:01 +0000 (02:18 +1000)] 
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291)

5 years agobpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)
Victor Stinner [Fri, 2 Oct 2020 12:49:00 +0000 (14:49 +0200)] 
bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)

The PyUnicode_InternImmortal() function is now deprecated and will be
removed in Python 3.12: use PyUnicode_InternInPlace() instead.

5 years agoUpdate link to supporting references (GH-22488)
Raymond Hettinger [Fri, 2 Oct 2020 02:30:54 +0000 (19:30 -0700)] 
Update link to supporting references (GH-22488)

5 years ago[doc] Update references to NumPy (GH-22458)
Andre Delfino [Thu, 1 Oct 2020 23:22:14 +0000 (20:22 -0300)] 
[doc] Update references to NumPy (GH-22458)

Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.

5 years agobpo-21955: Change my nickname in BINARY_ADD comment (GH-22481)
Victor Stinner [Thu, 1 Oct 2020 16:57:37 +0000 (18:57 +0200)] 
bpo-21955: Change my nickname in BINARY_ADD comment (GH-22481)

5 years agobpo-26680: Incorporate is_integer in all built-in and standard library numeric types...
Robert Smallshire [Thu, 1 Oct 2020 16:30:08 +0000 (18:30 +0200)] 
bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)

* bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer().

The int.is_integer() method always returns True.

* bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True.

* bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int.

This default implementation is intended to reduce the workload for subclass
implementers. It is not robust in the presence of infinities or NaNs and
may have suboptimal performance for other types.

* bpo-26680: Adds Rational.is_integer which returns True if the denominator is one.

This implementation assumes the Rational is represented in it's
lowest form, as required by the class docstring.

* bpo-26680: Adds Integral.is_integer which always returns True.

* bpo-26680: Adds tests for Fraction.is_integer called as an instance method.

The tests for the Rational abstract base class use an unbound
method to sidestep the inability to directly instantiate Rational.
These tests check that everything works correct as an instance method.

* bpo-26680: Updates documentation for Real.is_integer and built-ins int and float.

The call x.is_integer() is now listed in the table of operations
which apply to all numeric types except complex, with a reference
to the full documentation for Real.is_integer().  Mention of
is_integer() has been removed from the section 'Additional Methods
on Float'.

The documentation for Real.is_integer() describes its purpose, and
mentions that it should be overridden for performance reasons, or
to handle special values like NaN.

* bpo-26680: Adds Decimal.is_integer to the Python and C implementations.

The C implementation of Decimal already implements and uses
mpd_isinteger internally, we just expose the existing function to
Python.

The Python implementation uses internal conversion to integer
using to_integral_value().

In both cases, the corresponding context methods are also
implemented.

Tests and documentation are included.

* bpo-26680: Updates the ACKS file.

* bpo-26680: NEWS entries for int, the numeric ABCs and Decimal.

Co-authored-by: Robert Smallshire <rob@sixty-north.com>
5 years agobpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types (GH-22478)
Erlend Egeberg Aasland [Thu, 1 Oct 2020 14:03:21 +0000 (16:03 +0200)] 
bpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types (GH-22478)

5 years agobpo-41861: Convert _sqlite3 RowType and StatementType to heap types (GH-22444)
Erlend Egeberg Aasland [Thu, 1 Oct 2020 13:24:31 +0000 (15:24 +0200)] 
bpo-41861: Convert _sqlite3 RowType and StatementType to heap types (GH-22444)

5 years agobpo-41870: Avoid the test when nargs=0 (GH-22462)
Dong-hee Na [Thu, 1 Oct 2020 04:50:40 +0000 (13:50 +0900)] 
bpo-41870: Avoid the test when nargs=0 (GH-22462)

5 years agoFix grammar in secrets module documentation (GH-22467)
Max Smolens [Wed, 30 Sep 2020 22:05:51 +0000 (18:05 -0400)] 
Fix grammar in secrets module documentation (GH-22467)

From `In particularly,` to `In particular,`

5 years agobpo-41670: Remove outdated predict macro invocation. (GH-22026) 22412/head
Mark Shannon [Tue, 29 Sep 2020 09:09:13 +0000 (10:09 +0100)] 
bpo-41670: Remove outdated predict macro invocation. (GH-22026)

Remove PREDICTion of POP_BLOCK from FOR_ITER.

5 years agobpo-41774: Add programming FAQ entry (GH-22402)
Terry Jan Reedy [Tue, 29 Sep 2020 05:02:44 +0000 (01:02 -0400)] 
bpo-41774: Add programming FAQ entry (GH-22402)

In the "Sequences (Tuples/Lists)" section, add
"How do you remove multiple items from a list".

5 years agobpo-41773: Raise exception for non-finite weights in random.choices(). (GH-22441)
Ram Rachum [Tue, 29 Sep 2020 01:32:10 +0000 (04:32 +0300)] 
bpo-41773: Raise exception for non-finite weights in random.choices().  (GH-22441)

5 years agobpo-41873: Add vectorcall for float() (GH-22432)
Dennis Sweeney [Tue, 29 Sep 2020 00:55:52 +0000 (20:55 -0400)] 
bpo-41873: Add vectorcall for float() (GH-22432)

5 years ago bpo-41861: Convert _sqlite3 PrepareProtocolType to heap type (GH-22428)
Erlend Egeberg Aasland [Mon, 28 Sep 2020 22:05:04 +0000 (00:05 +0200)] 
 bpo-41861: Convert _sqlite3 PrepareProtocolType to heap type (GH-22428)

5 years agobpo-41842: Add codecs.unregister() function (GH-22360)
Hai Shi [Mon, 28 Sep 2020 21:41:11 +0000 (05:41 +0800)] 
bpo-41842: Add codecs.unregister() function (GH-22360)

Add codecs.unregister() and PyCodec_Unregister() functions
to unregister a codec search function.

5 years agobpo-41875: Use __builtin_unreachable when possible (GH-22433)
Dong-hee Na [Mon, 28 Sep 2020 20:41:23 +0000 (05:41 +0900)] 
bpo-41875: Use __builtin_unreachable when possible (GH-22433)

5 years agobpo-40105: ZipFile truncate in append mode with shorter comment (GH-19337)
Jan Mazur [Mon, 28 Sep 2020 18:53:33 +0000 (20:53 +0200)] 
bpo-40105: ZipFile truncate in append mode with shorter comment (GH-19337)

5 years agobpo-41870: Use PEP 590 vectorcall to speed up bool() (GH-22427)
Dong-hee Na [Mon, 28 Sep 2020 16:16:21 +0000 (01:16 +0900)] 
bpo-41870: Use PEP 590 vectorcall to speed up bool()  (GH-22427)

* bpo-41870: Use PEP 590 vectorcall to speed up bool()

* bpo-41870: Add NEWS.d

5 years ago[doc] Leverage the fact that the actual types can now be indexed for typing (GH-22340)
Andre Delfino [Sun, 27 Sep 2020 19:07:04 +0000 (16:07 -0300)] 
[doc] Leverage the fact that the actual types can now be indexed for typing (GH-22340)

This shows users that they can use the actual types. Using deprecated types is confusing.

This also prefers colections.abc.Sized instead of the alias typing.Sized. I guess the aliases were created to make it convenient to import all collections related types from the same place.

This should be backported to 3.9.

Automerge-Triggered-By: @gvanrossum
5 years agobpo-41861: Convert _sqlite3 cache and node static types to heap types (GH-22417)
Erlend Egeberg Aasland [Sun, 27 Sep 2020 12:14:50 +0000 (14:14 +0200)] 
bpo-41861: Convert _sqlite3 cache and node static types to heap types (GH-22417)

5 years agobpo-41858: Clarify line in optparse doc (GH-22407)
Emmanuel Arias [Sun, 27 Sep 2020 03:43:18 +0000 (00:43 -0300)] 
bpo-41858: Clarify line in optparse doc (GH-22407)

The existing line is easily read as being incomplete.

5 years agoRevert "Fix all Python Cookbook links (#22205)" (GH-22424)
Andre Delfino [Sun, 27 Sep 2020 00:47:25 +0000 (21:47 -0300)] 
Revert "Fix all Python Cookbook links (#22205)" (GH-22424)

This commit reverts commit ac0333e1e117b7f61ed7ef1dbcdb6e515ada603b as the original links are working again and they provide extended features such as comments and alternative versions.

5 years agobpo-1635741: Port _bisect module to multi-phase init (GH-22415)
Dong-hee Na [Sat, 26 Sep 2020 10:56:26 +0000 (19:56 +0900)] 
bpo-1635741: Port _bisect module to multi-phase init (GH-22415)

5 years agobpo-41428: Fix compiler warning in unionobject.c (GH-22416)
Victor Stinner [Sat, 26 Sep 2020 10:48:41 +0000 (12:48 +0200)] 
bpo-41428: Fix compiler warning in unionobject.c (GH-22416)

Use Py_ssize_t type rather than int, to store lengths in
unionobject.c. Fix the warning:

Objects\unionobject.c(205,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data

5 years agoFix logging error message (GH-22410)
Eric Larson [Fri, 25 Sep 2020 18:08:50 +0000 (14:08 -0400)] 
Fix logging error message (GH-22410)

Same changes as #22276 squashed to a single commit. Just hoping to get Travis to cooperate by opening a new PR...

Automerge-Triggered-By: @vsajip
5 years agobpo-39934: Account for control blocks in 'except' in compiler. (GH-22395)
Mark Shannon [Fri, 25 Sep 2020 13:04:19 +0000 (14:04 +0100)] 
bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395)

* Account for control blocks in 'except' in compiler. Fixes #39934.

5 years agobpo-41775: Make 'IDLE Shell' the shell title (#22399)
Terry Jan Reedy [Thu, 24 Sep 2020 19:30:09 +0000 (15:30 -0400)] 
bpo-41775: Make 'IDLE Shell' the shell title  (#22399)

'Python Shell' may have contributed to some beginners confusing 'IDLE' with ' Python'.

5 years agobpo-41428: Fix compiler warnings in unionobject.c (GH-22388)
Victor Stinner [Wed, 23 Sep 2020 21:25:54 +0000 (23:25 +0200)] 
bpo-41428: Fix compiler warnings in unionobject.c (GH-22388)

Use Py_ssize_t type rather than int, to store lengths in
unionobject.c. Fix warnings:

Objects\unionobject.c(189,71): warning C4244: '+=':
conversion from 'Py_ssize_t' to 'int', possible loss of data

Objects\unionobject.c(182,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data

Objects\unionobject.c(205,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data

Objects\unionobject.c(437,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data

5 years agobpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387)
Victor Stinner [Wed, 23 Sep 2020 21:25:40 +0000 (23:25 +0200)] 
bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387)

Fix warning:

Objects\exceptions.c(2324,56): warning C4098:
'MemoryError_dealloc': 'void' function returning a value

5 years agobpo-41833: threading.Thread now uses the target name (GH-22357)
Victor Stinner [Wed, 23 Sep 2020 21:21:19 +0000 (23:21 +0200)] 
bpo-41833: threading.Thread now uses the target name (GH-22357)

5 years agobpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)
Zackery Spytz [Wed, 23 Sep 2020 18:43:45 +0000 (12:43 -0600)] 
bpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)

Add PyDateTime_DATE_GET_TZINFO() and PyDateTime_TIME_GET_TZINFO()
macros.

5 years agobpo-33822: Update IDLE section of What's New 3.8 (GH-22383)
Terry Jan Reedy [Wed, 23 Sep 2020 15:19:05 +0000 (11:19 -0400)] 
bpo-33822: Update IDLE section of What's New 3.8 (GH-22383)

5 years agobpo-41844: Add IDLE section to What's New 3.9 (GN-22382)
Terry Jan Reedy [Wed, 23 Sep 2020 15:17:26 +0000 (11:17 -0400)] 
bpo-41844: Add IDLE section to What's New 3.9 (GN-22382)

5 years agobpo-41841: Prepare IDLE News for 3.10 (GH-22379)
Terry Jan Reedy [Wed, 23 Sep 2020 13:44:31 +0000 (09:44 -0400)] 
bpo-41841: Prepare IDLE News for 3.10 (GH-22379)

5 years agobpo-37779 : Add information about the overriding behavior of ConfigParser.read (GH...
sblondon [Wed, 23 Sep 2020 12:28:58 +0000 (14:28 +0200)] 
bpo-37779 : Add information about the overriding behavior of ConfigParser.read (GH-15177)

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Paul Ganssle <p.ganssle@gmail.com>
5 years agobpo-40170: Use inline _PyType_HasFeature() function (GH-22375)
Victor Stinner [Wed, 23 Sep 2020 12:08:38 +0000 (14:08 +0200)] 
bpo-40170: Use inline _PyType_HasFeature() function (GH-22375)

Use _PyType_HasFeature() in the _io module and in structseq
implementation. Replace PyType_HasFeature() opaque function call with
_PyType_HasFeature() inlined function.

5 years agobpo-40941: Fix stackdepth compiler warnings (GH-22377)
Victor Stinner [Wed, 23 Sep 2020 12:07:16 +0000 (14:07 +0200)] 
bpo-40941: Fix stackdepth compiler warnings (GH-22377)

Explicitly cast a difference of two pointers to int:
PyFrameObject.f_stackdepth is an int.

5 years agobpo-40941: Fix fold_tuple_on_constants() compiler warnings (GH-22378)
Victor Stinner [Wed, 23 Sep 2020 12:06:55 +0000 (14:06 +0200)] 
bpo-40941: Fix fold_tuple_on_constants() compiler warnings (GH-22378)

Add explicit casts to fix compiler warnings in
fold_tuple_on_constants().

The limit of constants per code is now INT_MAX, rather than UINT_MAX.

5 years agobpo-40521: Fix PyUnicode_InternInPlace() (GH-22376)
Victor Stinner [Wed, 23 Sep 2020 12:05:32 +0000 (14:05 +0200)] 
bpo-40521: Fix PyUnicode_InternInPlace() (GH-22376)

Fix PyUnicode_InternInPlace() when the INTERNED_STRINGS macro is not
defined (when the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is
defined).

5 years agobpo-41834: Remove _Py_CheckRecursionLimit variable (GH-22359)
Victor Stinner [Wed, 23 Sep 2020 12:04:57 +0000 (14:04 +0200)] 
bpo-41834: Remove _Py_CheckRecursionLimit variable (GH-22359)

Remove the global _Py_CheckRecursionLimit variable: it has been
replaced by ceval.recursion_limit of the PyInterpreterState
structure.

There is no need to keep the variable for the stable ABI, since
Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() were not usable
in Python 3.8 and older: these macros accessed PyThreadState members,
whereas the PyThreadState structure is opaque in the limited C API.

5 years agobpo-1635741, unicodedata: add ucd_type parameter to UCD_Check() macro (GH-22328)
Mohamed Koubaa [Wed, 23 Sep 2020 10:38:16 +0000 (05:38 -0500)] 
bpo-1635741, unicodedata: add ucd_type parameter to UCD_Check() macro (GH-22328)

Co-authored-by: Victor Stinner <vstinner@python.org>
5 years agobpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (GH-22220)
Mohamed Koubaa [Wed, 23 Sep 2020 10:33:21 +0000 (05:33 -0500)] 
bpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (GH-22220)

5 years agobpo-41513: Improve order of adding fractional values. Improve variable names. (GH...
Raymond Hettinger [Wed, 23 Sep 2020 03:01:12 +0000 (20:01 -0700)] 
bpo-41513: Improve order of adding fractional values. Improve variable names. (GH-22368)

5 years agobpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362)
Ethan Furman [Tue, 22 Sep 2020 20:00:07 +0000 (13:00 -0700)] 
bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362)

use `str.__str__` for `StrEnum` so that `str(StrEnum.member)` is the same as directly accessing the string value of the `StrEnum` member

5 years agobpo-35764: Rewrite the IDLE Calltips doc section (GH-22363)
Terry Jan Reedy [Tue, 22 Sep 2020 17:21:58 +0000 (13:21 -0400)] 
bpo-35764: Rewrite the IDLE Calltips doc section  (GH-22363)

5 years agobpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType`...
Bas van Beek [Tue, 22 Sep 2020 15:55:34 +0000 (17:55 +0200)] 
bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` (GH-22336)

closes issue 41810

5 years agobpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (#21956)
Thomas Grainger [Tue, 22 Sep 2020 15:53:03 +0000 (16:53 +0100)] 
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (#21956)

Closes bpo issue 41602

5 years agobpo-41817: use new StrEnum to ensure all members are strings (GH-22348)
Ethan Furman [Tue, 22 Sep 2020 15:01:17 +0000 (08:01 -0700)] 
bpo-41817: use new StrEnum to ensure all members are strings (GH-22348)

* use new StrEnum to ensure all members are strings

5 years agobpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358)
Serhiy Storchaka [Tue, 22 Sep 2020 13:16:46 +0000 (16:16 +0300)] 
bpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358)

It now accepts "empty" statements (only whitespaces and comments)
and rejects misindentent statements.

5 years agoPy_IS_TYPE() macro uses Py_TYPE() (GH-22341)
Victor Stinner [Tue, 22 Sep 2020 10:42:28 +0000 (12:42 +0200)] 
Py_IS_TYPE() macro uses Py_TYPE() (GH-22341)

5 years agoEnum: add extended AutoNumber example (GH-22349)
Ethan Furman [Tue, 22 Sep 2020 07:05:27 +0000 (00:05 -0700)] 
Enum: add extended AutoNumber example (GH-22349)

5 years agobpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)
Terry Jan Reedy [Tue, 22 Sep 2020 05:43:55 +0000 (01:43 -0400)] 
bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)

The marker was added to the language in 3.8 and
3.7 only gets security patches.

5 years agobpo-41756: Refactor gen_send_ex(). (GH-22330)
Serhiy Storchaka [Tue, 22 Sep 2020 05:08:54 +0000 (08:08 +0300)] 
bpo-41756: Refactor gen_send_ex(). (GH-22330)

5 years agobpo-41816: add `StrEnum` (GH-22337)
Ethan Furman [Tue, 22 Sep 2020 00:23:13 +0000 (17:23 -0700)] 
bpo-41816: add `StrEnum` (GH-22337)

`StrEnum` ensures that its members were already strings, or intended to
be strings.

5 years agobpo-40084: Enum - dir() includes member attributes (GH-19219)
Angelin BOOZ [Mon, 21 Sep 2020 13:11:06 +0000 (15:11 +0200)] 
bpo-40084: Enum - dir() includes member attributes (GH-19219)

5 years agobpo-1635741: Convert an _lsprof method to argument clinic (GH-22240)
Mohamed Koubaa [Mon, 21 Sep 2020 12:40:42 +0000 (07:40 -0500)] 
bpo-1635741: Convert an  _lsprof method to argument clinic (GH-22240)