8000 bpo-26680: Incorporate is_integer in all built-in and standard library numeric types by rob-smallshire · Pull Request #6121 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-26680: Incorporate is_integer in all built-in and standard library numeric types #6121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-26680: Adds a test to ensure that False.is_integer() and True.is_…
…integer() are always True.
  • Loading branch information
rob-smallshire committed Sep 18, 2020
commit b46a9dcef39b889718dac6089ec9cf6bae23566f
5 changes: 5 additions & 0 deletions Lib/test/test_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ def test_real_and_imag(self):
self.assertIs(type(False.real), int)
self.assertIs(type(False.imag), int)

def test_always_is_integer(self):
# Issue #26680: Incorporating number.is_integer into bool
self.assertTrue(all(b.is_integer() for b in (False, True)))


def test_main():
support.run_unittest(BoolTest)

Expand Down
0