Skip to content

Commit 577d0fa

Browse files
committed
Add example of binop specialization
1 parent fcc9b93 commit 577d0fa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ that caused the error instead of just the line. For example:
9191
9292
Previous versions of the interpreter would point to just the line making it
9393
ambiguous which object was ``None``. These enhanced errors can also be helpful
94-
when dealing with deeply nested dictionary objects and multiple function calls:
94+
when dealing with deeply nested dictionary objects and multiple function calls,
9595

9696
.. code-block:: python
9797
@@ -110,6 +110,16 @@ when dealing with deeply nested dictionary objects and multiple function calls:
110110
~~~~~~~~~~~~~~~~~~^^^^^
111111
TypeError: 'NoneType' object is not subscriptable
112112
113+
as well as complex arithmetic expressions:
114+
115+
.. code-block:: python
116+
117+
Traceback (most recent call last):
118+
File "calculation.py", line 54, in <module>
119+
result = (x / y / z) * (a / b / c)
120+
~~~~~~^~~
121+
ZeroDivisionError: division by zero
122+
113123
See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
114124
and Ammar Askar in :issue:`43950`.)
115125

0 commit comments

Comments
 (0)