Message304112
# Create a dict and a set
d = {1: '1'}
s = {1}
# They have different types
print(type(d)) # <type 'dict'>
print(type(s)) # <type 'set'>
print(type(d) is type(s)) # False
print(type(s) is type(d)) # False
print(type(d) == type(s)) # False
# Dictionary type is found in 'types' module
print(type(d) is types.DictType) # True
print(type(d) is types.DictionaryType) # True
print(types.DictType == types.DictionaryType) # True
# Set type is not found in 'types' module
print(type(s) is types.DictType) # False
print(type(s) is types.DictionaryType) # False
print(type(s) is types.DictProxyType) # False
print(type(s) is types.ListType) # False
print(type(s) is types.SliceType) # False
print(type(s) is types.TupleType) # False
print(type(s) is types.NotImplementedType) # False
print(type(s) is types.SetType) # AttributeError: 'module' object has no attribute 'SetType' |
|
| Date |
User |
Action |
Args |
| 2017-10-11 07:45:29 | Kenji Asuka (Asuka Kenji) | set | recipients:
+ Kenji Asuka (Asuka Kenji) |
| 2017-10-11 07:45:29 | Kenji Asuka (Asuka Kenji) | set | messageid: <1507707929.59.0.213398074469.issue31755@psf.upfronthosting.co.za> |
| 2017-10-11 07:45:29 | Kenji Asuka (Asuka Kenji) | link | issue31755 messages |
| 2017-10-11 07:45:29 | Kenji Asuka (Asuka Kenji) | create | |
|