Skip to content

Python 3.14rc1 doesn't allow t''+'', but string.templatelib.pyi allows it #14479

@Dutcho

Description

@Dutcho

As per late change (for security), Templates (t-strings) can not be concatenated with regular strings.
Python 3.14 RC1 disallows it:

Python 3.14.0rc1 (tags/v3.14.0rc1:48f8831, Jul 22 2025, 17:09:57) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> t''+''
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    t''+''
    ~~~^~~
TypeError: can only concatenate string.templatelib.Template (not "str") to string.templatelib.Template

However, string.templatelib.pyi (main branch, by latest PR) contains

class Template:
    ...
    def __add__(self, other: Template | str) -> Template: ...

Suggest to change to other: Template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy