mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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.
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
s = {1, 2, 3, 4}
|
||||
print(s.add(5))
|
||||
print(sorted(s))
|
||||
|
||||
s = set()
|
||||
s.add(0)
|
||||
s.add(False)
|
||||
print(s)
|
||||
|
||||
s = set()
|
||||
s.add(False)
|
||||
s.add(0)
|
||||
print(s)
|
||||
|
||||
s = set()
|
||||
s.add(1)
|
||||
s.add(True)
|
||||
print(s)
|
||||
|
||||
s = set()
|
||||
s.add(True)
|
||||
s.add(1)
|
||||
print(s)
|
||||
|
||||
Reference in New Issue
Block a user