Skip to content

Commit

Permalink
Ensure doctest works when built-in function is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
lapets committed Jun 13, 2022
1 parent eb1d569 commit f1fd489
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion isqrt/isqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def isqrt(n: int) -> int:
Test scenarios in which the :obj:`math.isqrt` function is not available.
>>> delattr(math, 'isqrt')
>>> if hasattr(math, 'isqrt'):
... delattr(math, 'isqrt')
>>> isqrt(16)
4
>>> isqrt(2**30000) == 2**15000
Expand Down

0 comments on commit f1fd489

Please sign in to comment.