Closed
Description
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.
def letter_colors(word, guess):
'''Compute letter colors for Wordle guesses. B=black Y=yellow G=green'''
if (n := len(word)) != len(guess):
raise ValueError('Word and guess must be the same length.')
result = ['G' if wl == gl else 'B' for (wl, gl) in zip(word, guess)]
unused = [w for (w, r) in zip(word, result) if r == 'B']
for i, c in enumerate(guess):
if result[i] != 'G' and c in unused:
result[i] = 'Y'
unused.remove(c)
return ''.join(result)
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Windows