-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
1 / 11 of 1 issue completedLabels
python314Related to Python 3.14Related to Python 3.14trackingA "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.A "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.
Description
This is the tracking issue for updates required to support Python 3.14.
The major changes are (so far) as follows:
- PEP 750 – Template Strings Implement template strings #17851
- PEP 758 – Allow except and except* expressions without parentheses
- PEP 649 – Deferred Evaluation Of Annotations Using Descriptors (and PEP 749)
- PEP 765 – Disallow return/break/continue that exit a finally block
Parser Updates
- Support for template strings
- Let's delay opening an issue for this until the implementation is actually merged in to CPython
- PEP 758 – Allow except and except* expressions without parentheses
- Might be a quick fix to these lines
Formatter Updates
- Support for template strings
- Let's delay opening an issue for this until the implementation is actually merged in to CPython
- Decide how to handle formatting for unparenthesized except tuples
Syntax Errors
- PEP 765 – Disallow return/break/continue that exit a finally block
- At the moment, similar errors are only detected by lint rules and may or may not be folded into the more general checks for compiler-emitted syntax errors (see the excellent [syntax-errors] Remaining syntax errors raised by the compiler #17412 for a discussion). It might make sense to implement this as a lint rule until and unless things like "
breakoutside of loop" are detected as syntax errors.
- At the moment, similar errors are only detected by lint rules and may or may not be folded into the more general checks for compiler-emitted syntax errors (see the excellent [syntax-errors] Remaining syntax errors raised by the compiler #17412 for a discussion). It might make sense to implement this as a lint rule until and unless things like "
Semantic Model
- Visit template strings in a similar manner to f-strings; in particular we will need to read the "interpolated values" as references
- 3.14 deferred evaluation of annotations #15100
Affected Rules
It is probably best to wait until the first round of changes to the semantic model have been made before tackling these.
- missing-f-string-syntax (RUF027)
- invalid-pathlib-with-suffix (
PTH210) [flake8-use-pathlib] Skip single dots forinvalid-pathlib-with-suffix(PTH210) on versions >= 3.14 #19331 - starmap-zip (
RUF058) [ruff] Allowstrictkwarg when checking forstarmap-zip(RUF058) in Python 3.14+ #19333 - Many of the rules in `flake8-type-checking
flake8-future-annotations-fa- unnecessary-future-import (UP010)
More generally - we should grep for documentation or rules that suggest or mention from __future__ import annotations and see if these need to be updated to exclude Python 3.14+.
Below the fold is a list of rules that may need to be adjusted to handle t-strings correctly.
Rules possibly affected by t-strings
- unused-method-argument (ARG002)
- useless-expression (B018)
- f-string-docstring (B021)
- unnecessary-generator-set (C401)
- unnecessary-collection-call (C408)
- unnecessary-map (C417)
- call-datetime-strptime-without-zone (DTZ007)
- whitespace-before-close-bracket (E202)
- whitespace-before-punctuation (E203)
- missing-whitespace (E231)
- unexpected-spaces-around-keyword-parameter-equals (E251)
- raw-string-in-exception (EM101)
- f-string-in-exception (EM102)
- f-string-missing-placeholders (F541)
- f-string-number-format (FURB116)
- logging-f-string (G004)
- f-string-in-get-text-func-call (INT001)
- single-line-implicit-string-concatenation (ISC001)
- multi-line-implicit-string-concatenation (ISC002)
- explicit-string-concatenation (ISC003)
- single-string-slots (PLC0205)
- invalid-character-backspace (PLE2510)
- invalid-character-sub (PLE2512)
- invalid-character-esc (PLE2513)
- invalid-character-nul (PLE2514)
- invalid-character-zero-width-space (PLE2515)
- no-self-use (PLR6301)
- assert-on-string-literal (PLW0129)
- pytest-raises-too-broad (PT011)
- pytest-assert-always-false (PT015)
- pytest-fail-without-message (PT016)
- pytest-warns-too-broad (PT030)
- explicit-f-string-type-conversion (RUF010)
- invalid-index-type (RUF016)
- in-empty-collection (RUF060)
- unused-noqa (RUF100)
- hardcoded-bind-all-interfaces (S104)
- hardcoded-temp-file (S108)
- suspicious-mark-safe-usage (S308)
- suspicious-url-open-usage (S310)
- hardcoded-sql-expression (S608)
- unsafe-markup-use (S704)
- multiple-with-statements (SIM117)
- expr-or-true (SIM222)
- expr-and-false (SIM223)
- raise-vanilla-args (TRY003)
- unnecessary-encode-utf8 (UP012)
- native-literals (UP018)
- unicode-kind-prefix (UP025)
- printf-string-formatting (UP031)
Miscellaneous To-Dos
- Run generate_known_standard_library.py and make sure
annotationlibis added
penguinologMichaReiser
Sub-issues
Metadata
Metadata
Assignees
Labels
python314Related to Python 3.14Related to Python 3.14trackingA "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.A "meta" issue that tracks completion of a bigger task via a list of smaller scoped issues.