From 27465e6b24e80fdcdaddd015fe8f690122f78ef8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 10 Feb 2020 22:22:12 +1100 Subject: tests/basics: Add tests for equality between bool and int/float/complex. False/True should be implicitly converted to 0/1 when compared with numeric types. --- tests/basics/set_basic.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/basics/set_basic.py') diff --git a/tests/basics/set_basic.py b/tests/basics/set_basic.py index 6ea69e4f0..2d1653622 100644 --- a/tests/basics/set_basic.py +++ b/tests/basics/set_basic.py @@ -10,6 +10,10 @@ print(sorted(s)) s = {1 + len(s)} print(s) +# bools mixed with integers +s = {False, True, 0, 1, 2} +print(len(s)) + # Sets are not hashable try: {s: 1} -- cgit v1.2.3