FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Apply suggestions from code review · ProducerMatt/python@6bdb1ae · GitHub

Repository navigation

Commit 6bdb1ae

Browse files
andcommitted
Apply suggestions from code review
Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
1 parent 11d4006 commit 6bdb1ae

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎docs/TRACEBACKS.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ E AssertionError
140140

141141
### **AttributeError**
142142
An `AttributeError` is raised when code (or a unit test!) tries to access the attribute of an object but that object has no such attribute.
143-
For example, a unit test excepts a `Robot` object to have a `direction` attribute but when it tried to access `robot.direction`, it does not exist.
143+
For example, a unit test expects a `Robot` object to have a `direction` attribute, but when it tried to access `robot.direction`, it does not exist.
144144

145145
This could also indicate a typo, such as using `"Hello".lowercase()` when the correct syntax is `"Hello".lower()`.
146146
`"Hello".lowercase()` raises `AttributeError: 'str' object has no attribute 'lowercase'`.
@@ -242,7 +242,7 @@ E ImportError: In your 'lasagna.py' file, we can not find or import the functi
242242

243243
### **IndexError**
244244

245-
Python raises an `IndexError` when an invalid index is used to look up a value in a list.
245+
Python raises an `IndexError` when an invalid index is used to look up a value in a sequence.
246246
This often indicates the index is not computed properly and is often an off-by-one error.
247247

248248

@@ -354,11 +354,13 @@ E TypeError: can only concatenate str (not "int") to str
354354

355355
### **ValueError**
356356
A `ValueError` is usually raised when an invalid value is passed to function.
357+
358+
357359
<details>
358360
<summary>Click here for code example</summary>
359361

360362

361-
Note, real square roots only exist for position numbers.
363+
Note, real square roots only exist for positive numbers.
362364
Calling `math.sqrt(-1)` will raise `ValueError: math domain error` since `-1` is not a valid value for a square root.
363365
In (mathematical) technical terms, -1 is not in the domain of square roots.
364366

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL