* [Enum] reduce scope of new format behavior
Instead of treating all Enums the same for format(), only user mixed-in
enums will be affected. In other words, IntEnum and IntFlag will not be
changing the format() behavior, due to the requirement that they be
drop-in replacements of existing integer constants.
If a user creates their own integer-based enum, then the new behavior
will apply:
class Grades(int, Enum):
A = 5
B = 4
C = 3
D = 2
F = 0
Now: format(Grades.B) -> DeprecationWarning and '4'
3.12: -> no warning, and 'B'.
(cherry picked from commit f60b07ab6c)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* 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
(cherry picked from commit 7cad9cb51b)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683cfb)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Move the check for missing named flags in flag aliases from Flag creation
to a new *verify* decorator..
(cherry picked from commit eea8148b7d)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
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
(cherry picked from commit 2ea6d89028)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 257e400a19)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
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.
(cherry picked from commit 67dfa6f2a5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
BPO-42914 was not added to the What's New in GH-24864. This includes it in the "Improved Modules" section.
Automerge-Triggered-By: GH:gpshead
(cherry picked from commit 4846ea95d1)
Co-authored-by: Wm. Keith van der Meulen <keith@wkeithvan.com>
* [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>
(cherry picked from commit 28f12c9f4f)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Automerge-Triggered-By: GH:jaraco
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.
(cherry picked from commit 8450e8a81f)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* Add deprecated-removed loop labels for all reelvant functions/classes in asyncio
(cherry picked from commit d8fd8c8568)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Automerge-Triggered-By: GH:gpshead
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.
(cherry picked from commit d16856960e)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Making the description of `InspectLoader.is_package` aligned with the current implementation.
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit 8b9310d902)
Co-authored-by: Junnosuke Kuroda <Isa-rentacs@users.noreply.github.com>
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
(cherry picked from commit 2f47d8dcc7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.10] bpo-43882 - Mention urllib.parse changes in Whats new section.
* escape the \n chars, ReSTify :rfc:, urllib.parse is a :mod:
* minor formatting.
Co-authored-by: Gregory P. Smith <greg@krypto.org>