Skip to content

Pasting a function definition does not work in 3.13 REPL with Windows Terminal#124096

@japageth

Description

@japageth

Bug report

Bug description:

I use Python downloaded from python.org without using a graphical environment such as IPython. Instead, I use the Windows Terminal with the REPL built into python.exe. In 3.12.6, I can paste a function definition copied from a text editor directly into the REPL and everything works fine. In 3.13.rc2 this does not work; the indentation is all messed up and I get an IndentationError.

defletter_colors(word, guess): '''Compute letter colors for Wordle guesses. B=black Y=yellow G=green'''if (n:=len(word)) !=len(guess): raiseValueError('Word and guess must be the same length.') result= ['G'ifwl==glelse'B'for (wl, gl) inzip(word, guess)] unused= [wfor (w, r) inzip(word, result) ifr=='B'] fori, cinenumerate(guess): ifresult[i] !='G'andcinunused: result[i] ='Y'unused.remove(c) return''.join(result)

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions