Skip to content

Commit

Permalink
fixup extension docs
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnboy committed Oct 28, 2019
1 parent 8658625 commit 048387d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -991,12 +991,12 @@ Putting it all together, here is another custom assertion example, but annotated
```py
def is_multiple_of(self, other):
# validate actual value - must be "integer" (aka int or long)
if isinstance(self.val, numbers.Integral) is False and self.val > 0:
if isinstance(self.val, numbers.Integral) is False or self.val <= 0:
# bad input is error, not an assertion fail, so raise error
raise TypeError('val must be a positive integer')

# validate expected value
if isinstance(other, numbers.Integral) is False and other > 0:
if isinstance(other, numbers.Integral) is False or other <= 0:
raise TypeError('given arg must be a positive integer')

# divide and compute remainder using divmod() built-in
Expand Down

0 comments on commit 048387d

Please sign in to comment.