Skip to content

Commit 9279982

Browse files
committed
Add What's New
1 parent 8ebab58 commit 9279982

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ Improved Error Messages
9494
variables. See also :ref:`using-on-controlling-color`.
9595
(Contributed by Pablo Galindo Salgado in :gh:`112730`.)
9696

97+
* A common mistake is to write a script with the same name as a
98+
standard library module. The interpreter now detects this and
99+
displays a more helpful error message.
100+
(Contributed by Shantanu Jain in :gh:`95754`.)
101+
102+
$ python random.py
103+
Traceback (most recent call last):
104+
File "/home/random.py", line 1, in <module>
105+
import random; print(random.randint(5))
106+
^^^^^^^^^^^^^
107+
File "/home/random.py", line 1, in <module>
108+
import random; print(random.randint(5))
109+
^^^^^^^^^^^^^^
110+
AttributeError: module 'random' has no attribute 'randint' (most likely due to '/home/random.py' shadowing the standard library module named 'random')
111+
97112
Other Language Changes
98113
======================
99114

0 commit comments

Comments
 (0)