* Implement bool to int and int to bool implicit conversion for SPython * Change "and", "or" and "not" operations to be logical in SPython * Add standard functions' overloads (all, any, sum)
17 lines
246 B
Plaintext
17 lines
246 B
Plaintext
# int to bool and bool to int implicit conversion
|
|
|
|
a: int = True
|
|
b: bool = 5
|
|
|
|
if 10:
|
|
print((1 > 0) + 1)
|
|
|
|
while 0:
|
|
print('Infinite loop')
|
|
|
|
print(bool(1))
|
|
print(filter(bool, [0, 1, 2]))
|
|
|
|
print(all([0, 1, 3]))
|
|
print(sum([True, False, True]))
|