5cd0b2227f
Tests in basics (which should probably be renamed to core) should not rely on float, or import any non-built-in files. This way these tests can be run when those features are not available. All test in basics now pass on the pyboard using stmhal port, except for string-repr which has some issues with character hex printing.
28 lines
473 B
Python
28 lines
473 B
Python
# basic types
|
|
|
|
print(bool)
|
|
print(int)
|
|
print(tuple)
|
|
print(list)
|
|
print(set)
|
|
print(dict)
|
|
|
|
print(type(bool()) == bool)
|
|
print(type(int()) == int)
|
|
print(type(tuple()) == tuple)
|
|
print(type(list()) == list)
|
|
print(type(set()) == set)
|
|
print(type(dict()) == dict)
|
|
|
|
print(type(False) == bool)
|
|
print(type(0) == int)
|
|
print(type(()) == tuple)
|
|
print(type([]) == list)
|
|
print(type({None}) == set)
|
|
print(type({}) == dict)
|
|
|
|
try:
|
|
bool.foo
|
|
except AttributeError:
|
|
print("AttributeError")
|