This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kenji Asuka (Asuka Kenji)
Recipients Kenji Asuka (Asuka Kenji)
Date 2017-10-11.07:45:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507707929.59.0.213398074469.issue31755@psf.upfronthosting.co.za>
In-reply-to
Content
# 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'
History
Date User Action Args
2017-10-11 07:45:29Kenji Asuka (Asuka Kenji)setrecipients: + Kenji Asuka (Asuka Kenji)
2017-10-11 07:45:29Kenji Asuka (Asuka Kenji)setmessageid: <1507707929.59.0.213398074469.issue31755@psf.upfronthosting.co.za>
2017-10-11 07:45:29Kenji Asuka (Asuka Kenji)linkissue31755 messages
2017-10-11 07:45:29Kenji Asuka (Asuka Kenji)create