Commit graph

110229 commits

Author SHA1 Message Date
Ken Jin
6773c3eaa7
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Also fix stable ABI type definitions
2021-06-16 07:12:25 -07:00
Sergey Fedoseev
ab030d6f9d
bpo-38211: Clean up type_init() (GH-16257)
1. Remove conditions already checked by assert()
2. Remove object_init() call that effectively creates an empty tuple and
checks that this tuple is empty
2021-06-16 14:04:38 +01:00
Victor Stinner
0729694246
bpo-44422: threading.Thread reuses the _delete() method (GH-26741)
The _bootstrap_inner() method of threading.Thread now reuses its
_delete() method rather than accessing _active() directly. It became
possible since _active_limbo_lock became reentrant. Moreover, it no
longer ignores any exception when deleting the thread from the
_active dictionary.
2021-06-16 11:41:17 +02:00
Petr Viktorin
7cad9cb51b
bpo-43795: Don't list private names in the limited API (GH-26740)
* Remove struct _node from the stable ABI list

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

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

* Ensure limited API doesn't contain private names

Names prefixed by an underscore are private by definition.

* Add a blurb
2021-06-16 11:22:36 +02:00
Ethan Furman
741b8ae1cf
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750) 2021-06-15 18:51:19 -07:00
Eric Snow
ac38a9f2df
bpo-43693: Eliminate unused "fast locals". (gh-26587)
Currently, if an arg value escapes (into the closure for an inner function) we end up allocating two indices in the fast locals even though only one gets used.  Additionally, using the lower index would be better in some cases, such as with no-arg `super()`.  To address this, we update the compiler to fix the offsets so each variable only gets one "fast local".  As a consequence, now some cell offsets are interspersed with the locals (only when an arg escapes to an inner function).

https://bugs.python.org/issue43693
2021-06-15 16:35:25 -06: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
Ethan Furman
cb2014f207
[Enum] improve test, add andrei kulakov to ACKS (GH-26726) 2021-06-15 11:38:15 -07:00
Victor Stinner
243fd01047
bpo-44422: Fix threading.enumerate() reentrant call (GH-26727)
The threading.enumerate() function now uses a reentrant lock to
prevent a hang on reentrant call.
2021-06-15 16:14:24 +02:00
Victor Stinner
1cd3d859a4
bpo-42972: _thread.RLock implements the GH protocol (GH-26734)
The _thread.RLock type now fully implement the GC protocol: add a
traverse function and the Py_TPFLAGS_HAVE_GC flag.
2021-06-15 15:09:24 +02:00
Erlend Egeberg Aasland
10a5c806d4
bpo-42064: Move sqlite3 types to global state (GH-26537)
* Move connection type to global state
* Move cursor type to global state
* Move prepare protocol type to global state
* Move row type to global state
* Move statement type to global state
* ADD_TYPE takes a pointer
* pysqlite_get_state is now static inline
2021-06-15 14:47:34 +02:00
Mark Shannon
8ebd9447e9
Add extra stats for attribute misses (GH-26732) 2021-06-15 13:01:42 +01:00
andrei kulakov
689a84475e
Fix a typo in _make_class_unpicklable() docstring (GH-26729) 2021-06-14 19:42:46 -07:00
Pablo Galindo
507ed6fa1d
bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712) 2021-06-14 17:46:11 +01:00
Gabriele N. Tornetta
cc8ecf6864
Fix typo in lnotab_notes.txt (GH-26711)
Thanks for your contribution @P403n1x87
2021-06-14 11:49:05 -03: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
Mark Shannon
358aa6197c
Remove accidentally duplicated STAT_INC (GH-26718) 2021-06-14 13:38:16 +01:00
Mark Shannon
eecbc7c390
bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638)
* Add specializations of LOAD_GLOBAL.

* Add more stats.

* Remove old opcache; it is no longer used.

* Add NEWS
2021-06-14 11:04:09 +01: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
Christian Heimes
bf527277d4
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-13 13:46:07 +02:00
Mark Dickinson
5924243199
Fix a potential reference-counting bug in long_pow (GH-26690) 2021-06-13 08:19:29 +01:00
Binbin
17b16e13bb
Fix typos in multiple files (GH-26689)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-12 22:47:44 -04:00
Dong-hee Na
736ed6f7a9
bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693) 2021-06-13 07:07:24 +09:00
Erlend Egeberg Aasland
cb7230c7a7
bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680) 2021-06-12 17:17:58 -03:00
Pablo Galindo
a342cc5891
bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676)
Automerge-Triggered-By: GH:pablogsal
2021-06-12 10:53:49 -07:00
Tim Peters
9d8dd8f08a
bpo-44376 - reduce pow() overhead for small exponents (GH-26662)
Greatly reduce pow() overhead for small exponents.
2021-06-12 11:29:56 -05:00
Serhiy Storchaka
be8b631b7a
Add more const modifiers. (GH-26691) 2021-06-12 16:11:59 +03: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
Kaustubh J
3ec3ee7d2e
bpo-40128: Fix IDLE autocomplete on macOS (GH-26672)
In particular, when running with tk8.6.8, as in PSF 3.9. 

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-11 18:55:32 -04:00
Steve Dower
5af56c6f2a
bpo-44381: Windows build now allows enabling control flow guard (GH-26645) 2021-06-11 21:35:40 +01:00
huzhaojie
4cb6ba1432
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) 2021-06-11 16:17:56 +01:00
Lumír 'Frenzy' Balhar
fc98266ff6
bpo-44351: Restore back parse_makefile in distutils.sysconfig (GH-26637)
The function uses distutils.text_file.TextFile and therefore
behaves differently than _parse_makefile in sysconfig.
2021-06-11 17:08:00 +02:00
Ethan Furman
c956734d7a
bpo-44242: [Enum] improve error messages (GH-26669) 2021-06-11 02:44:43 -07:00
Victor Stinner
304dfec8d3
bpo-44378: Fix a compiler warning in Py_IS_TYPE() (GH-26644)
Py_IS_TYPE() no longer uses Py_TYPE() to avoid a compiler warning:
no longer cast "const PyObject*" to "PyObject*".
2021-06-11 10:35:36 +02:00
Ethan Furman
3a7cccfd6c
bpo-44342: [Enum] fix data type search (GH-26667)
In an inheritance chain of

  int -> my_int -> final_int

the data type is now final_int (not my_int)
2021-06-11 01:25:14 -07: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
Ethan Furman
62f1d2b3d7
bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658)
by-value lookups could fail on complex enums, necessitating a check for
__reduce__ and possibly sabotaging the final enum;

by-name lookups should never fail, and sabotaging is no longer necessary
for class-based enum creation.
2021-06-10 15:52:09 -07:00
Pablo Galindo
05073036dc
bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632) 2021-06-10 23:50:32 +01:00
Lysandros Nikolaou
e7b4644607
bpo-44385: Remove unused grammar rules (GH-26655)
Automerge-Triggered-By: GH:lysnikolaou
2021-06-10 15:05:06 -07:00
Daniel Hahler
6544b2532d
bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) 2021-06-10 21:32:04 +01:00
Ethan Furman
8a4f0850d7
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)
This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum:

    class Str1Enum(str, Enum):
        # some behavior here

    class Str2Enum(str, Enum):
        # some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        # this now works
2021-06-10 13:30:41 -07:00
Mark Roseman
42d5a4fc3b
bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954)
If ttk.Spinbox is not available (Tk < 8.5.9) use readonly ttk.Combobox.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-10 15:13:55 -04:00
Pablo Galindo
f82262b186
Run address sanitiser in the GitHub CI (GH-26640) 2021-06-10 18:47:53 +01: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
Ajith Ramachandran
90cd433032
bpo-44364:Add non integral tests for sqrt() (#26625)
* Add non integral tests for `sqrt()`

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-06-10 17:27:26 +01:00
Mark Shannon
31aa0dbff4
bpo-44363: Get test_capi passing with address sanitizer (GH-26639) 2021-06-10 12:37:22 +01:00
Mark Shannon
54cb63863f
bpo-44348: Move trace-info to thread-state (GH-26623)
* Move trace-info to thread state.

* Correct output for pdb when turning on tracing in middle of line
2021-06-10 08:46:59 +01:00
Mark Shannon
e117c02837
bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595)
* Specialize LOAD_ATTR with  LOAD_ATTR_SLOT and LOAD_ATTR_SPLIT_KEYS

* Move dict-common.h to internal/pycore_dict.h

* Add LOAD_ATTR_WITH_HINT specialized opcode.

* Quicken in function if loopy

* Specialize LOAD_ATTR for module attributes.

* Add specialization stats
2021-06-10 08:46:01 +01:00