Skip to content

Interactive Mode suddenly prevents indexing "[]" #134095

Closed as duplicate
Closed as duplicate
@alex77g2

Description

@alex77g2

Bug report

Bug description:

import numpy as np
m = np.arange(16).reshape(4,4)
s = "m[1]" # see text below
m[1]  # array([4, 5, 6, 7])

The code above works as expected in Python 3.12 (file.py + interactive mode) and Python 3.13 (from file.py).
But it fails in Interactive Mode (console), at least under Windows 10.
Running same code from file.py works ( "print(m[1])" ).
Python 3.13.3 (tags/v3.13.3:6280bb5, Apr 8 2025, 14:47:33) [MSC v.1943 64 bit (AMD64)] on win32
It is nearly impossible to enter "m[1]". If testing Console of 3.12 it is fine. Console 3.13 is broken.
Reopen and retry does not fix it. After some time trying, I got it only once via entering strings "[1]" and removing string limiters '"'. If code is somehow entered, it works, but usually it is impossible to enter now.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsstdlibPython modules in the Lib dirtopic-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