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