PythonExtra/tests/basics/types1.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
460 B
Python
Raw Permalink Normal View History

2014-01-05 12:39:59 +01:00
# basic types
# similar test for set type is done in set_type.py
2014-01-05 12:39:59 +01:00
print(bool)
print(int)
print(tuple)
print(list)
print(dict)
print(type(bool()) == bool)
print(type(int()) == int)
print(type(tuple()) == tuple)
print(type(list()) == list)
print(type(dict()) == dict)
print(type(False) == bool)
print(type(0) == int)
print(type(()) == tuple)
print(type([]) == list)
print(type({}) == dict)
try:
bool.foo
except AttributeError:
print("AttributeError")