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.

classification
Title: type(dict with docstring) returns set instead of dict
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: razvan.paul.blaga, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2015-07-28 11:19 by razvan.paul.blaga, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg247517 - (view) Author: razvan.paul.blaga (razvan.paul.blaga) Date: 2015-07-28 11:19
d = {
'''
Commented dictionary values
'''
}

print type(d) # returns 'set' instead of 'dict'
msg247518 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-07-28 11:32
https://docs.python.org/3/reference/expressions.html#set-displays
msg247519 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-07-28 11:46
It is really a set ;-) It's just that set representation is close to dict representation.

$ python3
>>> set((1, 2, 3))
{1, 2, 3}
>>> {'key': 3}
{'key': 3}
msg247520 - (view) Author: razvan.paul.blaga (razvan.paul.blaga) Date: 2015-07-28 11:52
Thank you for the explanation and docs link.

I promise to do my research before submitting another bug report ;)

cheers
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68930
2015-07-28 11:52:04razvan.paul.blagasetmessages: + msg247520
2015-07-28 11:46:22vstinnersetnosy: + vstinner
messages: + msg247519
2015-07-28 11:32:32serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg247518

resolution: not a bug
stage: resolved
2015-07-28 11:19:05razvan.paul.blagacreate