@@ -98,7 +98,7 @@ Improved Error Messages
98
98
99
99
* Modules from the standard library are now potentially suggested as part of
100
100
the error messages displayed by the interpreter when a :exc: `NameError ` is
101
- raised to the top level. Contributed by Pablo Galindo in :gh: `98254 `.
101
+ raised to the top level. ( Contributed by Pablo Galindo in :gh: `98254 `.)
102
102
103
103
>>> sys.version_info
104
104
Traceback (most recent call last):
@@ -109,25 +109,24 @@ Improved Error Messages
109
109
Now if a :exc: `NameError ` is raised in a method and the instance has an
110
110
attribute that's exactly equal to the name in the exception, the suggestion
111
111
will include ``self.<NAME> `` instead of the closest match in the method
112
- scope. Contributed by Pablo Galindo in :gh: `99139 `.
112
+ scope. ( Contributed by Pablo Galindo in :gh: `99139 `.)
113
113
114
114
>>> class A :
115
115
... def __init__ (self ):
116
116
... self .blech = 1
117
117
...
118
118
... def foo (self ):
119
119
... somethin = blech
120
-
120
+ ...
121
121
>>> A().foo()
122
122
Traceback (most recent call last):
123
123
File "<stdin>", line 1
124
124
somethin = blech
125
125
^^^^^
126
126
NameError: name 'blech' is not defined. Did you mean: 'self.blech'?
127
127
128
-
129
128
* Improve the :exc: `SyntaxError ` error message when the user types ``import x
130
- from y `` instead of ``from y import x ``. Contributed by Pablo Galindo in :gh: `98931 `.
129
+ from y `` instead of ``from y import x ``. ( Contributed by Pablo Galindo in :gh: `98931 `.)
131
130
132
131
>>> import a.y.z from b.y.z
133
132
Traceback (most recent call last):
@@ -138,7 +137,7 @@ Improved Error Messages
138
137
139
138
* :exc: `ImportError ` exceptions raised from failed ``from <module> import
140
139
<name> `` statements now include suggestions for the value of ``<name> `` based on the
141
- available names in ``<module> ``. Contributed by Pablo Galindo in :gh: `91058 `.
140
+ available names in ``<module> ``. ( Contributed by Pablo Galindo in :gh: `91058 `.)
142
141
143
142
>>> from collections import chainmap
144
143
Traceback (most recent call last):
0 commit comments