tests/types1: Split out set type test to set_types.
set isn't the most basic type and can be disabled by a port.
This commit is contained in:
parent
36ec5c8f27
commit
e5a6a26330
|
@ -0,0 +1,16 @@
|
||||||
|
# set type
|
||||||
|
|
||||||
|
# This doesn't really work as expected, because {None}
|
||||||
|
# leads SyntaxError during parsing.
|
||||||
|
try:
|
||||||
|
set
|
||||||
|
except NameError:
|
||||||
|
import sys
|
||||||
|
print("SKIP")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
print(set)
|
||||||
|
|
||||||
|
print(type(set()) == set)
|
||||||
|
|
||||||
|
print(type({None}) == set)
|
|
@ -1,24 +1,22 @@
|
||||||
# basic types
|
# basic types
|
||||||
|
# similar test for set type is done in set_type.py
|
||||||
|
|
||||||
print(bool)
|
print(bool)
|
||||||
print(int)
|
print(int)
|
||||||
print(tuple)
|
print(tuple)
|
||||||
print(list)
|
print(list)
|
||||||
print(set)
|
|
||||||
print(dict)
|
print(dict)
|
||||||
|
|
||||||
print(type(bool()) == bool)
|
print(type(bool()) == bool)
|
||||||
print(type(int()) == int)
|
print(type(int()) == int)
|
||||||
print(type(tuple()) == tuple)
|
print(type(tuple()) == tuple)
|
||||||
print(type(list()) == list)
|
print(type(list()) == list)
|
||||||
print(type(set()) == set)
|
|
||||||
print(type(dict()) == dict)
|
print(type(dict()) == dict)
|
||||||
|
|
||||||
print(type(False) == bool)
|
print(type(False) == bool)
|
||||||
print(type(0) == int)
|
print(type(0) == int)
|
||||||
print(type(()) == tuple)
|
print(type(()) == tuple)
|
||||||
print(type([]) == list)
|
print(type([]) == list)
|
||||||
print(type({None}) == set)
|
|
||||||
print(type({}) == dict)
|
print(type({}) == dict)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue