Spelling suggestions in errors... there is something to be installed to have them? Or it's a compilation flag?

Hello!

While building examples for a talk I’ll give about “new stuff in py 3.14 and 3.15”, I found that the Python 3.14 that comes with the system (Ubuntu 26.04.1) and Python3.15 that I installed through Deadsnakes PPA don’t show spelling suggestions:

>>> [].apend(3)
... 
AttributeError: 'list' object has no attribute 'apend'

However both an old Python3.10 and a compiled from main 3.16 do:

>>> [].apend(3)
...
AttributeError: 'list' object has no attribute 'apend'. Did you mean: 'append'?

For the more recent improvement it’s similar, not showing the suggestion in my 3.14 and 3.15:

>>> whille True:
...
SyntaxError: invalid syntax

But it’s there in 3.16:

>>> whille True: 
...
SyntaxError: invalid syntax. Did you mean 'while'?

Do we have those builds broken somehow? There’s something else to be installed in my system? Something weirder is going on? Thanks!

. Facundo

I do get the expected spelling suggestions with Python 3.15 on macOS, installed with the official installer:

Python 3.15.2 (v3.15.2:5e58eaad7c5, Oct 25 2026, 14:19:34) [Clang 21.0.0 (clang-2100.1.1.101)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [].apend(3)
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    [].apend(3)
    ^^^^^^^^
AttributeError: 'list' object has no attribute 'apend'. Did you mean '.append' instead of '.apend'?
>>> whille True:
  File "<python-input-1>", line 1
    whille True:
    ^^^^^^
SyntaxError: invalid syntax. Did you mean 'while'?

Same for Python 3.14.10.

Ah, it’s a good idea to show exactly the build. So, for example:

$ python3.14
Python 3.14.4 (main, Aug 20 2026, 10:41:58) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [].apend(3)
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    [].apend(3)
    ^^^^^^^^
AttributeError: 'list' object has no attribute 'apend'
>>> 

$ python3.15
Python 3.15.2 (main, Oct 26 2026, 15:27:56) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> whille True:
  File "<python-input-0>", line 1
    whille True:

           ^
SyntaxError: invalid syntax
>>> 

I also get the suggestions in a clean Ubuntu 26.04 container:

$ docker run --rm -it ubuntu:26.04 bash -c 'apt-get update -qq && apt-get install -y -qq python3 && exec bash'
Python 3.14.4 (main, Aug 20 2026, 10:41:58) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [].apend(3)
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    [].apend(3)
    ^^^^^^^^
AttributeError: 'list' object has no attribute 'apend'. Did you mean: 'append'?
>>> whille True:
  File "<python-input-1>", line 1
    whille True:
    ^^^^^^
SyntaxError: invalid syntax. Did you mean 'while'?

Also get them after adding 3.15 via deadsnakes to the same container:

apt-get install -y -qq software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get install -y -qq python3.15
Python 3.15.2 (main, Oct 26 2026, 15:27:56) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> [].apend(3)
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    [].apend(3)
    ^^^^^^^^
AttributeError: 'list' object has no attribute 'apend'. Did you mean '.append' instead of '.apend'?
>>> whille True:
  File "<python-input-1>", line 1
    whille True:
    ^^^^^^
SyntaxError: invalid syntax. Did you mean 'while'?

Seems like something in your system? Does running Python with -I (“isolate Python from the user’s environment (implies -E, -P and -s)”) make a difference?