New error messages in Python 3.15
Updated
Python 3.15.0 was released on 9 October 2026, and 3.15.1 followed on 21 October. In 3.15 the error messages change in one place, AttributeError, which now suggests more fixes. Each example below ran on 3.14 and on 3.15, and shows what each printed.
An attribute that lives on an inner object
When the attribute you asked for does not exist, but one of the object's own attributes has it, 3.15 suggests the path to it.
from dataclasses import dataclass
from math import pi
@dataclass
class Circle:
radius: float
@property
def area(self) -> float:
return pi * self.radius ** 2
class Container:
def __init__(self, inner: Circle) -> None:
self.inner = inner
container = Container(Circle(radius=4.0))
print(container.area)Traceback (most recent call last):
File "/home/me/project/main.py", line 17, in <module>
print(container.area)
^^^^^^^^^^^^^^
AttributeError: 'Container' object has no attribute 'area'. Did you mean '.inner.area' instead of '.area'?| Python | Prints |
|---|---|
| 3.14 | AttributeError: 'Container' object has no attribute 'area' |
| 3.15 | AttributeError: 'Container' object has no attribute 'area'. Did you mean '.inner.area' instead of '.area'? |
Run on CPython 3.14.9 and 3.15.1, on October 25, 2026.
Method names from other languages
When a builtin type has no attribute with a close spelling, 3.15 checks a table of common method names from JavaScript, Java, Ruby and C# and names the Python equivalent. Where Python uses syntax instead of a method, the hint shows the syntax, as with "Use d[k] = v." for a dict.
items = [1, 2, 3]
items.push(4)The same check turns "ada".toUpperCase() into "Did you mean '.upper'?" and ages.put("ada", 36) into "Use d[k] = v."; the page on 'list' object has no attribute runs those too.
Traceback (most recent call last):
File "/home/me/project/main.py", line 2, in <module>
items.push(4)
^^^^^^^^^^
AttributeError: 'list' object has no attribute 'push'. Did you mean '.append'?| Python | Prints |
|---|---|
| 3.14 | AttributeError: 'list' object has no attribute 'push' |
| 3.15 | AttributeError: 'list' object has no attribute 'push'. Did you mean '.append'? |
Run on CPython 3.14.9 and 3.15.1, on October 25, 2026.
A list method on a tuple
Calling a method that changes a sequence on one that cannot change now points to the mutable type.
point = (1, 2, 3)
point.append(4)Traceback (most recent call last):
File "/home/me/project/main.py", line 2, in <module>
point.append(4)
^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'append'. Did you mean to use a 'list' object?| Python | Prints |
|---|---|
| 3.14 | AttributeError: 'tuple' object has no attribute 'append' |
| 3.15 | AttributeError: 'tuple' object has no attribute 'append'. Did you mean to use a 'list' object? |
Run on CPython 3.14.9 and 3.15.1, on October 25, 2026.
Suggestions when deleting an attribute
del obj.name with a misspelt name now gets a "Did you mean" suggestion too, as reading a misspelt attribute has since 3.10.
class Settings:
pass
s = Settings()
s.colour = "red"
del s.colorTraceback (most recent call last):
File "/home/me/project/main.py", line 6, in <module>
del s.color
^^^^^^^
AttributeError: 'Settings' object has no attribute 'color'. Did you mean '.colour' instead of '.color'?| Python | Prints |
|---|---|
| 3.14 | AttributeError: 'Settings' object has no attribute 'color' |
| 3.15 | AttributeError: 'Settings' object has no attribute 'color'. Did you mean '.colour' instead of '.color'? |
Run on CPython 3.14.9 and 3.15.1, on October 25, 2026.
Wording fixes
Several messages that said "argument" where they meant "parameter", or the other way round, were corrected. The What's New list does not name them one by one.
Sources
- What's New in Python 3.15: improved error messages, Python documentation
- Python 3.15.0 release, python.org
- Python 3.15.1 release, python.org
Read on October 25, 2026.