New submission from Kenji Asuka (Asuka Kenji) <[email protected]>:
# 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'
----------
components: Library (Lib)
messages: 304112
nosy: Kenji Asuka (Asuka Kenji)
priority: normal
severity: normal
status: open
title: SetType is missing in the 'types' module
type: compile error
versions: Python 2.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31755>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com